Skip to content
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

Conversation

kate-deriv
Copy link
Contributor

@kate-deriv kate-deriv commented Aug 24, 2024

Changes:

User onboarding guide is controlled via guide_dtrader_v2 _(trade_page or positions_page) flag in localStorage. By default it's equal to false, but when user complete or skip the guide, it will be set to true. Guide will be shown only for logged in users with guide_dtrader_v2 _(trade_page or positions_page) === false.

  • Added react-joyride package to trader npm package
  • Created OnboardingGuide component, which include Modal from Quill UI (for staring guide) and GuideContainer. Inside this component we extract guide_dtrader_v2 _(trade_page or positions_page) flag from localStorage and if it's === false, then after 800ms we will show Modal. When Modal 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').
  • Created GuideContainer component, which includes library component Joyride and data for it (steps aka config) and data handlers. Here we are also passing a custom component for Tooltip (tooltipComponent={GuideTooltip}).
  • Created 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 set guide_dtrader_v2 _(trade_page or positions_page) equal to true. 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 set guide_dtrader_v2 _(trade_page or positions_page) equal to true.
  • Added conditional rendering of OnboardingGuide inside of Trade (packages/trader/src/AppV2/Containers/Trade/trade.tsx) in order not to load the video if user has already passed the guide.

Screenshots:

Screenshot 2024-08-29 at 4 25 30 PM
Screenshot 2024-08-30 at 4 58 48 PM
Screenshot 2024-08-30 at 4 58 44 PM
Screenshot 2024-08-30 at 4 58 52 PM
Screenshot 2024-08-30 at 4 58 39 PM
Screenshot 2024-08-30 at 4 59 06 PM
Screenshot 2024-08-30 at 4 58 34 PM
Screenshot 2024-08-30 at 4 59 01 PM
Screenshot 2024-08-30 at 4 58 26 PM
Screenshot 2024-08-30 at 4 58 57 PM

@boring-cyborg boring-cyborg bot added the Trader label Aug 24, 2024
Copy link

vercel bot commented Aug 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Sep 3, 2024 9:59am

Copy link
Contributor

github-actions bot commented Aug 24, 2024

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/16589](https://github.com/binary-com/deriv-app/pull/16589)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-kate-deriv-vinu-katedtra-1670useronbo-37ef85.binary.sx?qa_server=red.derivws.com&app_id=31586
    - **Original**: https://deriv-app-git-fork-kate-deriv-vinu-katedtra-1670useronbo-37ef85.binary.sx
- **App ID**: `31586`

Copy link
Contributor

github-actions bot commented Aug 24, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 28
🟧 Accessibility 70
🟢 Best practices 92
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-kate-deriv-vinu-katedtra-1670useronbo-37ef85.binary.sx/

@coveralls
Copy link

coveralls commented Aug 24, 2024

Coverage Status

coverage: 47.114% (+0.03%) from 47.082%
when pulling 7d7d951 on kate-deriv:vinu/kate/DTRA-1670/user_onboarding_guide
into bada74a on binary-com:master.

@kate-deriv kate-deriv marked this pull request as ready for review August 30, 2024 13:57
@kate-deriv kate-deriv changed the title DTRA / Vinu, Kate / DTRA-1670 / Onboarding Guide [DTrader-V2] [WIP] DTRA / Vinu, Kate / DTRA-1670 / Onboarding Guide [DTrader-V2] Aug 30, 2024
const GuideTooltip = ({ isLastStep, primaryProps, skipProps, step, tooltipProps, setStepIndex }: GuideTooltipProps) => {
const swipe_handlers = useSwipeable({
onSwipedUp: () => {
document.querySelector('.trade__chart')?.scrollIntoView();
Copy link
Contributor

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?

Copy link
Contributor Author

@kate-deriv kate-deriv Sep 3, 2024

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

Copy link

sonarcloud bot commented Sep 3, 2024

</TradeParametersContainer>
<PurchaseButton />
</div>
{!guide_dtrader_v2 && is_logged_in && <OnboardingGuide type='trade_page' />}
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

@vinu-deriv vinu-deriv merged commit 122e4d5 into deriv-com:master Sep 4, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants