-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade more environments (#8804)
- Loading branch information
Showing
3 changed files
with
95 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
93 changes: 93 additions & 0 deletions
93
frontend/src/component/project/ProjectEnvironment/UpgradeMoreEnvironments.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,93 @@ | ||
import { Box, IconButton, Link, styled, Tooltip } from '@mui/material'; | ||
import upgradeEnvironments from 'assets/img/upgradeEnvironments.png'; | ||
import { formatAssetPath } from 'utils/formatPath'; | ||
import Close from '@mui/icons-material/Close'; | ||
import { useLocalStorageState } from 'hooks/useLocalStorageState'; | ||
|
||
const Wrapper = styled(Box)(({ theme }) => ({ | ||
marginTop: theme.spacing(3), | ||
width: '100%', | ||
backgroundColor: theme.palette.background.elevation1, | ||
borderRadius: theme.shape.borderRadiusMedium, | ||
padding: theme.spacing(2), | ||
display: 'flex', | ||
justifyContent: 'center', | ||
position: 'relative', | ||
})); | ||
|
||
const StyledLink = styled(Link)(({ theme }) => ({ | ||
textDecoration: 'none', | ||
fontWeight: theme.typography.fontWeightBold, | ||
})); | ||
|
||
const StyledImage = styled('img')(({ theme }) => ({ | ||
width: theme.spacing(20), | ||
})); | ||
|
||
const StyledCloseButton = styled(IconButton)(({ theme }) => ({ | ||
position: 'absolute', | ||
top: theme.spacing(1.25), | ||
right: theme.spacing(1.5), | ||
})); | ||
|
||
const MainContent = styled(Box)(({ theme }) => ({ | ||
display: 'flex', | ||
gap: theme.spacing(3), | ||
marginTop: theme.spacing(2), | ||
marginBottom: theme.spacing(2), | ||
})); | ||
|
||
const MainText = styled(Box)(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
gap: theme.spacing(1), | ||
maxWidth: theme.spacing(60), | ||
})); | ||
|
||
export const UpgradeMoreEnvironments = () => { | ||
const [moreEnvironmentsUpgrade, setMoreEnvironmentsUpgrade] = | ||
useLocalStorageState<'open' | 'closed'>( | ||
'upgrade-environments:v1', | ||
'open', | ||
); | ||
|
||
if (moreEnvironmentsUpgrade === 'closed') return null; | ||
|
||
return ( | ||
<Wrapper> | ||
<MainContent> | ||
<StyledImage | ||
src={formatAssetPath(upgradeEnvironments)} | ||
alt='Multiple environments' | ||
/> | ||
<MainText> | ||
<b>Need more environments?</b> | ||
<p> | ||
You are currently using our open-source version, which | ||
allows for only two environments. With our Enterprise | ||
offering, you can have unlimited environments to better | ||
suit your organization's needs. | ||
</p> | ||
<StyledLink | ||
href='https://www.getunleash.io/upgrade-unleash?utm_source=environments' | ||
target='_blank' | ||
> | ||
View our Enterprise offering | ||
</StyledLink> | ||
</MainText> | ||
</MainContent> | ||
<Tooltip title='Dismiss' arrow> | ||
<StyledCloseButton | ||
aria-label='dismiss' | ||
onClick={() => { | ||
setMoreEnvironmentsUpgrade('closed'); | ||
}} | ||
size='small' | ||
> | ||
<Close fontSize='inherit' /> | ||
</StyledCloseButton> | ||
</Tooltip> | ||
</Wrapper> | ||
); | ||
}; |