-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
38 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,12 @@ | |
"lint:ls": "npx @ls-lint/ls-lint", | ||
"lint:next": "next lint", | ||
"lint:sass": "stylelint \"./src/**/*.scss\"", | ||
"autofix:store": "prettier src/store --write && eslint src/store --fix", | ||
"adviser:dev": "adviser --tags dev --verbose", | ||
"adviser:ci": "adviser --tags ci --verbose --quiet", | ||
"generate": "plop", | ||
"preinstall": "npm i -g [email protected]", | ||
"prepare": "husky install && node scripts/prepare.js", | ||
"autofix": "next lint --ignore-path .eslintignore --max-warnings=0 --fix", | ||
"tsc": "tsc" | ||
}, | ||
"engines": { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import type { FC } from 'react' | ||
|
||
import { memo } from 'react' | ||
import { memo, useCallback } from 'react' | ||
import dynamic from 'next/dynamic' | ||
|
||
import { View } from './ScreenIntro.view' | ||
import { store } from '@/store/store' | ||
|
||
const View = dynamic(() => import('./ScreenIntro.view').then((m) => m.View), { ssr: false }) | ||
|
||
export interface ControllerProps { | ||
className?: string | ||
onComplete?: () => void | ||
} | ||
|
||
// Controller (handles global state, router, data fetching, etc. Feeds props to the view component) | ||
export const Controller: FC<ControllerProps> = memo((props) => { | ||
return <View {...props} /> | ||
const introComplete = store(({ animations }) => animations.introComplete) | ||
const setIntroComplete = store(({ animations }) => animations.setIntroComplete) | ||
|
||
const handleComplete = useCallback(() => { | ||
setIntroComplete(true) | ||
}, [setIntroComplete]) | ||
|
||
return introComplete ? null : <View {...props} onComplete={handleComplete} /> | ||
}) | ||
|
||
Controller.displayName = 'ScreenIntro_Controller' |
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
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