-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added button to sidebar to show world completion modal. Cleaned up Wo…
…rld Completion modal.
- Loading branch information
1 parent
dad78ed
commit 66fc20e
Showing
15 changed files
with
110 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Components/Core/Presentation/React/LearningSpaceDisplay/SideBar/ISideBarPresenter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import ILearningWorldAdapter from "src/Components/Core/Application/Ports/LearningWorldPort/ILearningWorldAdapter"; | ||
|
||
export default interface ISideBarPresenter {} | ||
export default interface ISideBarPresenter extends ILearningWorldAdapter {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Components/Core/Presentation/React/LearningSpaceDisplay/SideBar/SideBarPresenter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
import LearningWorldTO from "src/Components/Core/Application/DataTransferObjects/LearningWorldTO"; | ||
import ISideBarPresenter from "./ISideBarPresenter"; | ||
import SideBarViewModel from "./SideBarViewModel"; | ||
import LearningWorldScoreTO from "src/Components/Core/Application/DataTransferObjects/LearningWorldScoreTO"; | ||
|
||
export default class SideBarPresenter implements ISideBarPresenter { | ||
constructor(private viewModel: SideBarViewModel) {} | ||
|
||
onLearningWorldLoaded(world: LearningWorldTO): void { | ||
this.viewModel.allowWorldCompletionModalButtonClick = world.spaces.every( | ||
(space) => space.currentScore >= space.requiredScore, | ||
); | ||
} | ||
|
||
onLearningWorldScored(learningWorldScoreTO: LearningWorldScoreTO): void { | ||
this.viewModel.allowWorldCompletionModalButtonClick = | ||
learningWorldScoreTO.currentScore >= learningWorldScoreTO.requiredScore; | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
src/Components/Core/Presentation/React/LearningSpaceDisplay/SideBar/SideBarViewModel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export default class SideBarViewModel {} | ||
export default class SideBarViewModel { | ||
allowWorldCompletionModalButtonClick: boolean = false; | ||
} |
4 changes: 3 additions & 1 deletion
4
.../LearningSpaceMenu/LearningWorldCompletionModal/ILearningWorldCompletionModalPresenter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import ILearningWorldAdapter from "src/Components/Core/Application/Ports/LearningWorldPort/ILearningWorldAdapter"; | ||
|
||
export default interface ILearningWorldCompletionModalPresenter | ||
extends ILearningWorldAdapter {} | ||
extends ILearningWorldAdapter { | ||
openModal(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.