diff --git a/frontend/mobile/src/app/(app)/(tabs)/index.tsx b/frontend/mobile/src/app/(app)/(tabs)/index.tsx index dfc535ff..b49d4872 100644 --- a/frontend/mobile/src/app/(app)/(tabs)/index.tsx +++ b/frontend/mobile/src/app/(app)/(tabs)/index.tsx @@ -1,33 +1,41 @@ -import React from 'react'; -import { Pressable, StyleSheet } from 'react-native'; +import React, { useRef, useState } from 'react'; +import { StyleSheet } from 'react-native'; -import { router } from 'expo-router'; +import BottomSheet from '@gorhom/bottom-sheet'; -import { Box, Text } from '@/src/app/(design-system)'; -import { EventCard } from '@/src/app/(design-system)/components/EventCard'; +import { ClubPreview, EventPreview } from '@/src/app/(design-system)'; +import { Box, Button, Text } from '@/src/app/(design-system)'; const HomePage = () => { - const item = { - name: 'Your Event Name', - host: 'Your Club Name', - start_time: new Date(), - end_time: new Date() - }; + const club = useRef(null); + const event = useRef(null); + + const [clubPreview, setClubPreview] = useState(''); + const [eventPreview, setEventPreview] = useState(''); return ( Home - router.push(`/event/1`)}> - - + + + + ); }; diff --git a/frontend/mobile/src/app/(app)/event/components/about.tsx b/frontend/mobile/src/app/(app)/event/components/about.tsx index 438eb6aa..d7f64cf2 100644 --- a/frontend/mobile/src/app/(app)/event/components/about.tsx +++ b/frontend/mobile/src/app/(app)/event/components/about.tsx @@ -12,9 +12,10 @@ import { Text, textColorVariants } from '@/src/app/(design-system)'; -import { Tag as TagComponent } from '@/src/app/(design-system)'; import { Button } from '@/src/app/(design-system)/components/Button/Button'; +import { EventPageTags } from '../../../(design-system)/components/Tag/Tags'; + interface AboutEventProps { tags: Tag[]; description: string; @@ -36,12 +37,6 @@ export const AboutEvent = ({ } }; - const renderTag = (item: Tag) => ( - - {item.name} - - ); - return ( @@ -57,10 +52,8 @@ export const AboutEvent = ({ - - {tags.length >= 5 - ? tags.slice(0, 5).map((item) => renderTag(item)) - : tags.map((item) => renderTag(item))} + + {zoomLink && ( + )} + + Who are we? + {mockClub.preview} + + + + + ); + } +); diff --git a/frontend/mobile/src/app/(design-system)/components/Preview/Event.tsx b/frontend/mobile/src/app/(design-system)/components/Preview/Event.tsx new file mode 100644 index 00000000..d5b4266c --- /dev/null +++ b/frontend/mobile/src/app/(design-system)/components/Preview/Event.tsx @@ -0,0 +1,145 @@ +import React, { forwardRef, useCallback } from 'react'; +import { Pressable } from 'react-native'; +import { TouchableOpacity } from 'react-native-gesture-handler'; + +import { router } from 'expo-router'; + +import { Tag } from '@generatesac/lib'; +import BottomSheet, { BottomSheetBackdrop } from '@gorhom/bottom-sheet'; +import { Avatar } from '@rneui/base'; + +import { SACColors } from '../../shared/colors'; +import { Box } from '../Box/Box'; +import { Button } from '../Button/Button'; +import { EventPageTags } from '../Tag/Tags'; +import { Text } from '../Text/Text'; + +interface EventPreviewProps { + eventId: string; +} + +const tags: Tag[] = [ + { + id: 'abc123', + created_at: '2024-06-16T09:30:00Z', + updated_at: '2024-06-16T10:45:00Z', + name: 'Product A', + category_id: 'cat001' + }, + { + id: 'def456', + created_at: '2024-06-15T14:00:00Z', + updated_at: '2024-06-16T08:20:00Z', + name: 'Service B', + category_id: 'cat002' + }, + { + id: 'ghi789', + created_at: '2024-06-14T11:45:00Z', + updated_at: '2024-06-16T11:00:00Z', + name: 'Item C', + category_id: 'cat003' + }, + { + id: 'jkl012', + created_at: '2024-06-15T17:20:00Z', + updated_at: '2024-06-16T09:05:00Z', + name: 'Project D', + category_id: 'cat004' + }, + { + id: 'mno345', + created_at: '2024-06-13T13:00:00Z', + updated_at: '2024-06-16T10:30:00Z', + name: 'Task E', + category_id: 'cat005' + } +]; + +const mockEvent = { + name: 'Spring Showcase 2024', + clubId: '1', + hostedClub: 'Generate Product Development Studio', + preview: `Sandbox is Northeastern's student-led software consultancy building software for Northeastern clients. We work closely with clients across Northeastern to help them best leverage computation.`, + color: 'darkBlue' as SACColors, + clubLogo: 'https://avatars.githubusercontent.com/u/45272992?s=200&v=4', + tags: tags as Tag[] +}; + +type Ref = BottomSheet; + +export const EventPreview = forwardRef( + ({ eventId }, ref) => { + const renderBackdrop = useCallback( + (props: any) => ( + + ), + [] + ); + + return ( + + + + {mockEvent.name} + + + Hosted by + + router.push(`/club/${mockEvent.clubId}`) + } + > + + + + {mockEvent.hostedClub} + + + + + + About Event + {mockEvent.preview} + + + + + + ); + } +); diff --git a/frontend/mobile/src/app/(design-system)/components/Tag/Tags.tsx b/frontend/mobile/src/app/(design-system)/components/Tag/Tags.tsx new file mode 100644 index 00000000..011a4228 --- /dev/null +++ b/frontend/mobile/src/app/(design-system)/components/Tag/Tags.tsx @@ -0,0 +1,27 @@ +import { Tag } from '@generatesac/lib'; + +import { SACColors } from '../../shared/colors'; +import { Box } from '../Box/Box'; +import { Text } from '../Text/Text'; +import { Tag as TagComponent } from './Tag'; + +interface EventTagsProps { + tags: Tag[]; + color: SACColors; +} + +export const EventPageTags: React.FC = ({ tags, color }) => { + const renderTag = (item: Tag) => ( + + {item.name} + + ); + + return ( + + {tags.length >= 5 + ? tags.slice(0, 5).map((item) => renderTag(item)) + : tags.map((item) => renderTag(item))} + + ); +}; diff --git a/frontend/mobile/src/app/(design-system)/index.ts b/frontend/mobile/src/app/(design-system)/index.ts index c45d74da..308f6f15 100644 --- a/frontend/mobile/src/app/(design-system)/index.ts +++ b/frontend/mobile/src/app/(design-system)/index.ts @@ -12,3 +12,6 @@ export * from './components/Dropdown/SelectOne'; export * from './components/Dropdown/Multiselect'; export * from './components/PointOfContactCard/PointOfContactCard'; export * from './components/Tag/Tag'; +export * from './components/Preview/Event'; +export * from './components/Preview/Club'; +export * from './components/Tag/Tags';