make event group name clickable

This commit is contained in:
Michael Fatemi 2021-07-13 17:54:45 -04:00
parent 65dbf77a21
commit 4bc7a97365

View File

@ -8,6 +8,7 @@ import { green, lightgrey } from '../colors';
import { useMe } from '../hooks'; import { useMe } from '../hooks';
import { IEvent, IEventSignup } from '../types'; import { IEvent, IEventSignup } from '../types';
import UIButton from '../UI/UIButton'; import UIButton from '../UI/UIButton';
import UILink from '../UI/UILink';
import UIPlacesAutocomplete from '../UI/UIPlacesAutocomplete'; import UIPlacesAutocomplete from '../UI/UIPlacesAutocomplete';
import UISecondaryBox from '../UI/UISecondaryBox'; import UISecondaryBox from '../UI/UISecondaryBox';
import UISecondaryHeader from '../UI/UISecondaryHeader'; import UISecondaryHeader from '../UI/UISecondaryHeader';
@ -16,8 +17,8 @@ import EventCarpools from './EventCarpools';
import EventDetails from './EventDetails'; import EventDetails from './EventDetails';
import EventSignups from './EventSignups'; import EventSignups from './EventSignups';
function GroupName({ name }: { name: string }) { function GroupName({ group }: { group: IEvent['group'] }) {
return <span style={{ color: '#303030', textAlign: 'center' }}>{name}</span>; return <UILink href={`/groups/${group.id}`}>{group.name}</UILink>;
} }
export default function Event({ event }: { event: IEvent }) { export default function Event({ event }: { event: IEvent }) {
@ -96,8 +97,10 @@ export default function Event({ event }: { event: IEvent }) {
return ( return (
<UISecondaryBox> <UISecondaryBox>
<div style={{ textAlign: 'center' }}>
<UISecondaryHeader>{name}</UISecondaryHeader> <UISecondaryHeader>{name}</UISecondaryHeader>
<GroupName name={group.name} /> <GroupName group={group} />
</div>
<EventDetails {...{ startTime, endTime, formattedAddress }} /> <EventDetails {...{ startTime, endTime, formattedAddress }} />
<UIButton <UIButton
onClick={toggleInterestedThrottled} onClick={toggleInterestedThrottled}