Skip to content

Commit

Permalink
fix: onboarding and bot builder tour
Browse files Browse the repository at this point in the history
  • Loading branch information
farabi-deriv committed Jul 24, 2024
1 parent 85ea075 commit 7e8741a
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</style>
</head>

<body class="body">
<body class="body theme--light">
<div id="modal_root" class="modal-root"></div>
<div id="root"></div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"react-content-loader": "^7.0.0",
"react-div-100vh": "^0.3.8",
"react-dom": "^18.2.0",
"react-joyride": "^2.5.3",
"react-joyride": "^2.8.2",
"react-loadable": "^5.5.0",
"react-router-dom": "^6.25.1",
"react-tiny-popover": "^8.0.4",
Expand Down
1 change: 0 additions & 1 deletion public/assets/icons/IcCloseCircle.svg

This file was deleted.

Binary file added public/assets/videos/bot-builder-tour-step-4.mp4
Binary file not shown.
Binary file added public/assets/videos/bot-builder-tour-step-5.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
@import "${path.resolve(__dirname, 'src/components/shared/styles/fonts.scss')}";
@import "${path.resolve(__dirname, 'src/components/shared/styles/inline-icons.scss')}";
@import "${path.resolve(__dirname, 'src/components/shared/styles/devices.scss')}";
@import "${path.resolve(__dirname, 'src/components/shared/styles/themes.scss')}";
`,
},
}),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/bot-builder/toolbox/search-box/search-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type TSearchIcon = {
const SearchIcon = observer(({ search, is_search_loading, onClick }: TSearchIcon) => {
if (!search) return <Icon icon='IcSearch' />;
if (is_search_loading) return <div className='loader' data-testid='loader' />;
return <Icon icon='IcCloseCircle' onClick={onClick} color='secondary' />;
return <Icon icon='IcDbotClose' onClick={onClick} color='secondary' />;
});

export default SearchIcon;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { observer } from 'mobx-react-lite';
import ProgressBarTracker from '@/components/shared_ui/progress-bar-tracker';
import Text from '@/components/shared_ui/text';
import { useStore } from '@/hooks/useStore';
import { getSetting } from '@/utils/settings';
import { localize } from '@/utils/tmp/dummy';
import { Text } from '@deriv-com/ui';
import TourButton from '../common/tour-button';
import TourStartDialog from '../common/tour-start-dialog';
import { BOT_BUILDER_MOBILE } from '../tour-content';
Expand Down Expand Up @@ -60,7 +60,7 @@ const BotBuilderTourMobile = observer(() => {
</Text>
</div>
<div className='dbot-slider__content'>
<Text as='span' LineHeight='sm' size='xs'>
<Text as='span' lineHeight='s' size='xs'>
{content_data?.content}
</Text>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/tutorials/dbot-tours/common/tour-button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text } from '@deriv-com/ui';
import Text from '@/components/shared_ui/text';

type TTourButton = {
type?: string;
Expand All @@ -10,7 +10,7 @@ const TourButton = ({ label, type = 'default', ...props }: TTourButton) => {
if (!label) return null;
return (
<button className={type} {...props}>
<Text color='prominent' align='center' weight='bold' as='span' LineHeight='sm' size='xs'>
<Text color='prominent' align='center' weight='bold' as='span' lineHeight='s' size='xs'>
{label}
</Text>
</button>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/tutorials/dbot-tours/common/tour-end-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { observer } from 'mobx-react-lite';
import Dialog from '@/components/shared_ui/dialog';
import Text from '@/components/shared_ui/text';
import { useStore } from '@/hooks/useStore';
import { Localize, localize } from '@/utils/tmp/dummy';
import { Dialog, Text } from '@deriv-com/ui';

const TourEndDialog = observer(() => {
const { ui } = useStore();
Expand Down
3 changes: 2 additions & 1 deletion src/pages/tutorials/dbot-tours/common/tour-start-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { observer } from 'mobx-react-lite';
import Dialog from '@/components/shared_ui/dialog';
import Text from '@/components/shared_ui/text';
import { DBOT_TABS } from '@/constants/bot-contents';
import { useStore } from '@/hooks/useStore';
import { Localize, localize } from '@/utils/tmp/dummy';
import { Dialog, Text } from '@deriv-com/ui';
import {
getBotBuilderTourHeader,
getTourDialogAction,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/tutorials/dbot-tours/common/tour-steps.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react-lite';
import Text from '@/components/shared_ui/text';
import { getUUID } from '@/external/bot-skeleton/services/tradeEngine/utils/helpers';
import { Text } from '@deriv-com/ui';

type TTourSteps = {
content: string[] | React.ReactElement[];
Expand All @@ -19,14 +19,14 @@ const TourSteps = observer(
<div className='onboard'>
{show_actions && (
<div className='onboard__header'>
<Text color='less-prominent' LineHeight='lg'>
<Text color='less-prominent' lineHeight='l'>
{step_index}/6
</Text>
</div>
)}
<div className='onboard__steps'>
<div className='onboard__label'>
<Text as='p' LineHeight='lg' weight='bold'>
<Text as='p' lineHeight='l' weight='bold'>
{label}
</Text>
</div>
Expand All @@ -52,7 +52,7 @@ const TourSteps = observer(
content_data
) : (
<div className='onboard__content__block' key={`onboard--${getUUID()}`}>
<Text align='left' as='p' size='xs' LineHeight='lg'>
<Text align='left' as='p' size='xs' lineHeight='l'>
{content_data}
</Text>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import classNames from 'classnames';
import { observer } from 'mobx-react-lite';
import ProgressBarTracker from '@/components/shared_ui/progress-bar-tracker';
import Text from '@/components/shared_ui/text';
import { useStore } from '@/hooks/useStore';
import { getSetting } from '@/utils/settings';
import { Icon, localize } from '@/utils/tmp/dummy';
import { Text } from '@deriv-com/ui';
import TourButton from '../common/tour-button';
import { DBOT_ONBOARDING_MOBILE, TMobileTourConfig } from '../tour-content';

Expand Down Expand Up @@ -63,7 +63,7 @@ const OnboardingTourMobile = observer(() => {
<Text
color='less-prominent'
weight='less-prominent'
LineHeight='sm'
lineHeight='s'
size='xxs'
data-testid='dbot-onboard-slider__navbar'
>{`${tour_step_key - 1}/7`}</Text>
Expand All @@ -84,7 +84,7 @@ const OnboardingTourMobile = observer(() => {
align='center'
className='dbot-slider__title'
as='span'
LineHeight='sm'
lineHeight='s'
size='xs'
>
{localize(header)}
Expand Down Expand Up @@ -120,7 +120,7 @@ const OnboardingTourMobile = observer(() => {
color='prominent'
className='dbot-slider__content'
as='div'
LineHeight='sm'
lineHeight='s'
size='xxs'
>
{data}
Expand Down
28 changes: 14 additions & 14 deletions src/pages/tutorials/dbot-tours/tour-content.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getImageLocation, getUrlBase } from '../../../public-path';
import { getImageLocation } from '../../../public-path';
import React from 'react';
import Text from '@/components/shared_ui/text';
import { isDbotRTL } from '@/external/bot-skeleton/utils/workspace';
import { Icon, Localize, localize } from '@/utils/tmp/dummy';
import { Text } from '@deriv-com/ui';
import TourSteps from './common/tour-steps';

type TJoyrideConfig = Record<
Expand Down Expand Up @@ -34,7 +34,7 @@ export const DBOT_ONBOARDING = [
'We also provide a guide on the Tutorial tab to show you how you can build and execute a simple strategy.'
),
]}
media={getUrlBase('/public/videos/dbot-onboarding-tour-step-1.mp4')}
media={'/assets/videos/dbot-onboarding-tour-step-1.mp4'}
step_index={1}
/>
),
Expand All @@ -47,7 +47,7 @@ export const DBOT_ONBOARDING = [
<TourSteps
label={localize('Monitor the market')}
content={[localize('View the market price of your favourite assets.')]}
media={'/public/videos/dbot-onboarding-tour-step-2.mp4'}
media={'/assets/videos/dbot-onboarding-tour-step-2.mp4'}
step_index={2}
/>
),
Expand All @@ -60,7 +60,7 @@ export const DBOT_ONBOARDING = [
<TourSteps
label={localize('Learn more with our tutorials')}
content={[localize('Explore the video guides and FAQs to build your bot in the tutorials tab.')]}
media={'/public/videos/dbot-onboarding-tour-step-3.mp4'}
media={'/assets/videos/dbot-onboarding-tour-step-3.mp4'}
step_index={3}
/>
),
Expand All @@ -86,7 +86,7 @@ export const DBOT_ONBOARDING = [
<TourSteps
label={localize('Check your bot’s performance')}
content={[localize('See how your bot is doing in real-time.')]}
media={'/public/videos/dbot-onboarding-tour-step-5.mp4'}
media={'/assets/videos/dbot-onboarding-tour-step-5.mp4'}
step_index={5}
/>
),
Expand All @@ -106,7 +106,7 @@ export const DBOT_ONBOARDING = [
components={[<strong key={0} />]}
/>,
]}
media={'/public/videos/dbot-onboarding-tour-step-6.mp4'}
media={'/assets/videos/dbot-onboarding-tour-step-6.mp4'}
step_index={6}
/>
),
Expand Down Expand Up @@ -293,7 +293,7 @@ const Step4 = ({ show_label = false }) => (
</div>
<div>
<video autoPlay loop controls playsInline preload='auto' disablePictureInPicture controlsList='nodownload'>
<source src={'/public/videos/bot-builder-tour-step-4.mp4'} type='video/mp4' />
<source src={'/assets/videos/bot-builder-tour-step-4.mp4'} type='video/mp4' />
</video>
</div>
</div>
Expand Down Expand Up @@ -343,7 +343,7 @@ const Step5 = ({ show_label = false }) => (
</div>
<div>
<video autoPlay loop controls playsInline preload='auto' disablePictureInPicture controlsList='nodownload'>
<source src={'/public/videos/bot-builder-tour-step-5.mp4'} type='video/mp4' />
<source src={'/assets/videos/bot-builder-tour-step-5.mp4'} type='video/mp4' />
</video>
</div>
</div>
Expand Down Expand Up @@ -472,15 +472,15 @@ export const DBOT_ONBOARDING_MOBILE: TMobileTourConfig[] = [
i18n_default_text='Import your bot or tap Quick Strategies to choose from the ready-to-use bot templates.'
/>,
],
media: '/public/videos/dbot-mobile-onboarding-step-1.mp4',
media: '/assets/videos/dbot-mobile-onboarding-step-1.mp4',
tour_step_key: 2,
},
{
header: localize('Monitor the market'),
content: [
<Localize key='monitor-the-market' i18n_default_text='View the market price of your favourite assets.' />,
],
media: '/public/videos/dbot-mobile-onboarding-step-2.mp4',
media: '/assets/videos/dbot-mobile-onboarding-step-2.mp4',
tour_step_key: 3,
},
{
Expand All @@ -491,7 +491,7 @@ export const DBOT_ONBOARDING_MOBILE: TMobileTourConfig[] = [
i18n_default_text='Explore the video guides and FAQs to build your bot in the tutorials tab.'
/>,
],
media: '/public/videos/dbot-mobile-onboarding-step-3.mp4',
media: '/assets/videos/dbot-mobile-onboarding-step-3.mp4',
tour_step_key: 4,
},
{
Expand All @@ -507,15 +507,15 @@ export const DBOT_ONBOARDING_MOBILE: TMobileTourConfig[] = [
},
{
header: localize('Check your bot’s performance'),
media: '/public/videos/dbot-mobile-onboarding-step-5.mp4',
media: '/assets/videos/dbot-mobile-onboarding-step-5.mp4',
content: [
<Localize key='check-your-bots-performance' i18n_default_text='See how your bot is doing in real-time.' />,
],
tour_step_key: 6,
},
{
header: localize('Run your bot'),
media: '/public/videos/dbot-mobile-onboarding-step-6.mp4',
media: '/assets/videos/dbot-mobile-onboarding-step-6.mp4',
content: [
<Localize
key='run-your-bot'
Expand Down

0 comments on commit 7e8741a

Please sign in to comment.