Skip to content

Commit

Permalink
Do not create specific property in TutorialContainer for hideDone
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 30, 2024
1 parent ebace3b commit ac3f599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions webapp/src/components/tutorial/TutorialContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface TutorialContainerProps {
hasTemplate?: boolean;
preferredEditor?: string;
hasBeenResized?: boolean;
hideDone?: boolean;

tutorialOptions?: pxt.tutorial.TutorialOptions; // TODO (shakao) pass in only necessary subset
tutorialSimSidebar?: boolean;
Expand All @@ -38,7 +37,7 @@ const MAX_HEIGHT = 194;

export function TutorialContainer(props: TutorialContainerProps) {
const { parent, tutorialId, name, steps, hideIteration, hasTemplate,
preferredEditor, tutorialOptions, hideDone, onTutorialStepChange, onTutorialComplete,
preferredEditor, tutorialOptions, onTutorialStepChange, onTutorialComplete,
setParentHeight } = props;
const [ currentStep, setCurrentStep ] = React.useState(props.currentStep || 0);
const [ stepErrorAttemptCount, setStepErrorAttemptCount ] = React.useState(0);
Expand Down Expand Up @@ -236,6 +235,7 @@ export function TutorialContainer(props: TutorialContainerProps) {
})
}

const hideDone = tutorialOptions.metadata?.hideDone;
const doneButtonLabel = lf("Finish the tutorial.");
const nextButtonLabel = lf("Go to the next step of the tutorial.");
const nextButton = isDone
Expand Down
1 change: 0 additions & 1 deletion webapp/src/sidepanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export class Sidepanel extends data.Component<SidepanelProps, SidepanelState> {
preferredEditor={tutorialOptions.metadata?.preferredEditor}
tutorialSimSidebar={this.props.tutorialSimSidebar}
hasBeenResized={this.state.resized && this.state.shouldResize}
hideDone={tutorialOptions.metadata?.hideDone}
onTutorialStepChange={onTutorialStepChange}
onTutorialComplete={onTutorialComplete}
setParentHeight={newSize => this.setComponentHeight(newSize, false)} /> : undefined;
Expand Down

0 comments on commit ac3f599

Please sign in to comment.