-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
5 changed files
with
94 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
76 changes: 76 additions & 0 deletions
76
apps/web/src/components/layout/components/PolishingBanner.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,76 @@ | ||
import { useMantineTheme } from '@mantine/core'; | ||
import { useSegment } from '../../../hooks/useSegment'; | ||
import { Close } from '../../../design-system/icons/actions/Close'; | ||
import styled from '@emotion/styled'; | ||
import { useLocalStorage } from '@mantine/hooks'; | ||
|
||
export function PolishingBanner() { | ||
const isDark = useMantineTheme().colorScheme === 'dark'; | ||
const segment = useSegment(); | ||
const [polishingBannerDismissed, setPolishingBannerDismissed] = useLocalStorage({ | ||
key: 'polishingBannerDismissed', | ||
defaultValue: 'false', | ||
}); | ||
const selfHosted = process.env.REACT_APP_DOCKER_HOSTED_ENV === 'true'; | ||
|
||
if (selfHosted || polishingBannerDismissed === 'true') return null; | ||
|
||
function DismissIcon() { | ||
function dismissBanner() { | ||
segment.track('Polishing Banner Dismiss'); | ||
setPolishingBannerDismissed('true'); | ||
} | ||
|
||
return ( | ||
<CloseWrapper onClick={dismissBanner}> | ||
<Close /> | ||
</CloseWrapper> | ||
); | ||
} | ||
|
||
return ( | ||
<div | ||
style={{ | ||
marginBottom: 10, | ||
width: '100%', | ||
borderRadius: 7, | ||
minHeight: 50, | ||
backgroundColor: isDark ? '#1E1E26' : 'white', | ||
textAlign: 'center', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
position: 'relative', | ||
}} | ||
> | ||
We are polishing! This release is dedicated to bug fixes, UI improvements and performance optimizations.{' '} | ||
<a | ||
href={'https://novu.co/polishing?utm_source=web&utm_medium=banner&utm_campaign=polishing'} | ||
onClick={() => { | ||
segment.track('Polishing Banner Clicked'); | ||
}} | ||
target={'_blank'} | ||
rel="noreferrer" | ||
style={{ textDecoration: 'underline', display: 'inline-block', marginLeft: 5 }} | ||
> | ||
Learn More. | ||
</a> | ||
<DismissIcon /> | ||
</div> | ||
); | ||
} | ||
|
||
const CloseWrapper = styled.a` | ||
float: right; | ||
position: absolute; | ||
right: 15px; | ||
font-size: 10px; | ||
padding: 5px; | ||
&:hover { | ||
cursor: pointer; | ||
} | ||
svg { | ||
width: 13px; | ||
} | ||
`; |
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