member list carpools

This commit is contained in:
Joshua Hsueh 2021-07-12 22:47:17 -04:00
commit 8dcc40fa43
2 changed files with 74 additions and 33 deletions

View File

@ -1,11 +1,17 @@
import EventIcon from '@material-ui/icons/Event'; import EventIcon from '@material-ui/icons/Event';
import LocationOnIcon from '@material-ui/icons/LocationOn'; import LocationOnIcon from '@material-ui/icons/LocationOn';
import MailOutlineIcon from '@material-ui/icons/MailOutline';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { useState } from 'react'; import { useState } from 'react';
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { ICarpool } from '../types'; import { ICarpool } from '../types';
import UISecondaryBox from '../UI/UISecondaryBox'; import UISecondaryBox from '../UI/UISecondaryBox';
import MemberList from './MemberList'; import MemberList from './MemberList';
import UIButton from '../UI/UIButton';
import { lightgrey } from '../colors';
export default function Carpool() { export default function Carpool() {
const id = +useParams<{ id: string }>().id; const id = +useParams<{ id: string }>().id;
@ -52,9 +58,39 @@ export default function Carpool() {
<UISecondaryBox style={{ width: '100%', alignItems: 'center' }}> <UISecondaryBox style={{ width: '100%', alignItems: 'center' }}>
{carpool ? ( {carpool ? (
<> <>
<h1>{name}</h1> <h1 style={{ marginBottom: '0rem' }}>{name}</h1>
<h2>{event.name}</h2> <h2 style={{ marginBottom: '0rem' }}>{event.name}</h2>
<div style={{ fontSize: '1.5rem', fontWeight: 600 }}> <div
style={{
display: 'flex',
flexDirection: 'row',
margin: '0.5rem 0',
}}
>
<UIButton
style={{
marginRight: '0.25rem',
backgroundColor: lightgrey,
display: 'flex',
alignItems: 'center',
}}
onClick={console.log}
>
<MailOutlineIcon style={{ marginRight: '0.5rem' }} /> 1 request
</UIButton>
<UIButton
style={{
marginLeft: '0.25rem',
backgroundColor: lightgrey,
display: 'flex',
alignItems: 'center',
}}
onClick={console.log}
>
<PersonAddIcon style={{ marginRight: '0.5rem' }} /> Invite
</UIButton>
</div>
<div style={{ fontSize: '1.5rem', fontWeight: 400 }}>
<div <div
style={{ style={{
color: '#303030', color: '#303030',
@ -76,7 +112,6 @@ export default function Carpool() {
DAWN - DUSK DAWN - DUSK
</div> </div>
</div> </div>
<h3>Members</h3>
<MemberList members={carpool.members} /> <MemberList members={carpool.members} />
</> </>
) : ( ) : (

View File

@ -9,8 +9,15 @@ export default function MemberList({
}[]; }[];
}) { }) {
return ( return (
<div className="MemberList"> <div
<div style={{ display: 'flex', flexDirection: 'column' }}> className="MemberList"
style={{
display: 'flex',
flexDirection: 'column',
alignSelf: 'center',
alignItems: 'flex-start',
}}
>
<h3 style={{ marginBlockEnd: '0' }}>Members</h3> <h3 style={{ marginBlockEnd: '0' }}>Members</h3>
{members.length > 0 ? ( {members.length > 0 ? (
<div> <div>
@ -18,10 +25,10 @@ export default function MemberList({
return index < 2 ? ( return index < 2 ? (
<div <div
className="member" className="member"
style={{ display: 'flex', justifyContent: 'space-around' }} style={{ display: 'flex', alignItems: 'center' }}
> >
{} {}
<AccountCircleIcon /> <AccountCircleIcon style={{ marginRight: '8px' }} />
<div key={member.id}>{member.name}</div> <div key={member.id}>{member.name}</div>
</div> </div>
) : ( ) : (
@ -38,6 +45,5 @@ export default function MemberList({
'This carpool has no members.' 'This carpool has no members.'
)} )}
</div> </div>
</div>
); );
} }