diff --git a/nym-wallet/src/components/Buy/Tutorial.stories.tsx b/nym-wallet/src/components/Buy/Tutorial.stories.tsx index db23ca9efc..ec73a796eb 100644 --- a/nym-wallet/src/components/Buy/Tutorial.stories.tsx +++ b/nym-wallet/src/components/Buy/Tutorial.stories.tsx @@ -1,10 +1,15 @@ import React from 'react'; import { Tutorial } from './Tutorial'; +import { MockBuyContextProvider } from '../../context/mocks/buy'; export default { - title: 'Buy/Page', + title: 'Buy/Tutorial', component: Tutorial, }; -export const BuyPage = () => ; +export const TutorialPage = () => ( + + + +); diff --git a/nym-wallet/src/components/Buy/Tutorial.tsx b/nym-wallet/src/components/Buy/Tutorial.tsx index 710b526630..1d4b40fc58 100644 --- a/nym-wallet/src/components/Buy/Tutorial.tsx +++ b/nym-wallet/src/components/Buy/Tutorial.tsx @@ -1,24 +1,90 @@ -import React from 'react'; -import { Box, Button, Stack, Typography } from '@mui/material'; +import React, { useState } from 'react'; +import { Box, Button, Stack, Typography, Grid, Link } from '@mui/material'; import { NymCard } from '../NymCard'; +import { ModalDivider } from '../Modals/ModalDivider'; +import { SignMessageModal } from './SignMessageModal'; -export const Tutorial = () => ( - - - - - How to buy NYM with Bity? - - Follow these 3 steps below to quickly and easily buy NYM tokens +export const Tutorial = () => { + const [showSignModal, setShowSignModal] = useState(false); + + return ( + + {showSignModal && setShowSignModal(false)} />} + + + + How to buy NYM with Bity? + + Follow these 3 steps below to quickly and easily buy NYM tokens + + + + + + + + + + Click on{' '} + + Buy NYM button to go to Bity’s website. + {' '} + Select the amount and currency for your purchase. Follow the steps and provide the required info i.e.{' '} + + IBAN, wallet address, etc. + + + + + + + + + When asked for signature, copy Bity’s message and{' '} + {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} + setShowSignModal(true)} + > + sign it using this link + + {'. '} + Then{' '} + + copy and paste your signature on Bity website + {' '} + as shown above. + + + + + + + + Make the transfer to Bity’s address. Once Bity receives the amount and transaction is confirmed they + will{' '} + + deposit NYM tokens to your wallet. + + + + + - - - - Card 1 - Card 2 - Card 3 - - -); + + ); +}; diff --git a/nym-wallet/src/components/Nav.tsx b/nym-wallet/src/components/Nav.tsx index 20094965fe..3036f91682 100644 --- a/nym-wallet/src/components/Nav.tsx +++ b/nym-wallet/src/components/Nav.tsx @@ -1,7 +1,14 @@ import React, { useState, useContext } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { List, ListItem, ListItemIcon, ListItemText } from '@mui/material'; -import { AccountBalanceWalletOutlined, ArrowBack, ArrowForward, Description, Settings } from '@mui/icons-material'; +import { + AccountBalanceWalletOutlined, + ArrowBack, + ArrowForward, + Description, + Settings, + Toll, +} from '@mui/icons-material'; import { AppContext } from '../context/main'; import { Delegate, Bonding } from '../svg-icons'; @@ -57,7 +64,7 @@ export const Nav = () => { { label: 'Buy', route: '/buy', - Icon: Bonding, + Icon: Toll, onClick: () => navigate('/buy'), }, ]); diff --git a/nym-wallet/src/components/NymCard.tsx b/nym-wallet/src/components/NymCard.tsx index b1927efaac..4eea4ddecd 100644 --- a/nym-wallet/src/components/NymCard.tsx +++ b/nym-wallet/src/components/NymCard.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Card, CardContent, CardHeader } from '@mui/material'; +import { Card, CardContent, CardHeader, SxProps } from '@mui/material'; import { styled, Theme } from '@mui/material/styles'; import { Title } from './Title'; @@ -18,15 +18,17 @@ export const NymCard: React.FC<{ noPadding?: boolean; borderless?: boolean; dataTestid?: string; -}> = ({ title, subheader, Action, Icon, noPadding, borderless, children, dataTestid }) => ( - + sx?: SxProps; + sxTitle?: SxProps; +}> = ({ title, subheader, Action, Icon, noPadding, borderless, children, dataTestid, sx, sxTitle }) => ( + theme.palette.text.primary, '& .MuiCardHeader-title h5': { fontSize: '1.25rem' }, }} - title={} + title={<Title title={title} Icon={Icon} sx={sxTitle} />} subheader={subheader} data-testid={dataTestid || title} subheaderTypographyProps={{ variant: 'subtitle1' }} diff --git a/nym-wallet/src/components/Title.tsx b/nym-wallet/src/components/Title.tsx index f595a4d2bf..530b9deed8 100644 --- a/nym-wallet/src/components/Title.tsx +++ b/nym-wallet/src/components/Title.tsx @@ -1,10 +1,14 @@ import React from 'react'; -import { Box, Typography } from '@mui/material'; +import { Box, SxProps, Typography } from '@mui/material'; -export const Title: React.FC<{ title: string | React.ReactNode; Icon?: React.ReactNode }> = ({ title, Icon }) => ( +export const Title: React.FC<{ title: string | React.ReactNode; Icon?: React.ReactNode; sx?: SxProps }> = ({ + title, + Icon, + sx, +}) => ( <Box width="100%" display="flex" alignItems="center"> {Icon} - <Typography width="100%" variant="h5" sx={{ fontWeight: 600 }}> + <Typography width="100%" variant="h5" sx={{ fontWeight: 600, ...sx }}> {title} </Typography> </Box> diff --git a/nym-wallet/src/pages/buy/index.stories.tsx b/nym-wallet/src/pages/buy/index.stories.tsx new file mode 100644 index 0000000000..5782f4298f --- /dev/null +++ b/nym-wallet/src/pages/buy/index.stories.tsx @@ -0,0 +1,15 @@ +import React from 'react'; + +import { Tutorial } from '../../components/Buy/Tutorial'; +import { MockBuyContextProvider } from '../../context/mocks/buy'; + +export default { + title: 'Buy/Page', + component: Tutorial, +}; + +export const BuyPage = () => ( + <MockBuyContextProvider> + <Tutorial /> + </MockBuyContextProvider> +);