Skip to content

Commit

Permalink
feat: event & club preview components (#1034)
Browse files Browse the repository at this point in the history
Co-authored-by: Alder Whiteford <alderwhiteford@Alders-MacBook-Pro-2.local>
  • Loading branch information
in-mai-space and Alder Whiteford committed Jun 17, 2024
1 parent b731b2e commit ab2b9e2
Show file tree
Hide file tree
Showing 44 changed files with 1,307 additions and 496 deletions.
2 changes: 1 addition & 1 deletion backend/entities/clubs/events/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func GetClubEvents(db *gorm.DB, clubID uuid.UUID, pageInfo fiberpaginate.PageInf
db = cache.SetUseCache(db, true)

var events []models.Event
if err := db.Where("club_id = ?", clubID).Scopes(utilities.IntoScope(pageInfo, db)).Find(&events).Error; err != nil {
if err := db.Where("host = ?", clubID).Scopes(utilities.IntoScope(pageInfo, db)).Find(&events).Error; err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@generatesac/lib",
"version": "0.0.170",
"version": "0.0.171",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions frontend/lib/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from "./event";
export * from "./file";
export * from "./pointOfContact";
export * from "./verification";
export * from "./recruitment";
2 changes: 1 addition & 1 deletion frontend/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@generatesac/lib": "0.0.170",
"@generatesac/lib": "0.0.171",
"@gorhom/bottom-sheet": "^4.6.3",
"@hookform/resolvers": "^3.4.2",
"@react-native-async-storage/async-storage": "^1.23.1",
Expand Down
94 changes: 48 additions & 46 deletions frontend/mobile/src/app/(app)/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,56 @@ const TabBarIcon: React.FC<TabBarIconProps> = ({ focused, icon }) => (

const Layout = () => {
return (
<Tabs
screenOptions={{
tabBarShowLabel: false,
tabBarStyle: {
borderTopWidth: 1,
borderTopColor: 'gray',
height: 85
}
}}
sceneContainerStyle={{
backgroundColor: 'white'
}}
>
<Tabs.Screen
name="index"
options={{
title: 'Home',
headerShown: false,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Home' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faHouse })
<>
<Tabs
screenOptions={{
tabBarShowLabel: false,
tabBarStyle: {
borderTopWidth: 1,
borderTopColor: 'gray',
height: 85
}
}}
/>
<Tabs.Screen
name="calendar"
options={{
title: 'Calendar',
headerShown: false,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Calendar' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faCalendarDays })
sceneContainerStyle={{
backgroundColor: 'white'
}}
/>
<Tabs.Screen
name="profile"
options={{
title: 'Profile',
headerShown: true,
headerTransparent: true,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Profile' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faUser })
}}
/>
</Tabs>
>
<Tabs.Screen
name="index"
options={{
title: 'Home',
headerShown: false,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Home' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faHouse })
}}
/>
<Tabs.Screen
name="calendar"
options={{
title: 'Calendar',
headerShown: false,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Calendar' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faCalendarDays })
}}
/>
<Tabs.Screen
name="profile"
options={{
title: 'Profile',
headerShown: true,
headerTransparent: true,
tabBarLabel: ({ focused }) =>
TabBarLabel({ focused, title: 'Profile' }),
tabBarIcon: ({ focused }) =>
TabBarIcon({ focused, icon: faUser })
}}
/>
</Tabs>
</>
);
};

Expand Down
42 changes: 1 addition & 41 deletions frontend/mobile/src/app/(app)/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
import React from 'react';
import { Pressable, StyleSheet } from 'react-native';

import { router } from 'expo-router';

import { Box, Text } from '@/src/app/(design-system)';
import { EventCard } from '@/src/app/(design-system)/components/EventCard';

const HomePage = () => {
const item = {
name: 'Your Event Name',
host: 'Your Club Name',
start_time: new Date(),
end_time: new Date()
};

return (
<Box style={styles.container}>
<Text variant="body-1">Home</Text>
<Pressable onPress={() => router.push(`/event/1`)}>
<EventCard
variant="small"
event={item.name}
club={item.host}
eventId="1"
startTime={item.start_time}
endTime={item.end_time}
image="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSLF3ord7lnV_5Je-pC2AUgUiesHNPcZlpI7A&s"
/>
</Pressable>
</Box>
);
return <></>;
};

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},
contentContainer: {
flex: 1,
alignItems: 'center'
}
});

export default HomePage;
11 changes: 11 additions & 0 deletions frontend/mobile/src/app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ const Layout = () => {
}
}}
/>
<Stack.Screen
name="club"
options={{
headerTitle: '',
headerTransparent: true,
headerShown: false,
headerTitleStyle: {
color: 'white'
}
}}
/>
<Stack.Screen
name="user"
options={{
Expand Down

0 comments on commit ab2b9e2

Please sign in to comment.