Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show previous steps incomplete modal for instructions & setup #2331

Merged
merged 6 commits into from
Oct 17, 2024
13 changes: 13 additions & 0 deletions app/components/course-page/previous-steps-incomplete-overlay.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<BlurredOverlay
@isBlurred={{@isBlurred}}
@overlayClass="bg-gray-200 bg-opacity-20 dark:bg-gray-800 dark:bg-opacity-20"
class="px-3 md:px-6 lg:px-10"
...attributes
>
<:content>
{{yield}}
</:content>
<:overlay>
<CoursePage::PreviousStepsIncompleteModal class="mt-8 mx-3 md:mx-6" @onClose={{@onClose}} @activeStep={{@activeStep}} />
</:overlay>
</BlurredOverlay>
24 changes: 24 additions & 0 deletions app/components/course-page/previous-steps-incomplete-overlay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Component from '@glimmer/component';
import type Step from 'codecrafters-frontend/utils/course-page-step-list/step';

interface Signature {
Element: HTMLDivElement;

Args: {
isBlurred: boolean;
onClose: () => void;
activeStep: Step;
};

Blocks: {
default: [];
};
}

export default class PreviousStepsIncompleteOverlayComponent extends Component<Signature> {}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'CoursePage::PreviousStepsIncompleteOverlay': typeof PreviousStepsIncompleteOverlayComponent;
}
}
19 changes: 5 additions & 14 deletions app/components/course-page/step-content.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,12 @@
/>
{{/if}}

<BlurredOverlay
<CoursePage::PreviousStepsIncompleteOverlay
@isBlurred={{this.shouldShowPreviousStepsIncompleteModal}}
@overlayClass="bg-gray-200 bg-opacity-20 dark:bg-gray-800 dark:bg-opacity-20"
class="px-3 md:px-6 lg:px-10"
@onClose={{this.handlePreviousStepsIncompleteModalDismissed}}
@activeStep={{this.coursePageState.activeStep}}
{{did-update this.handleStepIdUpdated @step.id}}
>
<:content>
{{yield}}
</:content>
<:overlay>
<CoursePage::PreviousStepsIncompleteModal
class="mt-8 mx-3 md:mx-6"
@onClose={{this.handlePreviousStepsIncompleteModalDismissed}}
@activeStep={{this.coursePageState.activeStep}}
/>
</:overlay>
</BlurredOverlay>
{{yield}}
</CoursePage::PreviousStepsIncompleteOverlay>
</div>
Loading