Skip to content

Commit

Permalink
Merge pull request #123 from eoscostarica/develop
Browse files Browse the repository at this point in the history
Bug Fixes and Content Updates
  • Loading branch information
tetogomez authored Aug 22, 2020
2 parents 55832c8 + 7176f8b commit 61ece9d
Show file tree
Hide file tree
Showing 18 changed files with 668 additions and 120 deletions.
62 changes: 62 additions & 0 deletions src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { makeStyles } from '@material-ui/styles'
import Box from '@material-ui/core/Box'
import Link from '@material-ui/core/Link'
import AnnouncementIcon from '@material-ui/icons/Announcement'

import TalkUsModal from './TalkUsModal'

const useStyles = makeStyles((theme) => ({
footer: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
},
labelfooter: {
fontSize: 12.1,
fontWeight: '500',
lineHeight: 1.32,
letterSpacing: '0.4px',
textAlign: 'center',
width: '100%',
color: 'rgba(0, 0, 0, 0.6)',
paddingLeft: 20
},
iconButton: {
width: 20,
height: 20,
color: '#272863',
'&:hover': {
cursor: 'pointer'
}
}
}))

const Footer = () => {
const classes = useStyles()
const { t } = useTranslation('translations')
const [openModal, setOpenModal] = useState(false)

return (
<>
<TalkUsModal openModal={openModal} setOpenModal={setOpenModal} />
<Box className={classes.footer}>
<Link
className={classes.labelfooter}
href="https://github.com/eoscostarica/evodex"
target="_blank"
rel="noopener noreferrer"
>
{t('footer')}
</Link>
<AnnouncementIcon
className={classes.iconButton}
onClick={() => setOpenModal(!openModal)}
/>
</Box>
</>
)
}

export default Footer
161 changes: 161 additions & 0 deletions src/components/Footer/TalkUsModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import React from 'react'
import PropTypes from 'prop-types'
import clsx from 'clsx'
import { useTranslation } from 'react-i18next'
import { makeStyles } from '@material-ui/styles'
import Box from '@material-ui/core/Box'
import Typography from '@material-ui/core/Typography'
import GitHubIcon from '@material-ui/icons/GitHub'
import TwitterIcon from '@material-ui/icons/Twitter'
import TelegramIcon from '@material-ui/icons/Telegram'
import Link from '@material-ui/core/Link'

import Modal from 'components/Modal'

const useStyles = makeStyles((theme) => ({
talkContent: {
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
alignItems: 'center'
},
btnPortal: {
backgroundColor: '#272863',
width: 144,
height: 36,
borderRadius: 20,
marginBottom: theme.spacing(2),
'& .MuiButton-label': {
color: '#fff',
fontSize: 14,
lineHeight: 1.13,
letterSpacing: 1.25,
fontWeight: '600'
}
},
titleBox: {
marginBottom: theme.spacing(3)
},
title: {
fontSize: 20.2,
fontWeight: '600',
marginBottom: theme.spacing(1),
letterSpacing: 0.25,
color: 'rgba(0, 0, 0, 0.87)',
[theme.breakpoints.up('sm')]: {
fontSize: 24,
letterSpacing: 0.25
}
},
info: {
fontSize: 16,
fontWeight: '600',
lineHeight: 1.6,
letterSpacing: 0.15,
color: 'rgba(0, 0, 0, 0.6)'
},
infoText: {
fontSize: 16,
marginTop: theme.spacing(1),
fontWeight: '600',
lineHeight: 1.2,
letterSpacing: 0.15,
color: 'rgba(0, 0, 0, 0.6)'
},
boxLinks: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#272863',
width: 144,
height: 36,
borderRadius: 20,
'&:hover': {
textDecoration: 'none',
cursor: 'pointer'
},
'& p': {
color: '#fff',
textTransform: 'uppercase',
fontSize: 14,
lineHeight: 1.13,
letterSpacing: 1.25,
fontWeight: '600'
},
[theme.breakpoints.up('sm')]: {
width: 185
}
},
icon: {
marginRight: theme.spacing(1),
color: '#fff',
height: 20
},
marginBottomLink: {
marginBottom: theme.spacing(2)
}
}))

