Skip to content

Commit

Permalink
This is not required and no reason to increase complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
travjenkins committed Jan 3, 2025
1 parent 8580907 commit a4e1b79
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/app/guards/OnboardGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { createOnboardingStore } from 'directives/Onboard/Store/create';
import { useMemo } from 'react';
import { OnboardingStoreNames } from 'stores/names';
import { BaseComponentProps } from 'types';
import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
import { Stack } from '@mui/material';
import useDirectiveGuard from './hooks';

const SELECTED_DIRECTIVE = 'betaOnboard';
Expand All @@ -18,16 +16,10 @@ const SELECTED_DIRECTIVE = 'betaOnboard';
// stop passing in the grantsMutate and pass the directiveGuard mutate.
interface Props extends BaseComponentProps {
grantsMutate: any;
AlertElement?: () => EmotionJSX.Element | null;
forceDisplay?: boolean;
}

function OnboardGuard({
AlertElement,
children,
forceDisplay,
grantsMutate,
}: Props) {
function OnboardGuard({ children, forceDisplay, grantsMutate }: Props) {
const { directive, loading, status } = useDirectiveGuard(
SELECTED_DIRECTIVE,
{ forceNew: forceDisplay }
Expand All @@ -44,14 +36,11 @@ function OnboardGuard({
return (
<FullPageWrapper fullWidth={true}>
<LocalZustandProvider createStore={localStore}>
<Stack spacing={2}>
{AlertElement ? <AlertElement /> : null}
<BetaOnboard
directive={directive}
status={status}
mutate={grantsMutate}
/>
</Stack>
<BetaOnboard
directive={directive}
status={status}
mutate={grantsMutate}
/>
</LocalZustandProvider>
</FullPageWrapper>
);
Expand Down

0 comments on commit a4e1b79

Please sign in to comment.