mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-17 17:40:16 -04:00
add creator to event
This commit is contained in:
parent
5c1cad5575
commit
5d0a25991d
|
@ -10,7 +10,9 @@ import EventDetails from './EventDetails';
|
||||||
import EventInterestForm from './EventInterestForm';
|
import EventInterestForm from './EventInterestForm';
|
||||||
import EventPlaceholder from './EventPlaceholder';
|
import EventPlaceholder from './EventPlaceholder';
|
||||||
|
|
||||||
function GroupName({ group }: { group: IEvent['group'] }) {
|
type NotNull<T> = T extends null ? never : T;
|
||||||
|
|
||||||
|
function GroupName({ group }: { group: NotNull<IEvent['group']> }) {
|
||||||
return <UILink href={`/groups/${group.id}`}>{group.name}</UILink>;
|
return <UILink href={`/groups/${group.id}`}>{group.name}</UILink>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +58,8 @@ export default function Event({
|
||||||
<UISecondaryBox style={{ width: '35rem', maxWidth: '100vw' }}>
|
<UISecondaryBox style={{ width: '35rem', maxWidth: '100vw' }}>
|
||||||
<div style={{ textAlign: 'center' }}>
|
<div style={{ textAlign: 'center' }}>
|
||||||
<UISecondaryHeader>{name}</UISecondaryHeader>
|
<UISecondaryHeader>{name}</UISecondaryHeader>
|
||||||
|
<span>Created by {event.creator.name}</span>
|
||||||
|
<br />
|
||||||
{group && <GroupName group={group} />}
|
{group && <GroupName group={group} />}
|
||||||
</div>
|
</div>
|
||||||
<EventDetails />
|
<EventDetails />
|
||||||
|
|
|
@ -24,11 +24,6 @@ export type ICarpool = {
|
||||||
longitude: number;
|
longitude: number;
|
||||||
placeId: string;
|
placeId: string;
|
||||||
};
|
};
|
||||||
// driverId: number | null;
|
|
||||||
// driver: {
|
|
||||||
// id: number;
|
|
||||||
// name: string;
|
|
||||||
// };
|
|
||||||
creatorId: number;
|
creatorId: number;
|
||||||
members: {
|
members: {
|
||||||
id: number;
|
id: number;
|
||||||
|
@ -72,6 +67,10 @@ export type IEvent = {
|
||||||
group: {
|
group: {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
} | null;
|
||||||
|
creator: {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
};
|
};
|
||||||
carpools: {
|
carpools: {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user