Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
Alder Whiteford authored and Alder Whiteford committed Jun 15, 2024
2 parents a160ce7 + 8be0c09 commit 916fa85
Show file tree
Hide file tree
Showing 7 changed files with 32,444 additions and 4,630 deletions.
2 changes: 1 addition & 1 deletion backend/entities/events/previews/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func processEventStubs(db *gorm.DB, events []EventStub) ([]EventPreview, error)
}

var hosts []models.Club
if err := db.Where("id IN ?", eventIDs).Find(&hosts).Error; err != nil {
if err := db.Joins("JOIN events ON events.host = clubs.id").Where("events.id IN ?", eventIDs).Find(&hosts).Error; err != nil {
return nil, err
}

Expand Down
33 changes: 14 additions & 19 deletions frontend/mobile/src/app/(app)/event/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,21 @@ const EventPage = () => {
},
headerLeft: () => (

Check warning on line 133 in frontend/mobile/src/app/(app)/event/[id].tsx

View workflow job for this annotation

GitHub Actions / Lint

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “EventPage” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true
<Animated.View style={headerAnimatedStyle}>
<Arrow
color={
eventError || clubError ? 'black' : 'white'
}
/>
<Arrow color={apiError ? 'black' : 'white'} />
</Animated.View>
),
headerRight:
!eventError || clubError
? () => (
<Animated.View style={headerAnimatedStyle}>
<KebabMenu
onPress={() =>
shareEvent.current?.snapToIndex(0)
}
color="white"
/>
</Animated.View>
)
: () => <></>
headerRight: !apiError
? () => (

Check warning on line 139 in frontend/mobile/src/app/(app)/event/[id].tsx

View workflow job for this annotation

GitHub Actions / Lint

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “EventPage” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true
<Animated.View style={headerAnimatedStyle}>
<KebabMenu
onPress={() =>
shareEvent.current?.snapToIndex(0)
}
color="white"
/>
</Animated.View>
)
: () => <></>

Check warning on line 149 in frontend/mobile/src/app/(app)/event/[id].tsx

View workflow job for this annotation

GitHub Actions / Lint

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “EventPage” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true
}}
/>
<Animated.ScrollView
Expand Down Expand Up @@ -182,7 +177,7 @@ const EventPage = () => {
<Box gap="l">
<Overview
clubId={event.host}
logo={MockEvent.logo}
logo={club.logo ?? ''}
eventName={event.name}
color={MockEvent.color}
club={club?.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const Register: React.FC<RegisterProps> = ({ setSheet, eventType }) => {
} else {
setSheet('save');
}
console.log(data);
} catch (error) {
if (error instanceof ZodError) {
Alert.alert('Validation Error', error.errors[0].message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export type EventCalendarPreview = {
title: string;
startTime: string;
endTime: string;
host: string;
host_name: string;
host_logo: string;
image: string;
tags: Tag[];
};
Expand Down Expand Up @@ -91,11 +92,11 @@ export default function DayTimeSection({ time, data }: DayTimeSectionProps) {
event={event.title}
variant="calendar"
tags={event.tags}
club={event.host}
club={event.host_name}
logo={event.host_logo}
eventId={event.id}
startTime={new Date(event.startTime)}
endTime={new Date(event.endTime)}
logo="https://www.iconpacks.net/icons/2/free-user-icon-3296-thumb.png"
image={event.image}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export function parseData(start: number, end: number, data?: EventPreview[]) {
image: eventPreviewImages[
Math.floor(Math.random() * eventPreviewImages.length)
],
host: event.host_name,
host_name: event.host_name,
host_logo:
event.host_logo ??
'https://www.iconpacks.net/icons/2/free-user-icon-3296-thumb.png',
tags: event.tags
};

Expand Down
Loading

0 comments on commit 916fa85

Please sign in to comment.