Skip to content

Commit

Permalink
feat: add mobile condition with modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jainpawan21 committed Apr 18, 2024
1 parent c4c7e69 commit 3c1b7bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { Modal, useMantineTheme, Grid } from '@mantine/core';

import styled from '@emotion/styled';
Expand All @@ -22,6 +22,13 @@ export function OnboardingExperimentModal() {
setOpened(true);
};

useEffect(() => {
segment.track('Welcome modal open - [Onboarding]', {
experiment_id: '2024-w15-onb',
_organization: currentOrganization?._id,
});
}, [currentOrganization?._id, segment]);

return (
<Modal
opened={opened}
Expand Down
9 changes: 2 additions & 7 deletions apps/web/src/pages/quick-start/steps/GetStarted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@ export function GetStarted() {
channelType?: ChannelTypeEnum;
}>({ open: false });

const isOnboardingModalEnabled = localStorage.getItem(OnboardingExperimentV2ModalKey) === 'true';
const isOnboardingModalEnabled =
localStorage.getItem(OnboardingExperimentV2ModalKey) === 'true' && window.innerWidth > 768;

const onIntegrationModalClose = () => setClickedChannel({ open: false });

useEffect(() => {
segment.track(OnBoardingAnalyticsEnum.CONFIGURE_PROVIDER_VISIT);
if (isOnboardingModalEnabled) {
segment.track('Welcome modal open - [Onboarding]', {
experiment_id: '2024-w15-onb',
_organization: currentOrganization?._id,
});
}
}, [currentOrganization?._id, isOnboardingModalEnabled, segment]);

function handleOnClick() {
Expand Down

0 comments on commit 3c1b7bb

Please sign in to comment.