all repos — caroster @ 6d2659c5a5d3df7aeeaad568e6543fcbb943bf45

[Octree] Group carpool to your event https://caroster.io

frontend/containers/DashboardEvents/EventCard.tsx (view raw)

 1import Link from 'next/link';
 2import Card from '@material-ui/core/Card';
 3import CardActions from '@material-ui/core/CardActions';
 4import CardContent from '@material-ui/core/CardContent';
 5import Typography from '@material-ui/core/Typography';
 6import Button from '@material-ui/core/Button';
 7import {useTranslation} from 'react-i18next';
 8import {EventEntity} from '../../generated/graphql';
 9
10interface Props {
11  event: EventEntity;
12}
13
14const EventCard = ({event}: Props) => {
15  const {t} = useTranslation();
16
17  return (
18    <Card>
19      <CardContent>
20        <Typography gutterBottom variant="h6" component="h3">
21          {event.attributes.name}
22        </Typography>
23        <Typography variant="overline">{t('event.fields.date')}</Typography>
24        <Typography variant="body2" gutterBottom>
25          {event.attributes.date || t('event.fields.empty')}
26        </Typography>
27        <Typography variant="overline">{t('event.fields.address')}</Typography>
28        <Typography variant="body2" gutterBottom>
29          {event.attributes.address || t('event.fields.empty')}
30        </Typography>
31      </CardContent>
32      <CardActions>
33        <Link href={`/e/${event.attributes.uuid}`} passHref>
34          <Button color="primary">{t('dashboard.actions.see_event')}</Button>
35        </Link>
36      </CardActions>
37    </Card>
38  );
39};
40
41export default EventCard;