1
0

Add more info to event

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-04-10 15:36:34 -07:00
parent 208f3abf95
commit 175d8449ea
4 changed files with 24 additions and 3 deletions

View File

@ -2,3 +2,11 @@
text-align: left;
}
.Event .when {
margin-bottom: 0.25rem;
}
.Event .what {
font-size: 1.25rem;
margin-bottom: 0.5rem;
}

View File

@ -1,7 +1,7 @@
import React, { useState, useEffect, useContext } from "react";
import Paper from '@mui/material/Paper';
import MomentUtils from '@date-io/moment'
import { Calendar, MuiPickersUtilsProvider, ClockView } from '@material-ui/pickers';
import { Calendar, MuiPickersUtilsProvider } from '@material-ui/pickers';
import Moment from 'react-moment';
import moment from 'moment';
@ -92,10 +92,17 @@ function Event({ groupId }) {
</div>
<div>
<div>{event.description}</div>
<div>
<div className='what'>{event.description}</div>
<div className='when'>
Next event is occurring <Moment fromNow date={event.date} /> on <Moment format={'MMMM Do YYYY, h: mm: ss a'} date={event.date} />.
</div>
{ event.votingBegins === 'day-of' &&
<div>Voting for location begins the day of the event.</div>
}
{ event.votingBegins !== 'day-of' &&
<div>Vote any time for the location.</div>
}
<div>Voting for location closes at {event.votingCloses}.</div>
</div>
</div>
</div>;

View File

@ -106,6 +106,10 @@ function Group() {
effect();
}, [user, setGroup, groupId, csrfToken, setError]);
if (!group) {
return <></>;
}
return (
<Paper className="Group" style={{
display: 'flex',

View File

@ -2,6 +2,8 @@ const originalEvents = [ {
groupId: 1,
name: 'Tuesday',
event: 'tuesday',
votingBegins: 'day-of',
votingCloses: '3:00 PM',
description: 'Get together every Tuesday with friends for happy hour!',
date: Date.now() + 86400 * 14 * 1000 /* 2 weeks from now */
} ];