mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-09 22:00: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 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>;
|
||||
}
|
||||
|
||||
|
@ -56,6 +58,8 @@ export default function Event({
|
|||
<UISecondaryBox style={{ width: '35rem', maxWidth: '100vw' }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<UISecondaryHeader>{name}</UISecondaryHeader>
|
||||
<span>Created by {event.creator.name}</span>
|
||||
<br />
|
||||
{group && <GroupName group={group} />}
|
||||
</div>
|
||||
<EventDetails />
|
||||
|
|
|
@ -24,11 +24,6 @@ export type ICarpool = {
|
|||
longitude: number;
|
||||
placeId: string;
|
||||
};
|
||||
// driverId: number | null;
|
||||
// driver: {
|
||||
// id: number;
|
||||
// name: string;
|
||||
// };
|
||||
creatorId: number;
|
||||
members: {
|
||||
id: number;
|
||||
|
@ -72,6 +67,10 @@ export type IEvent = {
|
|||
group: {
|
||||
id: number;
|
||||
name: string;
|
||||
} | null;
|
||||
creator: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
carpools: {
|
||||
id: number;
|
||||
|
|
Loading…
Reference in New Issue
Block a user