|
| 1 | +import * as React from 'react'; |
| 2 | +import Box from '@mui/material/Box'; |
| 3 | +import Container from '@mui/material/Container'; |
| 4 | +import { Button, Card, styled, Typography } from '@mui/material'; |
| 5 | +import { theme } from '../Theme'; |
| 6 | +import EmailIcon from '@mui/icons-material/Email'; |
| 7 | +import GitHubIcon from '@mui/icons-material/GitHub'; |
| 8 | +import { useTranslation } from 'react-i18next'; |
| 9 | + |
| 10 | +const ContactUsItem = styled(Card)(({ theme }) => ({ |
| 11 | + padding: theme.spacing(2), |
| 12 | + margin: theme.spacing(1), |
| 13 | + textAlign: 'center', |
| 14 | + width: '100%', |
| 15 | + [theme.breakpoints.up('sm')]: { |
| 16 | + width: 'calc(50% - 50px)', |
| 17 | + }, |
| 18 | + '.item-container': { |
| 19 | + textAlign: 'center', |
| 20 | + }, |
| 21 | + '.mui-icon': { |
| 22 | + fontSize: '4rem', |
| 23 | + }, |
| 24 | + '.text-body': { |
| 25 | + textAlign: 'left', |
| 26 | + padding: `0 ${theme.spacing(2)}`, |
| 27 | + }, |
| 28 | + '.action-button': { |
| 29 | + margin: theme.spacing(1), |
| 30 | + marginTop: theme.spacing(2), |
| 31 | + }, |
| 32 | +})); |
| 33 | + |
| 34 | +const SlackSvg = ( |
| 35 | + <svg |
| 36 | + xmlns='http://www.w3.org/2000/svg' |
| 37 | + width='4rem' |
| 38 | + height='4rem' |
| 39 | + viewBox='0 0 24 24' |
| 40 | + > |
| 41 | + <path |
| 42 | + fill={theme.palette.primary.main} |
| 43 | + d='M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z' |
| 44 | + /> |
| 45 | + </svg> |
| 46 | +); |
| 47 | + |
| 48 | +export default function ContactUs(): React.ReactElement { |
| 49 | + const { t } = useTranslation('contactUs'); |
| 50 | + return ( |
| 51 | + <Container component='main'> |
| 52 | + <Box sx={{ maxWidth: '1000px', width: '100%', mx: 'auto' }}> |
| 53 | + <Typography variant='h4' color='primary' sx={{ fontWeight: 700 }}> |
| 54 | + {t('title')} |
| 55 | + </Typography> |
| 56 | + <Box |
| 57 | + sx={{ |
| 58 | + mt: 2, |
| 59 | + display: 'flex', |
| 60 | + flexWrap: 'wrap', |
| 61 | + }} |
| 62 | + > |
| 63 | + <ContactUsItem variant='outlined'> |
| 64 | + <Box className='item-container'> |
| 65 | + <EmailIcon color='primary' className='mui-icon' /> |
| 66 | + <Typography variant='h6' color='primary' sx={{ fontWeight: 700 }}> |
| 67 | + {t('email.title')} |
| 68 | + </Typography> |
| 69 | + </Box> |
| 70 | + <Typography variant='body1'> |
| 71 | + {t('email.description')}{' '} |
| 72 | + |
| 73 | + </Typography> |
| 74 | + </ContactUsItem> |
| 75 | + |
| 76 | + <ContactUsItem variant='outlined'> |
| 77 | + <Box className='item-container'> |
| 78 | + {SlackSvg} |
| 79 | + <Typography variant='h6' color='primary' sx={{ fontWeight: 700 }}> |
| 80 | + {t('slack.title')} |
| 81 | + </Typography> |
| 82 | + </Box> |
| 83 | + <Typography variant='body1'>{t('slack.description')}</Typography> |
| 84 | + <Button |
| 85 | + variant={'contained'} |
| 86 | + className='action-button' |
| 87 | + href='https://share.mobilitydata.org/slack' |
| 88 | + target='_blank' |
| 89 | + rel='noopener noreferrer' |
| 90 | + > |
| 91 | + {t('slack.action')} |
| 92 | + </Button> |
| 93 | + </ContactUsItem> |
| 94 | + |
| 95 | + <ContactUsItem variant='outlined'> |
| 96 | + <Box className='item-container'> |
| 97 | + <GitHubIcon color='primary' className='mui-icon' /> |
| 98 | + <Typography variant='h6' color='primary' sx={{ fontWeight: 700 }}> |
| 99 | + {t('contribute.title')} |
| 100 | + </Typography> |
| 101 | + </Box> |
| 102 | + <Typography variant='body1' className='text-body'> |
| 103 | + {t('contribute.description')} |
| 104 | + </Typography> |
| 105 | + <Button |
| 106 | + variant={'contained'} |
| 107 | + className='action-button' |
| 108 | + href='https://github.com/MobilityData/mobility-feed-api' |
| 109 | + target='_blank' |
| 110 | + rel='noopener noreferrer' |
| 111 | + > |
| 112 | + {t('contribute.action')} |
| 113 | + </Button> |
| 114 | + </ContactUsItem> |
| 115 | + |
| 116 | + <ContactUsItem variant='outlined'> |
| 117 | + <Box className='item-container'> |
| 118 | + <GitHubIcon color='primary' className='mui-icon' /> |
| 119 | + <Typography variant='h6' color='primary' sx={{ fontWeight: 700 }}> |
| 120 | + {t('addFeeds.title')} |
| 121 | + </Typography> |
| 122 | + </Box> |
| 123 | + <Typography variant='body1' className='text-body'> |
| 124 | + {t('addFeeds.description')} |
| 125 | + </Typography> |
| 126 | + <Button |
| 127 | + variant={'contained'} |
| 128 | + className='action-button' |
| 129 | + href='https://github.com/MobilityData/mobility-database-catalogs' |
| 130 | + target='_blank' |
| 131 | + rel='noopener noreferrer' |
| 132 | + > |
| 133 | + {t('addFeeds.action')} |
| 134 | + </Button> |
| 135 | + </ContactUsItem> |
| 136 | + </Box> |
| 137 | + </Box> |
| 138 | + </Container> |
| 139 | + ); |
| 140 | +} |
0 commit comments