-
-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: welcome to your project component (#8039)
Currently displaying always when flag enabled. 
- Loading branch information
Showing
8 changed files
with
158 additions
and
4 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
28 changes: 28 additions & 0 deletions
28
...nt/project/Project/PaginatedProjectFeatureToggles/ProjectOnboarding/ProjectOnboarding.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,28 @@ | ||
import { styled } from '@mui/material'; | ||
import { WelcomeToProject } from './WelcomeToProject'; | ||
|
||
interface IProjectOnboardingProps { | ||
projectId: string; | ||
} | ||
|
||
const Container = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
width: '100%', | ||
gap: theme.spacing(2), | ||
})); | ||
|
||
const SdkExample = styled('div')(({ theme }) => ({ | ||
flexBasis: '30%', | ||
padding: theme.spacing(2), | ||
backgroundColor: theme.palette.background.paper, | ||
borderRadius: theme.shape.borderRadiusLarge, | ||
})); | ||
|
||
export const ProjectOnboarding = ({ projectId }: IProjectOnboardingProps) => { | ||
return ( | ||
<Container> | ||
<WelcomeToProject projectId={projectId} /> | ||
<SdkExample>View SDK example</SdkExample> | ||
</Container> | ||
); | ||
}; |
104 changes: 104 additions & 0 deletions
104
...ent/project/Project/PaginatedProjectFeatureToggles/ProjectOnboarding/WelcomeToProject.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,104 @@ | ||
import { styled, Typography } from '@mui/material'; | ||
import Add from '@mui/icons-material/Add'; | ||
import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; | ||
import { FlagCreationButton } from '../ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader'; | ||
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; | ||
|
||
interface IWelcomeToProjectProps { | ||
projectId: string; | ||
} | ||
|
||
const Container = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
backgroundColor: theme.palette.background.paper, | ||
flexBasis: '70%', | ||
borderRadius: theme.shape.borderRadiusLarge, | ||
})); | ||
|
||
const TitleBox = styled('div')(({ theme }) => ({ | ||
padding: theme.spacing(2, 7, 2, 7), | ||
borderBottom: '1px solid', | ||
borderColor: theme.palette.divider, | ||
})); | ||
|
||
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 CircleContainer = styled('span')(({ theme }) => ({ | ||
width: '28px', | ||
height: '28px', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
backgroundColor: theme.palette.neutral.border, | ||
borderRadius: '50%', | ||
})); | ||
|
||
export const WelcomeToProject = ({ projectId }: IWelcomeToProjectProps) => { | ||
return ( | ||
<Container> | ||
<TitleBox> | ||
<Typography fontWeight='bold'> | ||
Welcome to your project | ||
</Typography> | ||
<Typography variant='body2'> | ||
Complete the steps below to start working with this project | ||
</Typography> | ||
</TitleBox> | ||
<Actions> | ||
<ActionBox> | ||
<TitleContainer> | ||
<CircleContainer>1</CircleContainer> | ||
Create a feature flag | ||
</TitleContainer> | ||
<Typography> | ||
<div> | ||
The project currently holds no feature toggles. | ||
</div> | ||
<div>Create a feature flag to get started.</div> | ||
</Typography> | ||
<FlagCreationButton /> | ||
</ActionBox> | ||
<ActionBox> | ||
<TitleContainer> | ||
<CircleContainer>2</CircleContainer> | ||
Connect an SDK | ||
</TitleContainer> | ||
<Typography> | ||
We have not detected any connected SDKs on this project. | ||
</Typography> | ||
<ResponsiveButton | ||
onClick={() => {}} | ||
maxWidth='200px' | ||
projectId={projectId} | ||
Icon={Add} | ||
disabled={true} | ||
permission={CREATE_FEATURE} | ||
> | ||
Connect SDK | ||
</ResponsiveButton> | ||
</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
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