Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
...attributes
>
<:content>
<AnimatedContainer>
{{#animated-if this.modalWasDismissed duration=150 use=this.transition}}
<CoursePage::CourseStageStep::TestsPassedNotice
class="px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
{{on "click" (fn (mut this.modalWasDismissed) false)}}
/>
{{/animated-if}}
</AnimatedContainer>
{{#if this.modalWasDismissed}}
<CoursePage::CourseStageStep::TestsPassedNotice
class="sticky top-10 z-10 px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
{{on "click" this.handleNoticeClick}}
/>
{{/if}}

{{yield}}
</:content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Component from '@glimmer/component';
import type CourseStageStep from 'codecrafters-frontend/utils/course-page-step-list/course-stage-step';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import fade from 'ember-animated/transitions/fade';

interface Signature {
Element: HTMLDivElement;
Expand All @@ -17,8 +16,6 @@ interface Signature {
}

export default class TestsPassedOverlay extends Component<Signature> {
transition = fade;

@tracked lastSeenStepId: string | null = null;
@tracked modalWasDismissed = false;

Expand All @@ -31,6 +28,11 @@ export default class TestsPassedOverlay extends Component<Signature> {
this.modalWasDismissed = true;
}

@action
handleNoticeClick() {
this.modalWasDismissed = false;
}

@action
handleStepIdUpdated() {
if (this.args.currentStep.id === this.lastSeenStepId) {
Expand Down
22 changes: 10 additions & 12 deletions app/components/course-page/current-step-complete-overlay.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
...attributes
>
<:content>
<AnimatedContainer>
{{#animated-if this.modalWasDismissed duration=150 use=this.transition}}
<CoursePage::CompletedStepNotice
{{! @glint-expect-error repository is nullable according to coursePageState }}
@repository={{this.coursePageState.stepList.repository}}
@step={{@currentStep}}
class="px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
/>
{{/animated-if}}
</AnimatedContainer>
{{#if this.modalWasDismissed}}
<CoursePage::CompletedStepNotice
{{! @glint-expect-error repository is nullable according to coursePageState }}
@repository={{this.coursePageState.stepList.repository}}
@step={{@currentStep}}
class="sticky top-10 z-10 px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
/>
{{/if}}

{{yield}}
</:content>
Expand Down
3 changes: 0 additions & 3 deletions app/components/course-page/current-step-complete-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { service } from '@ember/service';
import Component from '@glimmer/component';
import type CoursePageStateService from 'codecrafters-frontend/services/course-page-state';
import { StepDefinition } from 'codecrafters-frontend/utils/course-page-step-list';
import fade from 'ember-animated/transitions/fade';

interface Signature {
Element: HTMLDivElement;
Expand All @@ -19,8 +18,6 @@ interface Signature {
}

export default class CurrentStepCompleteOverlay extends Component<Signature> {
transition = fade;

@tracked modalWasDismissed = false;
@tracked lastSeenStepStatus: string | null = null;

Expand Down
18 changes: 8 additions & 10 deletions app/components/course-page/previous-steps-incomplete-overlay.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
...attributes
>
<:content>
<AnimatedContainer>
{{#animated-if this.modalWasDismissed duration=150 use=this.transition}}
<CoursePage::PreviousStepsIncompleteNotice
@step={{@currentStep}}
class="px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
/>
{{/animated-if}}
</AnimatedContainer>
{{#if this.modalWasDismissed}}
<CoursePage::PreviousStepsIncompleteNotice
@step={{@currentStep}}
class="sticky top-10 z-10 px-3 md:px-6 lg:px-10 w-full scroll-mt-20"
{{! Ensure this is visible when modal is dismissed }}
{{upscroll-on-insert scrollableContainer="#course-page-scrollable-area"}}
/>
{{/if}}

{{yield}}
</:content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { service } from '@ember/service';
import Component from '@glimmer/component';
import type CoursePageStateService from 'codecrafters-frontend/services/course-page-state';
import { StepDefinition } from 'codecrafters-frontend/utils/course-page-step-list';
import fade from 'ember-animated/transitions/fade';

interface Signature {
Element: HTMLDivElement;
Expand All @@ -19,8 +18,6 @@ interface Signature {
}

export default class PreviousStepsIncompleteOverlay extends Component<Signature> {
transition = fade;

@tracked modalWasDismissed = false;
@tracked lastSeenStepStatus: string | null = null;

Expand Down
Loading