Skip to content

Commit

Permalink
Tab orientation vertical when mobile device (#890)
Browse files Browse the repository at this point in the history
* tab orientation vertical when mobile device
* fixed: tab text alignment
  • Loading branch information
borislavstoychev authored Jul 15, 2022
1 parent 0da9a38 commit 28ee664
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/one-time-donation/steps/SecondStep.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TabContext, TabList } from '@mui/lab'
import TabPanel from '@mui/lab/TabPanel'
import { Box, Tab, Typography } from '@mui/material'
import { Box, Tab, Typography, useMediaQuery } from '@mui/material'
import { useTranslation } from 'next-i18next'
import React, { useState } from 'react'
import AnonymousMenu from '../AnonymousForm'
Expand All @@ -9,6 +9,7 @@ import RegisterForm from '../RegisterDialog'

export default function SecondStep() {
const { t } = useTranslation('one-time-donation')
const mobile = useMediaQuery('(max-width:575px)')

const [value, setValue] = useState('1')

Expand All @@ -21,7 +22,13 @@ export default function SecondStep() {
<Typography variant="h4">{t('step-labels.personal-profile')}</Typography>
<Typography>{t('second-step.intro-text')}</Typography>
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<TabList value={value} onChange={handleChange} aria-label="personal info">
<TabList
variant="fullWidth"
orientation={mobile ? 'vertical' : 'horizontal'}
centered
value={value}
onChange={handleChange}
aria-label="personal info">
<Tab label={t('second-step.login')} value="1" />
<Tab label={t('second-step.new-create-profile')} value="2" />
<Tab label={t('second-step.donate-anonymously')} value="3" />
Expand Down

0 comments on commit 28ee664

Please sign in to comment.