add Group component

This commit is contained in:
Michael Fatemi 2021-06-22 10:40:13 -04:00
parent a7b70a31e7
commit 2b201b8c01
4 changed files with 36 additions and 12 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
.vscode/ .vscode/
twitter-state.ts

View File

@ -1,4 +1,5 @@
import Event from './Event'; import Event from './Event';
import Group from './Group';
import UIPrimaryTitle from './UIPrimaryTitle'; import UIPrimaryTitle from './UIPrimaryTitle';
export default function App() { export default function App() {
@ -15,11 +16,16 @@ export default function App() {
}} }}
> >
<UIPrimaryTitle>WheelShare</UIPrimaryTitle> <UIPrimaryTitle>WheelShare</UIPrimaryTitle>
<Event <Group
title="TJ Track Regional Meet" events={[
group="TJHSST Track and Field" {
location="Ashburn, Virginia" time: '11:00 AM to 2:45 PM',
time="11:00 AM to 2:45 PM" title: 'TJ Track Regional Meet',
group: 'TJHSST Track and Field',
location: 'Ashburn, Virginia',
},
]}
name="TJHSST 2022"
/> />
<Event <Event
title="End of Year Party" title="End of Year Party"

View File

@ -6,17 +6,14 @@ import UITimeInput from './UITimeInput';
const green = '#60f760'; const green = '#60f760';
const lightgrey = '#e0e0e0'; const lightgrey = '#e0e0e0';
export default function Event({ export type IEvent = {
title,
group,
location,
time,
}: {
title: string; title: string;
group: string; group: string;
location: string; location: string;
time: string; time: string;
}) { };
export default function Event({ title, group, location, time }: IEvent) {
const [needRideThere, setNeedRideThere] = useState(false); const [needRideThere, setNeedRideThere] = useState(false);
const [needRideBack, setNeedRideBack] = useState(false); const [needRideBack, setNeedRideBack] = useState(false);
const [rideTherePickupPlaceID, setRideTherePickupPlaceID] = useState(''); const [rideTherePickupPlaceID, setRideTherePickupPlaceID] = useState('');

View File

@ -0,0 +1,20 @@
import Event, { IEvent } from './Event';
export type IGroup = {
events: IEvent[];
name: string;
};
export default function Group({ events, name }: IGroup) {
return (
<div style={{ display: 'flex', flexDirection: 'column' }}>
<h1>{name}</h1>
<div style={{ display: 'flex', flexDirection: 'column' }}>
{events.map((event) => (
<Event {...event} key={event.title} />
))}
</div>
</div>
);
//
}