-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTRA / Vinu, Kate / DTRA-1670 / Onboarding Guide [DTrader-V2] #16589
DTRA / Vinu, Kate / DTRA-1670 / Onboarding Guide [DTrader-V2] #16589
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
🚨 Lighthouse report for the changes in this PR:
Lighthouse ran with https://deriv-app-git-fork-kate-deriv-vinu-katedtra-1670useronbo-37ef85.binary.sx/ |
packages/trader/src/AppV2/Components/OnboardingGuide/guide-container.tsx
Outdated
Show resolved
Hide resolved
packages/trader/src/AppV2/Components/OnboardingGuide/guide-container.tsx
Outdated
Show resolved
Hide resolved
packages/trader/src/AppV2/Components/OnboardingGuide/guide-container.tsx
Outdated
Show resolved
Hide resolved
const GuideTooltip = ({ isLastStep, primaryProps, skipProps, step, tooltipProps, setStepIndex }: GuideTooltipProps) => { | ||
const swipe_handlers = useSwipeable({ | ||
onSwipedUp: () => { | ||
document.querySelector('.trade__chart')?.scrollIntoView(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious to ask if it can be done via ref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, but trade chart is 'too far away', so it will be a long props drilling
packages/trader/src/AppV2/Components/OnboardingGuide/onboarding-guide.tsx
Outdated
Show resolved
Hide resolved
packages/trader/src/AppV2/Components/OnboardingGuide/onboarding-video.tsx
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
</TradeParametersContainer> | ||
<PurchaseButton /> | ||
</div> | ||
{!guide_dtrader_v2 && is_logged_in && <OnboardingGuide type='trade_page' />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we meant to not show guide when logged out ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it doesn't make sense to show the guide to non-logged in users. Plus, there is also Guide for Positions page and we won't show Positions Page itself to logged out users
Changes:
User onboarding guide is controlled via
guide_dtrader_v2 _(trade_page or positions_page)
flag inlocalStorage
. By default it's equal tofalse
, but when user complete or skip the guide, it will be set totrue
. Guide will be shown only for logged in users withguide_dtrader_v2 _(trade_page or positions_page) === false
.react-joyride
package to trader npm packageOnboardingGuide
component, which includeModal
from Quill UI (for staring guide) andGuideContainer
. Inside this component we extractguide_dtrader_v2 _(trade_page or positions_page)
flag fromlocalStorage
and if it's === false, then after 800ms we will showModal
. WhenModal
is opened user have to opportunities: to skip the guide (by clicking on overlay) or to start it (by clicking on "Let's begin" button). Modal also includes looped mp4 video (OnboardingVideo
). Modal content depends on pass prop called 'type' (can be 'trade_page' | 'positions_page').GuideContainer
component, which includes library componentJoyride
and data for it (steps
aka config) and data handlers. Here we are also passing a custom component forTooltip
(tooltipComponent={GuideTooltip}
).GuideTooltip
component (based on Quill components) in order to have opportunity to use custom tooltip instead of library default one. Clicking on cross icon will stop and skip the guide and setguide_dtrader_v2 _(trade_page or positions_page)
equal totrue
. Clicking on 'Next' button will take to net step. If the step is the last one, then button label will be replaced with 'Done' and clicking on it will setguide_dtrader_v2 _(trade_page or positions_page)
equal totrue
.OnboardingGuide
inside ofTrade
(packages/trader/src/AppV2/Containers/Trade/trade.tsx) in order not to load the video if user has already passed the guide.Screenshots: