From 99ed5fe2b9a5926a11250f7be928cc9a7c74adc7 Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Wed, 11 Aug 2021 19:02:00 -0400 Subject: [PATCH] responsive two-column layout --- .../ActiveCarpools/ActiveCarpools.tsx | 29 ++++++++------- src/components/ActiveEvents/Events.tsx | 6 ++-- src/components/App.tsx | 2 +- src/components/Event/Event.tsx | 2 +- src/components/EventStream.tsx | 8 ++++- src/components/GroupJoinerLink.tsx | 4 +-- src/components/Groups/GroupList.tsx | 23 ++---------- src/components/Groups/Groups.tsx | 11 ++++-- src/components/UI/UISecondaryBox.tsx | 1 + src/components/WheelShare.tsx | 35 +++++++++++++++++-- 10 files changed, 74 insertions(+), 47 deletions(-) diff --git a/src/components/ActiveCarpools/ActiveCarpools.tsx b/src/components/ActiveCarpools/ActiveCarpools.tsx index adb1854..e064c69 100644 --- a/src/components/ActiveCarpools/ActiveCarpools.tsx +++ b/src/components/ActiveCarpools/ActiveCarpools.tsx @@ -1,17 +1,15 @@ -import { useEffect } from 'react'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { getActiveCarpools } from '../api'; import { ICarpool } from '../types'; +import UILink from '../UI/UILink'; import UISecondaryBox from '../UI/UISecondaryBox'; -import UISecondaryHeader from '../UI/UISecondaryHeader'; function ActiveCarpoolListItem({ carpool }: { carpool: ICarpool }) { return ( - - - {carpool.name} - - +
+

{carpool.name}

+ View carpool +
); } @@ -23,13 +21,18 @@ export default function ActiveCarpools() { }, []); return ( - <> -

Carpools

-
+
+

Carpools

+ {activeCarpools.map((carpool) => ( ))} -
- + +
); } diff --git a/src/components/ActiveEvents/Events.tsx b/src/components/ActiveEvents/Events.tsx index 6b213ef..c279f89 100644 --- a/src/components/ActiveEvents/Events.tsx +++ b/src/components/ActiveEvents/Events.tsx @@ -16,9 +16,9 @@ export default function ActiveEvents() { }, [hasEvents, setEvents]); return ( - <> -

Events

+
+

Events

- +
); } diff --git a/src/components/App.tsx b/src/components/App.tsx index 52b4e8c..7700f7f 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -20,7 +20,7 @@ const style: CSSProperties = { display: 'flex', flexDirection: 'column', alignItems: 'center', - width: '30rem', + // width: '30rem', maxWidth: '100%', marginLeft: 'auto', marginRight: 'auto', diff --git a/src/components/Event/Event.tsx b/src/components/Event/Event.tsx index 13ebae1..d90da4b 100644 --- a/src/components/Event/Event.tsx +++ b/src/components/Event/Event.tsx @@ -53,7 +53,7 @@ export default function Event({ tentativeInvites, }} > - +
{name} {group && } diff --git a/src/components/EventStream.tsx b/src/components/EventStream.tsx index 4f8b67a..065c2e4 100644 --- a/src/components/EventStream.tsx +++ b/src/components/EventStream.tsx @@ -3,7 +3,13 @@ import { IEvent } from './types'; export default function EventStream({ events }: { events: IEvent[] }) { return ( -
+
{events.map((event) => ( ))} diff --git a/src/components/GroupJoinerLink.tsx b/src/components/GroupJoinerLink.tsx index 139edc1..3e32796 100644 --- a/src/components/GroupJoinerLink.tsx +++ b/src/components/GroupJoinerLink.tsx @@ -70,7 +70,7 @@ export default function GroupJoinerLink() { const [open, toggle] = useToggle(false); return ( - <> +
Join Group {open && ( <> @@ -78,6 +78,6 @@ export default function GroupJoinerLink() { )} - +
); } diff --git a/src/components/Groups/GroupList.tsx b/src/components/Groups/GroupList.tsx index c4b448b..94bc8ba 100644 --- a/src/components/Groups/GroupList.tsx +++ b/src/components/Groups/GroupList.tsx @@ -4,19 +4,8 @@ import UISecondaryBox from '../UI/UISecondaryBox'; function GroupListItem({ group }: { group: IGroup }) { return ( -
- - {group.name} - +
+

{group.name}

View group
); @@ -24,13 +13,7 @@ function GroupListItem({ group }: { group: IGroup }) { export default function GroupList({ groups }: { groups: IGroup[] }) { return ( - + {groups.map((group) => ( ))} diff --git a/src/components/Groups/Groups.tsx b/src/components/Groups/Groups.tsx index 7dc6326..714f80e 100644 --- a/src/components/Groups/Groups.tsx +++ b/src/components/Groups/Groups.tsx @@ -13,8 +13,13 @@ export default function Groups() { }, []); return ( - <> -

Groups

+
+

Groups


@@ -28,6 +33,6 @@ export default function Groups() { an invite link. )} - +
); } diff --git a/src/components/UI/UISecondaryBox.tsx b/src/components/UI/UISecondaryBox.tsx index d38c94b..185c6dc 100644 --- a/src/components/UI/UISecondaryBox.tsx +++ b/src/components/UI/UISecondaryBox.tsx @@ -7,6 +7,7 @@ const baseStyle: CSSProperties = { borderRadius: '0.5rem', padding: '1rem', marginBottom: '1em', + boxSizing: 'border-box', }; export default function UISecondaryBox({ diff --git a/src/components/WheelShare.tsx b/src/components/WheelShare.tsx index d1670d8..8d722f1 100644 --- a/src/components/WheelShare.tsx +++ b/src/components/WheelShare.tsx @@ -5,9 +5,38 @@ import Groups from './Groups/Groups'; export default function WheelShare() { return ( <> - - - +
+
+ + +
+
+ +
+
); }