-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtour-content.tsx
576 lines (548 loc) · 19.5 KB
/
tour-content.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
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 TourSteps from './common/tour-steps';
type TJoyrideConfig = Record<
'showProgress' | 'spotlightClicks' | 'disableBeacon' | 'disableOverlay' | 'disableCloseOnEsc',
boolean
> & {
placement?: 'bottom' | 'top' | 'left' | 'right';
};
const joyride_props: TJoyrideConfig = {
showProgress: false,
spotlightClicks: false,
disableBeacon: true,
disableOverlay: true,
disableCloseOnEsc: true,
};
export const DBOT_ONBOARDING = [
{
target: '#id-bot-builder',
content: (
<TourSteps
label={localize('Build from scratch')}
content={[
localize(
'Create your bot using our drag-and-drop blocks or click Quick Strategy to choose from the ready-to-use bot templates.'
),
localize(
'We also provide a guide on the Tutorial tab to show you how you can build and execute a simple strategy.'
),
]}
media={'/assets/videos/dbot-onboarding-tour-step-1.mp4'}
step_index={1}
/>
),
...joyride_props,
disableOverlay: false,
},
{
target: '#id-charts',
content: (
<TourSteps
label={localize('Monitor the market')}
content={[localize('View the market price of your favourite assets.')]}
media={'/assets/videos/dbot-onboarding-tour-step-2.mp4'}
step_index={2}
/>
),
...joyride_props,
disableOverlay: false,
},
{
target: '#id-tutorials',
content: (
<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={'/assets/videos/dbot-onboarding-tour-step-3.mp4'}
step_index={3}
/>
),
...joyride_props,
disableOverlay: false,
},
{
target: '#tab__dashboard__table__tiles',
content: (
<TourSteps
label={localize('Use these shortcuts')}
content={[localize('You can also import or build your bot using any of these shortcuts.')]}
step_index={4}
/>
),
placement: isDbotRTL() ? 'left' : 'right',
...joyride_props,
disableOverlay: false,
},
{
target: '.dc-drawer__container',
content: (
<TourSteps
label={localize('Check your bot’s performance')}
content={[localize('See how your bot is doing in real-time.')]}
media={'/assets/videos/dbot-onboarding-tour-step-5.mp4'}
step_index={5}
/>
),
placement: isDbotRTL() ? 'right' : 'left',
...joyride_props,
disableOverlay: false,
},
{
target: '.animation__wrapper',
content: (
<TourSteps
label={localize('Run your bot')}
content={[
<Localize
key='run your bot'
i18n_default_text='Click <0>Run</0> when you want to start trading, and click <0>Stop</0> when you want to stop.'
components={[<strong key={0} />]}
/>,
]}
media={'/assets/videos/dbot-onboarding-tour-step-6.mp4'}
step_index={6}
/>
),
...joyride_props,
disableOverlay: false,
},
{
target: '#id-tutorials',
content: (
<TourSteps
label={localize('Want to retake the tour?')}
content={[
<Text key={`${0}-id-tutorials`} as='p'>
<Localize i18n_default_text={`Head to the Tutorials tab to do so.`} />
</Text>,
]}
step_index={7}
show_actions={false}
has_localize_component
/>
),
locale: { last: localize('Got it, thanks!') },
...joyride_props,
hideBackButton: true,
disableOverlay: false,
},
];
const Step1 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left'>
<Localize i18n_default_text='Step 1 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text={'First, set the <0>Trade parameters</0> block.'}
components={[<strong key={0} />]}
/>
</div>
<div className='joyride-content__left joyride-content__sub-title'>
<Localize i18n_default_text='<0>1. Trade parameters:<0>' components={[<strong key={0} />]} />
</div>
<div className='joyride-content__left'>
<ul>
<li>
<Localize
i18n_default_text='First, set <0>Market</0> to Derived > Continuous Indices > Volatility 100 (1s) Index.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='Then, set <0>Trade type</0> to Up/Down > Rise/Fall.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='For <0>Contract type,</0> set it to Both.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='For <0>Default candle interval,</0> set it to 1 minute'
components={[<strong key={0} />]}
/>
</li>
</ul>
</div>
</div>
);
const Step1A = () => (
<div className='joyride-content'>
<div className='joyride-content__left'>
<Localize
i18n_default_text='For <0>Trade options</0>, set it as below:'
components={[<strong key={0} />]}
/>
</div>
<div className='joyride-content__left'>
<ul>
<li>
<Localize i18n_default_text='<0>Duration</0>: Ticks 1' components={[<strong key={0} />]} />
</li>
<li>
<Localize
i18n_default_text='<0>Stake: USD</0> 10 (min: 0.35 - max: 50000)'
components={[<strong key={0} />]}
/>
</li>
</ul>
</div>
</div>
);
const Step2 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left'>
<Localize i18n_default_text='Step 2 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text='Then, set the <0>Purchase conditions</0> block.'
components={[<strong key={0} />]}
/>
</div>
<div className='joyride-content__left joyride-content__sub-title'>
<Localize i18n_default_text='<0>2. Purchase conditions</0>:' components={[<strong key={0} />]} />
</div>
<div className='joyride-content__left'>
<ul>
<li>
<Localize i18n_default_text='<0>Purchase</0>: Rise' components={[<strong key={0} />]} />
</li>
</ul>
</div>
</div>
);
const Step3 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left joyride-content__left__step-three'>
<Localize i18n_default_text='Step 3 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text='The third block is <0>optional</0>. You may use this block if you want to sell your contract before it expires. For now, leave the block as it is. '
components={[<strong key={0} />]}
/>
</div>
</div>
);
const Step4 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left'>
<Localize i18n_default_text='Step 4 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text='Next, go to <0>Utility tab</0> under the Blocks menu. Tap the drop-down arrow and hit <0>Loops</0>.'
components={[<strong key={0} />]}
/>
</div>
<div className='joyride-content__left'>
<ul>
<li>
<Localize
i18n_default_text='Look for the <0>Repeat While/Until</0>, and click the + icon to add the block to the workspace area.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='Choose <0>until</0> as the repeat option.'
components={[<strong key={0} />]}
/>
</li>
</ul>
<div className='joyride-content__left joyride-content__with-icon'>
<div className='joyride-content__with-icon__left'>
<Icon icon='IcCheckmarkCircle' className='db-contract-card__result-icon' color='green' />
</div>
<div className='joyride-content__with-icon__right'>
<Localize
i18n_default_text='Pro tip: You can also click and drag out the desired block'
components={[<strong key={0} />]}
/>
</div>
</div>
</div>
<div>
<video autoPlay loop controls playsInline preload='auto' disablePictureInPicture controlsList='nodownload'>
<source src={'/assets/videos/bot-builder-tour-step-4.mp4'} type='video/mp4' />
</video>
</div>
</div>
);
const Step5 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left'>
<Localize i18n_default_text='Step 5 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text='Now, tap the <0>Analysis</0> drop-down arrow and hit <0>Contract</0>.'
components={[<strong key={0} />]}
/>
</div>
<div className='joyride-content__left'>
<ul>
<li>
<Localize
i18n_default_text='Go to the <0>Last trade result</0> block and click + icon to add the <0>Result is Win</0> block to the workspace.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='Then, drag the <0>Result is win</0> into the empty slot next to <0>repeat until</0> block.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='Now, go to the <0>Restart trading conditions</0> block.'
components={[<strong key={0} />]}
/>
</li>
<li>
<Localize
i18n_default_text='Drag the <0>Trade again</0> block and add it into the <0>do</0> part of the <0>Repeat until</0> block.'
components={[<strong key={0} />]}
/>
</li>
</ul>
</div>
<div>
<video autoPlay loop controls playsInline preload='auto' disablePictureInPicture controlsList='nodownload'>
<source src={'/assets/videos/bot-builder-tour-step-5.mp4'} type='video/mp4' />
</video>
</div>
</div>
);
const Step6 = ({ show_label = false }) => (
<div className='joyride-content'>
{show_label && (
<div className='joyride-content__left'>
<Localize i18n_default_text='Step 6 :' />
</div>
)}
<div className='joyride-content__left'>
<Localize
i18n_default_text='Finally, drag and add the whole <0>Repeat</0> block to the <0>Restart trading conditions</0> block.'
components={[<strong key={0} />]}
/>
</div>
</div>
);
export const BOT_BUILDER_TOUR = [
{
target: '.animation__wrapper',
content: <Step1 show_label />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step1A />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step2 show_label />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step3 show_label />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step4 show_label />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step5 show_label />,
placement: isDbotRTL() ? 'bottom' : 'right',
...joyride_props,
},
{
target: '.animation__wrapper',
content: <Step6 show_label />,
locale: { last: localize('Next') },
...joyride_props,
},
];
export type TMobileTourConfig = {
header: string;
content: Array<React.ReactElement>;
tour_step_key: number;
img?: string;
media?: string;
};
export const BOT_BUILDER_MOBILE: TMobileTourConfig[] = [
{
header: localize('Step 1'),
content: [<Localize key='step-1' i18n_default_text={`First, click the Import icon on the tool bar.`} />],
tour_step_key: 1,
},
{
header: localize('Step 2'),
content: [
<Localize
key='step-2'
i18n_default_text={`Next, import your bot directly from your mobile device or from Google Drive.`}
/>,
],
tour_step_key: 2,
},
{
header: localize('Step 3'),
content: [
<Localize
key='step-3'
i18n_default_text={`Once imported, you will see a preview of the bot on the workspace. Click run to start trading with this bot.`}
/>,
],
tour_step_key: 3,
},
];
export const DBOT_ONBOARDING_MOBILE: TMobileTourConfig[] = [
{
header: localize('Get started on Deriv Bot'),
content: [
<Localize
key='get-started-on-deriv-bot'
i18n_default_text='Hi! Hit <0>Start</0> for a quick tour.'
components={[<strong key={0} />]}
/>,
],
tour_step_key: 1,
},
{
header: localize('Import or choose your bot'),
content: [
<Localize
key='import-or-choose-your-bot'
i18n_default_text='Import your bot or tap Quick Strategies to choose from the ready-to-use bot templates.'
/>,
],
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: '/assets/videos/dbot-mobile-onboarding-step-2.mp4',
tour_step_key: 3,
},
{
header: localize('Learn more with our tutorials'),
content: [
<Localize
key='learn-more-with-our-tutorials'
i18n_default_text='Explore the video guides and FAQs to build your bot in the tutorials tab.'
/>,
],
media: '/assets/videos/dbot-mobile-onboarding-step-3.mp4',
tour_step_key: 4,
},
{
header: localize('Use these shortcuts'),
img: getImageLocation('dbot-mobile-onboarding-step-4.png'),
content: [
<Localize
key='use-these-shortcuts'
i18n_default_text='You can also import or build your bot using any of these shortcuts.'
/>,
],
tour_step_key: 5,
},
{
header: localize('Check your bot’s performance'),
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: '/assets/videos/dbot-mobile-onboarding-step-6.mp4',
content: [
<Localize
key='run-your-bot'
i18n_default_text='Click <0>Run</0> when you want to start trading, and click <0>Stop</0> when you want to stop.'
components={[<strong key={0} />]}
/>,
],
tour_step_key: 7,
},
{
header: localize('Want to retake the tour?'),
img: getImageLocation('dbot-mobile-onboarding-step-7.png'),
content: [<Localize key='want-to-retake-the-tour' i18n_default_text='Head to the Tutorials tab to do so.' />],
tour_step_key: 8,
},
];
export const getTourDialogInfo = (is_mobile: boolean) => {
return is_mobile ? (
<Localize
key='tour-dialog-info-mobile'
i18n_default_text='Here’s a quick guide on how to use Deriv Bot on the go.'
/>
) : (
<Localize
key='tour-dialog-info-desktop'
i18n_default_text='Learn how to build your bot from scratch using a simple strategy.'
/>
);
};
export const getTourDialogAction = (is_mobile: boolean) => {
if (is_mobile) {
return (
<Localize
key='tour-dialog-action-mobile'
i18n_default_text='You can import a bot from your mobile device or from Google drive, see a preview in the bot builder, and start trading by running the bot.'
/>
);
}
return (
<Localize
key='tour-dialog-action-desktop'
i18n_default_text='Hit the <0>Start</0> button to begin and follow the tutorial.'
/>
);
};
export const onboarding_tour_header = (
<Localize key='onboarding-tour-header' i18n_default_text='Get started on Deriv Bot' />
);
export const getBotBuilderTourHeader = (is_mobile: boolean) => {
if (is_mobile) {
return <Localize key='tour_header-mobile' i18n_default_text='Bot Builder guide' />;
}
return <Localize key='tour_header-desktop' i18n_default_text="Let's build a Bot!" />;
};