-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
89 changes: 89 additions & 0 deletions
89
...Overview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/UpgradeChangeRequests.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,89 @@ | ||
import { Box, IconButton, Link, styled, Tooltip } from '@mui/material'; | ||
import upgradeChangeRequests from 'assets/img/upgradeChangeRequests.png'; | ||
import { formatAssetPath } from 'utils/formatPath'; | ||
import Close from '@mui/icons-material/Close'; | ||
import { useLocalStorageState } from 'hooks/useLocalStorageState'; | ||
|
||
const Wrapper = styled(Box)(({ theme }) => ({ | ||
backgroundColor: theme.palette.background.paper, | ||
borderRadius: theme.shape.borderRadiusMedium, | ||
border: `1px solid ${theme.palette.secondary.border}`, | ||
padding: theme.spacing(2), | ||
display: 'flex', | ||
position: 'relative', | ||
})); | ||
|
||
const StyledLink = styled(Link)(({ theme }) => ({ | ||
textDecoration: 'none', | ||
fontWeight: theme.typography.fontWeightBold, | ||
})); | ||
|
||
const StyledImage = styled('img')(({ theme }) => ({ | ||
height: theme.spacing(6), | ||
})); | ||
|
||
const StyledCloseButton = styled(IconButton)(({ theme }) => ({ | ||
position: 'absolute', | ||
top: theme.spacing(0.5), | ||
right: theme.spacing(0.5), | ||
})); | ||
|
||
const MainContent = styled(Box)(({ theme }) => ({ | ||
display: 'flex', | ||
gap: theme.spacing(3), | ||
marginLeft: theme.spacing(0.5), | ||
marginRight: theme.spacing(1), | ||
})); | ||
|
||
const MainText = styled(Box)(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
gap: theme.spacing(0.5), | ||
})); | ||
|
||
export const UpgradeChangeRequests = () => { | ||
const [changeRequestsUpgrade, setChangeRequestUpgrade] = | ||
useLocalStorageState<'open' | 'closed'>( | ||
'upgrade-change-requests:v1', | ||
'open', | ||
); | ||
|
||
if (changeRequestsUpgrade === 'closed') return null; | ||
|
||
return ( | ||
<Wrapper> | ||
<MainContent> | ||
<StyledImage | ||
src={formatAssetPath(upgradeChangeRequests)} | ||
alt='Change requests' | ||
/> | ||
<MainText> | ||
<p> | ||
Include <b>Change Requests</b> in your process to bring | ||
a pull request-like experience to your feature flags. | ||
Reduce the risk of errors with the four-eyes approval | ||
principle. | ||
</p> | ||
<StyledLink | ||
href='https://www.getunleash.io/upgrade-unleash?utm_source=change-requests' | ||
target='_blank' | ||
> | ||
View our Enterprise offering | ||
</StyledLink> | ||
</MainText> | ||
</MainContent> | ||
<Tooltip title='Dismiss' arrow> | ||
<StyledCloseButton | ||
aria-label='dismiss' | ||
onClick={() => { | ||
setChangeRequestUpgrade('closed'); | ||
}} | ||
size='small' | ||
> | ||
<Close fontSize='inherit' /> | ||
</StyledCloseButton> | ||
</Tooltip> | ||
</Wrapper> | ||
); | ||
}; |