-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #776 from CareTogether/family-screen-v2
Family screen v2
- Loading branch information
Showing
12 changed files
with
8,397 additions
and
7,570 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
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
33 changes: 33 additions & 0 deletions
33
src/caretogether-pwa/src/Families/FamilyScreenPageVersionSwitch.tsx
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useRecoilState } from 'recoil'; | ||
import PageVersionSwitch from '../Generic/PageVersionSwitch'; | ||
import { familyScreenV2State } from './familyScreenV2State'; | ||
import { useFeatureFlags } from '../Model/ConfigurationModel'; | ||
import { useEffect } from 'react'; | ||
|
||
export default function FamilyScreenPageVersionSwitch() { | ||
const [familyScreenV2Flag, setFamilyScreenV2Flag] = | ||
useRecoilState(familyScreenV2State); | ||
|
||
const flags = useFeatureFlags(); | ||
|
||
useEffect(() => { | ||
if (familyScreenV2Flag === undefined) { | ||
setFamilyScreenV2Flag(flags?.familyScreenV2 ?? false); | ||
} | ||
}, [flags?.familyScreenV2, setFamilyScreenV2Flag, familyScreenV2Flag]); | ||
|
||
if (!flags?.familyScreenPageVersionSwitch) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<PageVersionSwitch | ||
sx={{ | ||
marginLeft: 'auto', | ||
}} | ||
checked={familyScreenV2Flag ?? false} | ||
onChange={(checked) => setFamilyScreenV2Flag(checked)} | ||
label="Use new family screen?" | ||
/> | ||
); | ||
} |
Oops, something went wrong.