-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: after onboarding show success box with resources (#8278)
- Loading branch information
Showing
5 changed files
with
183 additions
and
12 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
153 changes: 153 additions & 0 deletions
153
frontend/src/component/onboarding/flow/ProjectOnboarded.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,153 @@ | ||
import { IconButton, styled, Tooltip, Typography } from '@mui/material'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import Check from '@mui/icons-material/Check'; | ||
import People from '@mui/icons-material/People'; | ||
import MenuBook from '@mui/icons-material/MenuBook'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
interface IProjectOnboardedProps { | ||
projectId: string; | ||
onClose: () => void; | ||
} | ||
|
||
const Container = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
backgroundColor: theme.palette.background.paper, | ||
flexBasis: '70%', | ||
borderRadius: theme.shape.borderRadiusLarge, | ||
})); | ||
|
||
const TitleRow = styled('div')(({ theme }) => ({ | ||
padding: theme.spacing(2, 4, 2, 7), | ||
borderBottom: '1px solid', | ||
borderColor: theme.palette.divider, | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'flex-start', | ||
gap: theme.spacing(3), | ||
alignItems: 'center', | ||
})); | ||
|
||
const Actions = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexGrow: 1, | ||
})); | ||
|
||
const ActionBox = styled('div')(({ theme }) => ({ | ||
flexBasis: '50%', | ||
padding: theme.spacing(3, 2, 6, 8), | ||
display: 'flex', | ||
gap: theme.spacing(3), | ||
flexDirection: 'column', | ||
})); | ||
|
||
const TitleContainer = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: theme.spacing(2), | ||
alignItems: 'center', | ||
fontSize: theme.spacing(1.75), | ||
fontWeight: 'bold', | ||
})); | ||
|
||
const Title = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
})); | ||
|
||
const StyledCheck = styled(Check)(({ theme }) => ({ | ||
backgroundColor: theme.palette.primary.main, | ||
color: theme.palette.background.paper, | ||
borderRadius: '50%', | ||
padding: theme.spacing(0.5), | ||
width: '28px', | ||
height: '28px', | ||
})); | ||
|
||
const ColoredPeople = styled(People)(({ theme }) => ({ | ||
color: theme.palette.primary.main, | ||
})); | ||
|
||
const ColoredMenuBook = styled(MenuBook)(({ theme }) => ({ | ||
color: theme.palette.primary.main, | ||
})); | ||
|
||
export const ProjectOnboarded = ({ | ||
projectId, | ||
onClose, | ||
}: IProjectOnboardedProps) => { | ||
return ( | ||
<Container> | ||
<TitleRow> | ||
<StyledCheck /> | ||
<Title> | ||
<Typography fontWeight='bold'>Setup completed</Typography> | ||
<Typography variant='body2'>Next steps</Typography> | ||
</Title> | ||
|
||
<Tooltip title='Close' arrow sx={{ ml: 'auto' }}> | ||
<IconButton onClick={onClose} size='small'> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
</TitleRow> | ||
<Actions> | ||
<ActionBox> | ||
<TitleContainer> | ||
Expose your feature flag to users | ||
</TitleContainer> | ||
<Typography> | ||
You can have fine grained control over who is exposed to | ||
your feature flag by leveraging{' '} | ||
<Link | ||
className='unleash-action-button' | ||
to={`https://docs.getunleash.io/reference/activation-strategies`} | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
> | ||
strategies | ||
</Link> | ||
. Visit the feature flag page to start adding strategies | ||
to control exposure. | ||
</Typography> | ||
</ActionBox> | ||
<ActionBox> | ||
<TitleContainer> | ||
<ColoredPeople /> | ||
Add members to your project | ||
</TitleContainer> | ||
<Typography> | ||
Unleash is best when collaborating with your co-workers.{' '} | ||
<Link | ||
className='unleash-action-button' | ||
to={`/projects/${projectId}/settings/access`} | ||
> | ||
Add your co-workers to the project | ||
</Link> | ||
. | ||
</Typography> | ||
</ActionBox> | ||
<ActionBox> | ||
<TitleContainer> | ||
<ColoredMenuBook /> | ||
Learn about unleash | ||
</TitleContainer> | ||
<Typography> | ||
Take a deep dive through our documentation,{' '} | ||
<Link | ||
className='unleash-action-button' | ||
to={`https://docs.getunleash.io/unleash-academy/foundational`} | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
> | ||
starting with the foundations of Unleash | ||
</Link> | ||
. | ||
</Typography> | ||
</ActionBox> | ||
</Actions> | ||
</Container> | ||
); | ||
}; |
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