mango-v4-ui/components/tours/SwapOnboardingTour.tsx

59 lines
1.6 KiB
TypeScript
Raw Normal View History

import { useTranslation } from 'next-i18next'
2022-09-21 21:25:24 -07:00
import { CardinalOrientation, Walktour, WalktourLogic } from 'walktour'
import CustomTooltip from './CustomTooltip'
const SwapOnboardingTour = () => {
const { t } = useTranslation('onboarding-tours')
2022-09-21 21:25:24 -07:00
const renderTooltip = (tourLogic: WalktourLogic | undefined) => {
2022-09-22 21:00:42 -07:00
return <CustomTooltip tourLogic={tourLogic!} hasSeenKey="swap_tour_seen" />
2022-09-21 21:25:24 -07:00
}
const steps = [
{
selector: '#swap-step-zero',
title: t('swap'),
description: t('swap-desc'),
2022-09-21 21:25:24 -07:00
orientationPreferences: [CardinalOrientation.CENTER],
},
{
selector: '#swap-step-one',
title: t('swap-settings'),
description: t('swap-settings-desc'),
2022-09-21 21:25:24 -07:00
orientationPreferences: [CardinalOrientation.WESTNORTH],
movingTarget: true,
},
{
selector: '#swap-step-two',
title: t('from-token'),
description: t('from-token-desc'),
2022-09-21 21:25:24 -07:00
orientationPreferences: [CardinalOrientation.WESTNORTH],
movingTarget: true,
},
{
selector: '#swap-step-three',
title: t('to-token'),
description: t('to-token-desc'),
2022-09-21 21:25:24 -07:00
orientationPreferences: [CardinalOrientation.WESTNORTH],
movingTarget: true,
},
{
selector: '#swap-step-four',
title: t('health-impact'),
description: t('health-impact-desc'),
2022-09-21 21:25:24 -07:00
orientationPreferences: [CardinalOrientation.WESTNORTH],
movingTarget: true,
},
]
return (
<Walktour
customTooltipRenderer={renderTooltip}
steps={steps}
updateInterval={200}
disableCloseOnClick
/>
)
}
export default SwapOnboardingTour