3ef1ad9574
* feat: add website and folder upload and download * feat: download-share-upload navigation * fix: check for files length in hasIndexDocument * fix: change router dependency * refactor: switch to @ethersphere/manfest-js * fix: hide previews on dropzone, fix spinner align, hide 0 size display * feat: add upload and download history * refactor: change drag and drop text * feat: make history ux better * refactor: improve code based on review * build: add missing react-router dependency * ci: remove beeload * revert(ci): remove beeload This reverts commit 4ce6cb0045a2d9aea3047ab395d214d8d368c532.
42 lines
907 B
TypeScript
42 lines
907 B
TypeScript
import { Box, createStyles, Grid, makeStyles, Typography } from '@material-ui/core'
|
|
import { ArrowBack } from '@material-ui/icons'
|
|
import { ReactElement } from 'react'
|
|
import { useHistory } from 'react-router-dom'
|
|
|
|
interface Props {
|
|
children: string
|
|
}
|
|
|
|
const useStyles = makeStyles(() =>
|
|
createStyles({
|
|
pressable: {
|
|
cursor: 'pointer',
|
|
},
|
|
icon: {
|
|
color: '#242424',
|
|
},
|
|
}),
|
|
)
|
|
|
|
export function HistoryHeader({ children }: Props): ReactElement {
|
|
const classes = useStyles()
|
|
const history = useHistory()
|
|
|
|
function goBack() {
|
|
history.goBack()
|
|
}
|
|
|
|
return (
|
|
<Box mb={4}>
|
|
<Grid container direction="row">
|
|
<Box mr={2}>
|
|
<div className={classes.pressable} onClick={goBack}>
|
|
<ArrowBack className={classes.icon} />
|
|
</div>
|
|
</Box>
|
|
<Typography variant="h1">{children}</Typography>
|
|
</Grid>
|
|
</Box>
|
|
)
|
|
}
|