mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-28 17:55:15 +02:00
refactor: use splash api to store splash state
This commit is contained in:
parent
fcce0f852c
commit
a0c415877e
@ -36,6 +36,8 @@ import {
|
|||||||
import { ContentGridNoProjects } from './ContentGridNoProjects';
|
import { ContentGridNoProjects } from './ContentGridNoProjects';
|
||||||
import ExpandMore from '@mui/icons-material/ExpandMore';
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
|
import useSplashApi from 'hooks/api/actions/useSplashApi/useSplashApi';
|
||||||
|
import { useAuthSplash } from 'hooks/api/getters/useAuth/useAuthSplash';
|
||||||
|
|
||||||
export const StyledCardTitle = styled('div')<{ lines?: number }>(
|
export const StyledCardTitle = styled('div')<{ lines?: number }>(
|
||||||
({ theme, lines = 2 }) => ({
|
({ theme, lines = 2 }) => ({
|
||||||
@ -265,6 +267,8 @@ const NoActiveFlagsInfo = styled('div')(({ theme }) => ({
|
|||||||
export const PersonalDashboard = () => {
|
export const PersonalDashboard = () => {
|
||||||
const { user } = useAuthUser();
|
const { user } = useAuthUser();
|
||||||
const { trackEvent } = usePlausibleTracker();
|
const { trackEvent } = usePlausibleTracker();
|
||||||
|
const { setSplashSeen } = useSplashApi();
|
||||||
|
const { splash } = useAuthSplash();
|
||||||
|
|
||||||
const name = user?.name;
|
const name = user?.name;
|
||||||
|
|
||||||
@ -285,7 +289,7 @@ export const PersonalDashboard = () => {
|
|||||||
|
|
||||||
const [welcomeDialog, setWelcomeDialog] = useLocalStorageState<
|
const [welcomeDialog, setWelcomeDialog] = useLocalStorageState<
|
||||||
'open' | 'closed'
|
'open' | 'closed'
|
||||||
>('welcome-dialog:v1', 'open');
|
>('welcome-dialog:v1', splash?.personalDashboard ? 'closed' : 'open');
|
||||||
|
|
||||||
const { personalDashboardProjectDetails, error: detailsError } =
|
const { personalDashboardProjectDetails, error: detailsError } =
|
||||||
usePersonalDashboardProjectDetails(activeProject);
|
usePersonalDashboardProjectDetails(activeProject);
|
||||||
@ -299,9 +303,6 @@ export const PersonalDashboard = () => {
|
|||||||
!detailsError && activeProjectStage === 'loading',
|
!detailsError && activeProjectStage === 'loading',
|
||||||
);
|
);
|
||||||
|
|
||||||
const [createFlagDialogOpen, setCreateFlagDialogOpen] =
|
|
||||||
React.useState(false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainContent>
|
<MainContent>
|
||||||
<WelcomeSection>
|
<WelcomeSection>
|
||||||
@ -449,7 +450,10 @@ export const PersonalDashboard = () => {
|
|||||||
</SectionAccordion>
|
</SectionAccordion>
|
||||||
<WelcomeDialog
|
<WelcomeDialog
|
||||||
open={welcomeDialog === 'open'}
|
open={welcomeDialog === 'open'}
|
||||||
onClose={() => setWelcomeDialog('closed')}
|
onClose={() => {
|
||||||
|
setSplashSeen('personalDashboard');
|
||||||
|
setWelcomeDialog('closed');
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</MainContent>
|
</MainContent>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user