-
-
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.
- Loading branch information
Showing
3 changed files
with
95 additions
and
1 deletion.
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.
90 changes: 90 additions & 0 deletions
90
frontend/src/component/admin/users/UsersList/UpgradeSSO.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,90 @@ | ||
import { Box, IconButton, Link, styled, Tooltip } from '@mui/material'; | ||
import upgradeSso from 'assets/img/upgradeSso.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(10), | ||
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(14), | ||
})); | ||
|
||
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(1), | ||
marginBottom: theme.spacing(1), | ||
})); | ||
|
||
const MainText = styled(Box)(({ theme }) => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
gap: theme.spacing(1), | ||
maxWidth: theme.spacing(60), | ||
})); | ||
|
||
export const UpgradeSSO = () => { | ||
const [ssoUpgrade, setSsoUpgrade] = useLocalStorageState<'open' | 'closed'>( | ||
'upgrade-sso:v1', | ||
'open', | ||
); | ||
|
||
if (ssoUpgrade === 'closed') return null; | ||
|
||
return ( | ||
<Wrapper> | ||
<MainContent> | ||
<StyledImage | ||
src={formatAssetPath(upgradeSso)} | ||
alt='Single sign-on' | ||
/> | ||
<MainText> | ||
<p> | ||
Streamline access and account management, reduce setup | ||
time and enhance security with <b>Single Sign-On</b> and{' '} | ||
<b>Automatic User Provisioning via SCIM</b>. | ||
</p> | ||
<StyledLink | ||
href='https://www.getunleash.io/upgrade-unleash?utm_source=sso' | ||
target='_blank' | ||
> | ||
View our Enterprise offering | ||
</StyledLink> | ||
</MainText> | ||
</MainContent> | ||
<Tooltip title='Dismiss' arrow> | ||
<StyledCloseButton | ||
aria-label='dismiss' | ||
onClick={() => { | ||
setSsoUpgrade('closed'); | ||
}} | ||
size='small' | ||
> | ||
<Close fontSize='inherit' /> | ||
</StyledCloseButton> | ||
</Tooltip> | ||
</Wrapper> | ||
); | ||
}; |
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