-
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.
Merge branch 'next' of https://github.com/novuhq/novu into next
- Loading branch information
Showing
9 changed files
with
170 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
### What change does this PR introduce? | ||
### What changed? Why was the change needed? | ||
<!-- Also include any relevant links, such as Linear tickets, Slack discussions, or design documents. --> | ||
|
||
<!-- Explain here the changes your PR introduces and text to help us understand the context of this change. --> | ||
### Screenshots | ||
<!-- If the changes are visual, include screenshots or screencasts. --> | ||
|
||
### Why was this change needed? | ||
<details> | ||
<summary><strong>Expand for optional sections</strong></summary> | ||
|
||
<!-- If your PR fixes an open issue, use `Closes #999` to link your PR with the issue. #999 stands for the issue number you are fixing, Example: Closes #31 --> | ||
### Related enterprise PR | ||
<!-- A link to a dependent pull request --> | ||
|
||
### Other information (Screenshots) | ||
### Special notes for your reviewer | ||
<!-- Specific instructions or considerations you want to highlight for the reviewer. --> | ||
|
||
<!-- Add notes or any other information here --> | ||
<!-- Also add all the screenshots which support your changes --> | ||
</details> |
Submodule .source
updated
from 1bc46c to c73989
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 @@ | ||
export const OnboardingExperimentV2ModalKey = 'nv_onboarding_modal'; |
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
125 changes: 125 additions & 0 deletions
125
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.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,125 @@ | ||
import { useState } from 'react'; | ||
import { Modal, useMantineTheme, Grid } from '@mantine/core'; | ||
|
||
import styled from '@emotion/styled'; | ||
import { colors, shadows, Title, Button } from '@novu/design-system'; | ||
import { useAuthContext, useSegment } from '@novu/shared-web'; | ||
import { useCreateOnboardingExperimentWorkflow } from '../../../api/hooks/notification-templates/useCreateOnboardingExperimentWorkflow'; | ||
import { OnboardingExperimentV2ModalKey } from '../../../constants/experimentsConstants'; | ||
import { OnBoardingAnalyticsEnum } from '../consts'; | ||
|
||
export function OnboardingExperimentModal() { | ||
const [opened, setOpened] = useState(true); | ||
const theme = useMantineTheme(); | ||
const segment = useSegment(); | ||
const { currentOrganization } = useAuthContext(); | ||
const { | ||
createOnboardingExperimentWorkflow, | ||
isLoading: IsCreateOnboardingExpWorkflowLoading, | ||
isDisabled: isIsCreateOnboardingExpWorkflowDisabled, | ||
} = useCreateOnboardingExperimentWorkflow(); | ||
const handleOnClose = () => { | ||
setOpened(true); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
opened={opened} | ||
overlayColor={theme.colorScheme === 'dark' ? colors.BGDark : colors.BGLight} | ||
overlayOpacity={0.7} | ||
styles={{ | ||
modal: { | ||
backgroundColor: theme.colorScheme === 'dark' ? colors.B15 : colors.white, | ||
width: '700px', | ||
}, | ||
body: { | ||
paddingTop: '5px', | ||
paddingInline: '8px', | ||
}, | ||
}} | ||
title={<Title size={2}>What would you like to do first?</Title>} | ||
sx={{ backdropFilter: 'blur(10px)' }} | ||
shadow={theme.colorScheme === 'dark' ? shadows.dark : shadows.medium} | ||
radius="md" | ||
size="lg" | ||
onClose={handleOnClose} | ||
centered | ||
withCloseButton={false} | ||
> | ||
<Grid> | ||
<Grid.Col xs={12} md={6} mb={20}> | ||
<ChannelCard> | ||
<TitleRow>Send test notification</TitleRow> | ||
<Description>Learn how to set up a workflow and send your first email notification.</Description> | ||
<StyledButton | ||
loading={IsCreateOnboardingExpWorkflowLoading} | ||
disabled={isIsCreateOnboardingExpWorkflowDisabled} | ||
pulse={true} | ||
variant="gradient" | ||
onClick={async () => { | ||
segment.track(OnBoardingAnalyticsEnum.ONBOARDING_EXPERIMENT_TEST_NOTIFICATION, { | ||
action: 'Modal - Send test notification', | ||
experiment_id: '2024-w15-onb', | ||
_organization: currentOrganization?._id, | ||
}); | ||
localStorage.removeItem(OnboardingExperimentV2ModalKey); | ||
createOnboardingExperimentWorkflow(); | ||
}} | ||
> | ||
Send test notification now | ||
</StyledButton> | ||
</ChannelCard> | ||
</Grid.Col> | ||
<Grid.Col xs={12} md={6} mb={20}> | ||
<ChannelCard> | ||
<TitleRow> Look around</TitleRow> | ||
<Description>Start exploring the Novu app on your own terms</Description> | ||
<StyledButton | ||
variant="outline" | ||
onClick={async () => { | ||
segment.track(OnBoardingAnalyticsEnum.ONBOARDING_EXPERIMENT_TEST_NOTIFICATION, { | ||
action: 'Modal - Get started', | ||
experiment_id: '2024-w15-onb', | ||
_organization: currentOrganization?._id, | ||
}); | ||
localStorage.removeItem(OnboardingExperimentV2ModalKey); | ||
setOpened(false); | ||
}} | ||
> | ||
Get started | ||
</StyledButton> | ||
</ChannelCard> | ||
</Grid.Col> | ||
</Grid> | ||
</Modal> | ||
); | ||
} | ||
|
||
const ChannelCard = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
flex-direction: column; | ||
max-width: 230px; | ||
`; | ||
|
||
const TitleRow = styled.div` | ||
display: flex; | ||
align-items: center; | ||
font-size: 20px; | ||
line-height: 32px; | ||
margin-bottom: 8px; | ||
`; | ||
|
||
const Description = styled.div` | ||
flex: auto; | ||
font-size: 16px; | ||
line-height: 20px; | ||
margin-bottom: 20px; | ||
color: ${colors.B60}; | ||
height: 60px; | ||
`; | ||
|
||
const StyledButton = styled(Button)` | ||
width: fit-content; | ||
outline: none; | ||
`; |
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