From b8171cf909f5c7590c86c61ecde6aa957a422aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 11 May 2023 19:01:08 +0100 Subject: [PATCH] fix: interactive demo guide adjustments (#3747) https://linear.app/unleash/issue/2-1027/adjustments https://linear.app/unleash/issue/2-989/add-imagegif-to-some-of-the-steps Includes small adjustments from the tasks above: - Adjust zIndex values for the demo guide; - Add a screenshot to better guide the users to their `userId` in the demo website; Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item: #3537 --- frontend/src/assets/img/userId-image.png | Bin 0 -> 6394 bytes frontend/src/component/demo/Demo.tsx | 9 ++++++ .../component/demo/DemoBanner/DemoBanner.tsx | 2 +- .../component/demo/DemoSteps/DemoSteps.tsx | 2 +- .../component/demo/DemoTopics/DemoTopics.tsx | 2 +- frontend/src/component/demo/demo-topics.tsx | 27 ++++++++++++++++-- frontend/src/themes/dark-theme.ts | 3 ++ frontend/src/themes/theme.ts | 3 ++ 8 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 frontend/src/assets/img/userId-image.png diff --git a/frontend/src/assets/img/userId-image.png b/frontend/src/assets/img/userId-image.png new file mode 100644 index 0000000000000000000000000000000000000000..8ecbbb82836f0012ec460d0aae0afe4b296529ca GIT binary patch literal 6394 zcmcI}WmFVi&^{m_ow7>`OG>*U0#eeAG)s4PBc*gncZV$9xzy5KN~ge*(v9?szw`h6 zKkt|K%ba`8+?csDXYTXN4Odc>!o?!TLPA2qm5~-#K|(_2eIC1Dpg&8Tl-Ev3NTgjd z;v#CE$cI@kJzuEv2E1uU6UA@8 z=8&)^prsPUCQz}oI+^h3kvFenXf@YKJ{OuWKOSx8=WkuOxvKY`8{+wz2JC%{v+<3W zxaaNnz;2X*x8HmIzf$6j3XC9lG=uiY4h@^K=PdyAfg?HqMQ$p+`pf3wmPF$>v}hyJ zNCFCq&nsTIK2}2tj5=%aD^tfd#-t%NNXp9B%!))U*@7RHbae%&?(SY`5d(NbjM#>2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iv9g;L5|Si&GLTMG^@(ZItE1BmsYSr*ddF+k!M2wd zYw-1r@#J#)G(N6ln@diuSL~=Hfb|w`aCb1b#nZw`k?X#B{B8{IlYB2&;g1Ju%O$z= z`ua|Z>cDKg&7MRRk!{xkMuSbtl4{{ zQ;U!fLt)V=D+rr3rIO}4m=MGO32k<64ol5Vw_SL;yEa_HgUhzMGzqAnY-US-ZNJsu zM5J3&eMnedc<`o9YoHE)+2(;H6SoYn>`v!yTva1@(ZI77-Do=%=iCd5_Gdy~-r?!q+@;YK&`DpA+yVdC6;hLSb`ixo3X zp-n$542OtAT0kJ4t=BjH?bexd-W8Sa*epIej$(u7y2=K&aVL#%!fg~9TAQ?X?!4yQ z*sKJcfKUEgOjHyx1D%B05Sr9KYXf0%RStVgk4C~PKvh#yqV}tnR@fRk-Vl>4SzFsA zJo4(mPdo;pI>Odg5J`R=Rq#E(EU_dp0hPZoBO7_CnnOeP#8bbw!Ep+$Je#~h#(Sy3`}MjIEi!^V{8w?!ZYvpVn@O=Hv8C&lnE(iz8Zp3QbyC2q)!Im{er#w8_ z5Xw1InIVV4fY7hDJt0?`2${Q6e)35>3Qf`}(&sP&SLr?~WlkNCT?bb;T5gF2N5Uu$ zr1bJ?XjH!k80hhMyJ&$d!-n$YH?LRWOj4m=7k;CDZ2B#~jdEn5FRU5S7Dpf9c^Rh{ z@ik9=9qZW#^$Uiy$@8>y~exH(M?wJC`g|D+KyQlQCt ze=`x)m{g}HM{L8$pUad8&dPAnKNJJOmKF2wMr z*wun1w(4DTizh)3nNJ>_rQNhGc;K5xvNeI_=lPP&t>w{i(fYBWx#iA SiqC% { }); }; + const closeGuide = () => { + setTopic(-1); + setStep(0); + }; + if (!uiConfig.flags.demo) return children; return ( <> { + closeGuide(); + setPlansOpen(true); trackEvent('demo', { @@ -154,6 +161,8 @@ export const Demo = ({ children }: IDemoProps): JSX.Element => { }} topics={TOPICS} onWelcome={() => { + closeGuide(); + setWelcomeOpen(true); trackEvent('demo', { diff --git a/frontend/src/component/demo/DemoBanner/DemoBanner.tsx b/frontend/src/component/demo/DemoBanner/DemoBanner.tsx index 91e549111b..c3f9231e65 100644 --- a/frontend/src/component/demo/DemoBanner/DemoBanner.tsx +++ b/frontend/src/component/demo/DemoBanner/DemoBanner.tsx @@ -4,7 +4,7 @@ import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; const StyledBanner = styled('div')(({ theme }) => ({ position: 'sticky', top: 0, - zIndex: theme.zIndex.appBar, + zIndex: theme.zIndex.sticky, display: 'flex', gap: theme.spacing(1), justifyContent: 'center', diff --git a/frontend/src/component/demo/DemoSteps/DemoSteps.tsx b/frontend/src/component/demo/DemoSteps/DemoSteps.tsx index 35a52af5be..5133ab40a5 100644 --- a/frontend/src/component/demo/DemoSteps/DemoSteps.tsx +++ b/frontend/src/component/demo/DemoSteps/DemoSteps.tsx @@ -255,7 +255,7 @@ export const DemoSteps = ({ styles={{ options: { arrowColor: theme.palette.background.paper, - zIndex: theme.zIndex.snackbar, + zIndex: theme.zIndex.snackbar - 1, }, spotlight: { borderRadius: theme.shape.borderRadiusMedium, diff --git a/frontend/src/component/demo/DemoTopics/DemoTopics.tsx b/frontend/src/component/demo/DemoTopics/DemoTopics.tsx index 6e2bb6ecab..b82cb563bb 100644 --- a/frontend/src/component/demo/DemoTopics/DemoTopics.tsx +++ b/frontend/src/component/demo/DemoTopics/DemoTopics.tsx @@ -20,7 +20,7 @@ const StyledAccordion = styled(Accordion)(({ theme }) => ({ left: 0, width: '100%', maxWidth: theme.spacing(30), - zIndex: theme.zIndex.fab, + zIndex: theme.zIndex.sticky, boxShadow: theme.boxShadows.popup, '&&&': { borderRadius: 0, diff --git a/frontend/src/component/demo/demo-topics.tsx b/frontend/src/component/demo/demo-topics.tsx index 5954338714..10b0db1ee7 100644 --- a/frontend/src/component/demo/demo-topics.tsx +++ b/frontend/src/component/demo/demo-topics.tsx @@ -1,9 +1,10 @@ -import { Typography, TypographyProps } from '@mui/material'; +import { Typography, TypographyProps, styled } from '@mui/material'; import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'; import { Badge } from 'component/common/Badge/Badge'; import { Step } from 'react-joyride'; import { gradualRollout, variants } from './demo-setup'; import { basePath } from 'utils/formatPath'; +import userIdImage from 'assets/img/userId-image.png'; export interface ITutorialTopicStep extends Step { href?: string; @@ -27,6 +28,10 @@ const Description = (props: TypographyProps) => ( ); +const StyledImg = styled('img')(({ theme }) => ({ + borderRadius: theme.shape.borderRadius, +})); + const PROJECT = 'demo-app'; const ENVIRONMENT = 'dev'; @@ -208,15 +213,23 @@ export const TOPICS: ITutorialTopic[] = [ Enter your userId - }> + } + > You can find your userId on the demo page. + When you're done, use the "Next" button in the dialog. ), + placement: 'right', nextButton: true, focus: 'input', }, @@ -547,15 +560,23 @@ export const TOPICS: ITutorialTopic[] = [ Enter your userId - }> + } + > You can find your userId on the demo page. + When you're done, use the "Next" button in the dialog. ), + placement: 'right', nextButton: true, backCloseModal: true, focus: 'input', diff --git a/frontend/src/themes/dark-theme.ts b/frontend/src/themes/dark-theme.ts index 28f9297667..1328870eee 100644 --- a/frontend/src/themes/dark-theme.ts +++ b/frontend/src/themes/dark-theme.ts @@ -72,6 +72,9 @@ const theme = { tableRowHeightCompact: 56, tableRowHeightDense: 48, }, + zIndex: { + sticky: 2000, + }, palette: { common: { diff --git a/frontend/src/themes/theme.ts b/frontend/src/themes/theme.ts index 0278125050..68458c14df 100644 --- a/frontend/src/themes/theme.ts +++ b/frontend/src/themes/theme.ts @@ -65,6 +65,9 @@ const theme = { tableRowHeightCompact: 56, tableRowHeightDense: 48, }, + zIndex: { + sticky: 2000, + }, palette: { common: {