From c055eb91affc2b6ecdd1c30f8b62b8a2630bbb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Fri, 11 Dec 2020 01:41:37 +0100 Subject: [PATCH] Create AwtisKat component --- components/awtis/awtis-kat.js | 114 ++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 components/awtis/awtis-kat.js diff --git a/components/awtis/awtis-kat.js b/components/awtis/awtis-kat.js new file mode 100644 index 0000000..cec49c0 --- /dev/null +++ b/components/awtis/awtis-kat.js @@ -0,0 +1,114 @@ +import {useState} from 'react' +import PropTypes from 'prop-types' +import clsx from 'clsx' + +import { + CardActionArea, + Grid, + Card, + CardContent, + CardMedia, + CardActions, + Collapse, + IconButton, + Typography +} from '@material-ui/core' + +import ExpandMoreIcon from '@material-ui/icons/ExpandMore' +import {makeStyles} from '@material-ui/core/styles' + +import MizikLis from './mizik-lis' +import AwtisBio from './awtis-bio' + +const useStyles = makeStyles(theme => ({ + root: { + maxWidth: 345 + }, + media: { + height: 240, + objectFit: 'contain' + }, + expand: { + transform: 'rotate(0deg)', + marginLeft: 'auto', + transition: theme.transitions.create('transform', { + duration: theme.transitions.duration.shortest + }) + }, + expandOpen: { + transform: 'rotate(180deg)' + } +})) + +export default function AwtisKat({anAwtis}) { + const [isBioOpen, setIsBioOpen] = useState(false) + + const {alias, bio, miziks} = anAwtis + const classes = useStyles() + const [expanded, setExpanded] = useState(false) + + const handleExpandClick = () => { + setExpanded(!expanded) + } + + const handleClick = () => { + setIsBioOpen(true) + } + + return ( + <> + + + + + + + {alias} + + + {anAwtis.miziks.length} tèks + + + + + + + + + + + + + + + + + {isBioOpen && ( + + )} + + ) +} + +AwtisKat.propTypes = { + anAwtis: PropTypes.object.isRequired +}