const TalkUsModal = ({ openModal, setOpenModal }) => {
const classes = useStyles()
const { t } = useTranslation('talkUsModal')

return (
<Modal openModal={openModal} setOpenModal={(value) => setOpenModal(value)}>
<Box className={classes.talkContent}>
<Box className={classes.titleBox}>
<Typography variant="h1" className={classes.title}>
{t('title')}
</Typography>
<Typography variant="h2" className={classes.title}>
{t('subtitle')}
</Typography>
<Typography variant="h3" className={classes.info}>
{t('description1')}
</Typography>
<Typography variant="h3" className={classes.info}>
{t('description2')}
</Typography>
<Typography className={classes.infoText}>
{t('description3')}
</Typography>
</Box>
<Link
className={clsx(classes.boxLinks, classes.marginBottomLink)}
href="https://github.com/eoscostarica/evodex/issues/new/choose"
target="_blank"
rel="noopener noreferrer"
>
<GitHubIcon className={classes.icon} />
<Typography variant="body1">GitHub</Typography>
</Link>
<Link
className={clsx(classes.boxLinks, classes.marginBottomLink)}
href="https://t.me/evodexarg"
target="_blank"
rel="noopener noreferrer"
>
<TelegramIcon className={classes.icon} />
<Typography variant="body1">telegram</Typography>
</Link>

<Link
className={clsx(classes.boxLinks, classes.marginBottomLink)}
href="https://twitter.com/eosargentina"
target="_blank"
rel="noopener noreferrer"
>
<TwitterIcon className={classes.icon} />
<Typography variant="body1">twitter</Typography>
</Link>
</Box>
</Modal>
)
}

TalkUsModal.propTypes = {
openModal: PropTypes.bool,
setOpenModal: PropTypes.func
}

export default TalkUsModal
1 change: 1 addition & 0 deletions src/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Footer'
4 changes: 3 additions & 1 deletion src/components/InputTextAndSelect/InputTextAndSelect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState, useEffect, useRef } from 'react'
import PropTypes from 'prop-types'
import { useTranslation } from 'react-i18next'
import { makeStyles } from '@material-ui/styles'
import Box from '@material-ui/core/Box'
import Typography from '@material-ui/core/Typography'
Expand Down Expand Up @@ -120,6 +121,7 @@ const InputTextAndSelect = ({
inputDisabled
}) => {
const classes = useStyles()
const { t } = useTranslation('translations')
const textInput = useRef(null)
const [inputData, setInputData] = useState({})

Expand Down Expand Up @@ -154,7 +156,7 @@ const InputTextAndSelect = ({
ref={textInput}
onChange={(e) => handleOnChange(e.target.value, 'inputValue')}
value={inputData.inputValue || ''}
placeholder="This Amount"
placeholder={t('placeholder')}
readOnly={inputDisabled}
onKeyPress={(e) => handleOnKeyPress(e.key)}
/>
Expand Down
100 changes: 100 additions & 0 deletions src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import React from 'react'
import { makeStyles } from '@material-ui/styles'
import PropTypes from 'prop-types'
import Box from '@material-ui/core/Box'
import Paper from '@material-ui/core/Paper'
import IconButton from '@material-ui/core/IconButton'
import CloseIcon from '@material-ui/icons/Close'
import Modal from '@material-ui/core/Modal'
import Backdrop from '@material-ui/core/Backdrop'
import Fade from '@material-ui/core/Fade'

const useStyles = makeStyles((theme) => ({
modal: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
},
paper: {
backgroundColor: theme.palette.background.paper,
boxShadow: theme.shadows[5],
borderRadius: 20,
width: 280,
height: 550,
overflowY: 'auto',
outlineWidth: 0,
[theme.breakpoints.up('sm')]: {
width: 560,
height: 420
}
},
closeIcon: {
display: 'flex',
justifyContent: 'flex-end',
marginTop: 10,
padding: theme.spacing(0, 1.5),
'& svg': {
fontSize: 25,
color: 'rgba(0, 0, 0, 0.54)'
}
},
bodyWrapper: {
height: '95%',
padding: theme.spacing(0, 2),
[theme.breakpoints.up('sm')]: {
height: '90%',
padding: theme.spacing(0, 3)
}
}
}))

const MapModal = ({ openModal, setOpenModal, children }) => {
const classes = useStyles()

const handleOpen = () => {
setOpenModal(!openModal)
}

return (
<Modal
aria-labelledby="transition-modal-title"
aria-describedby="transition-modal-description"
className={classes.modal}
open={openModal}
onClose={handleOpen}
closeAfterTransition
BackdropComponent={Backdrop}
BackdropProps={{
timeout: 500
}}
>
<Fade in={openModal}>
<Paper className={classes.paper}>
<Box className={classes.closeIcon}>
<IconButton
aria-label="close"
color="inherit"
size="small"
onClick={handleOpen}
>
<CloseIcon fontSize="inherit" />
</IconButton>
</Box>
<Box className={classes.bodyWrapper}>{children}</Box>
</Paper>
</Fade>
</Modal>
)
}

MapModal.propTypes = {
openModal: PropTypes.bool,
children: PropTypes.any,
setOpenModal: PropTypes.func
}

MapModal.defaultProps = {
openModal: false
}

export default MapModal
1 change: 1 addition & 0 deletions src/components/Modal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Modal'
Loading

0 comments on commit 61ece9d

Please sign in to comment.