-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from simonyiszk/event-details
Event details
- Loading branch information
Showing
20 changed files
with
222 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Tabs } from 'expo-router'; | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
||
import { TabbarBackground } from '../../components/tabbar/tabbar-background'; | ||
import { TabbarIcon } from '../../components/tabbar/tabbar-icon'; | ||
import { TabbarLabel } from '../../components/tabbar/tabbar-label'; | ||
import { colors } from '../../theme/colors'; | ||
|
||
export default function TabsLayout() { | ||
const { top, bottom, left, right } = useSafeAreaInsets(); | ||
return ( | ||
<Tabs | ||
initialRouteName='home' | ||
backBehavior='none' | ||
sceneContainerStyle={{ | ||
backgroundColor: 'transparent', | ||
paddingTop: top + 10, | ||
paddingLeft: left, | ||
paddingRight: right, | ||
}} | ||
screenOptions={{ | ||
headerShown: false, | ||
tabBarActiveTintColor: colors.primary['500'], | ||
tabBarLabel: TabbarLabel, | ||
tabBarBackground: TabbarBackground, | ||
tabBarStyle: { | ||
position: 'absolute', | ||
bottom: bottom + 10, | ||
borderTopWidth: 0, | ||
marginHorizontal: 20, | ||
paddingBottom: 10, | ||
paddingTop: 10, | ||
height: 70, | ||
elevation: 10, | ||
}, | ||
}} | ||
> | ||
<Tabs.Screen | ||
name='home' | ||
options={{ | ||
title: 'Főoldal', | ||
tabBarIcon: ({ focused }) => <TabbarIcon focused={focused} name='home' />, | ||
}} | ||
/> | ||
<Tabs.Screen | ||
name='schedule' | ||
options={{ | ||
title: 'Programterv', | ||
tabBarIcon: ({ focused }) => <TabbarIcon focused={focused} name='calendar' />, | ||
}} | ||
/> | ||
<Tabs.Screen | ||
name='map' | ||
options={{ | ||
title: 'Térkép', | ||
tabBarIcon: ({ focused }) => <TabbarIcon focused={focused} name='map' />, | ||
}} | ||
/> | ||
</Tabs> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Stack } from 'expo-router'; | ||
|
||
export default function HomeStackLayout() { | ||
return ( | ||
<Stack | ||
screenOptions={{ | ||
headerShown: false, | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Screen } from '../../../components/base/screen'; | ||
import { Header } from '../../../components/common/header'; | ||
import { Title } from '../../../components/common/title'; | ||
import { ScheduleList } from '../../../components/schedule/schedule-list'; | ||
import { useSchedule } from '../../../hooks/use-schedule'; | ||
|
||
interface HomePageProps {} | ||
|
||
export default function HomePage({}: HomePageProps) { | ||
const { data } = useSchedule(); | ||
|
||
return ( | ||
<Screen> | ||
<Header> | ||
<Title>Simonyi Konferencia</Title> | ||
</Header> | ||
<ScheduleList schedule={data ?? []} filterToCurrent filterToUpcoming /> | ||
</Screen> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ScheduleDetailsPage } from '../../../components/schedule/schedule-details-page'; | ||
import { useSafeId } from '../../../utils/common.utils'; | ||
|
||
export default function ScheduleEventDetails() { | ||
const id = useSafeId(); | ||
return <ScheduleDetailsPage id={id} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Screen } from '../../components/base/screen'; | ||
import { Header } from '../../components/common/header'; | ||
import { Title } from '../../components/common/title'; | ||
|
||
interface MapPageProps {} | ||
|
||
export default function MapPage({}: MapPageProps) { | ||
return ( | ||
<Screen> | ||
<Header> | ||
<Title>Térkép</Title> | ||
</Header> | ||
</Screen> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Stack } from 'expo-router'; | ||
|
||
export default function ScheduleStackLayout() { | ||
return ( | ||
<Stack | ||
screenOptions={{ | ||
headerShown: false, | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Screen } from '../../../components/base/screen'; | ||
import { Header } from '../../../components/common/header'; | ||
import { Title } from '../../../components/common/title'; | ||
import { ScheduleList } from '../../../components/schedule/schedule-list'; | ||
import { useSchedule } from '../../../hooks/use-schedule'; | ||
|
||
interface SchedulePageProps {} | ||
|
||
export default function SchedulePage({}: SchedulePageProps) { | ||
const { data } = useSchedule(); | ||
return ( | ||
<Screen> | ||
<Header> | ||
<Title>Programterv</Title> | ||
</Header> | ||
<ScheduleList schedule={data ?? []} /> | ||
</Screen> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ScheduleDetailsPage } from '../../../components/schedule/schedule-details-page'; | ||
import { useSafeId } from '../../../utils/common.utils'; | ||
|
||
export default function ScheduleEventDetails() { | ||
const id = useSafeId(); | ||
return <ScheduleDetailsPage id={id} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
import { Header } from '../components/common/header'; | ||
import { Title } from '../components/common/title'; | ||
import { ScheduleList } from '../components/schedule/schedule-list'; | ||
import { useSchedule } from '../hooks/use-schedule'; | ||
import { Redirect } from 'expo-router'; | ||
|
||
interface HomePageProps {} | ||
|
||
export default function HomePage({}: HomePageProps) { | ||
const { data } = useSchedule(); | ||
|
||
return ( | ||
<> | ||
<Header> | ||
<Title>Simonyi Konferencia</Title> | ||
</Header> | ||
<ScheduleList schedule={data ?? []} filterToCurrent filterToUpcoming /> | ||
</> | ||
); | ||
export default function App() { | ||
return <Redirect href='/(tabs)/home' />; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { View, ViewProps } from 'react-native'; | ||
|
||
import { cn } from '../../utils/common.utils'; | ||
|
||
export function Screen({ className, ...props }: ViewProps) { | ||
return <View className={cn('bg-slate-100 h-full', className)} {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { format } from 'date-fns'; | ||
|
||
import { useScheduleItem } from '../../hooks/use-schedule-item'; | ||
import { Screen } from '../base/screen'; | ||
import { StyledText } from '../base/text'; | ||
import { Header } from '../common/header'; | ||
import { Subtitle } from '../common/subtitle'; | ||
import { Title } from '../common/title'; | ||
|
||
interface ScheduleDetailsPageProps { | ||
id: string; | ||
} | ||
|
||
export function ScheduleDetailsPage({ id }: ScheduleDetailsPageProps) { | ||
const { data } = useScheduleItem(id); | ||
if (!data) return <></>; | ||
const startDate = format(new Date(data.start), 'HH:mm'); | ||
const endDate = format(new Date(data.end), 'HH:mm'); | ||
return ( | ||
<Screen> | ||
<Header> | ||
<Title>{data?.title}</Title> | ||
<Subtitle> | ||
{data?.location} • {startDate} - {endDate} | ||
</Subtitle> | ||
</Header> | ||
<StyledText className='mx-5 text-xl'>{data?.description}</StyledText> | ||
</Screen> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { useSchedule } from './use-schedule'; | ||
|
||
export function useScheduleItem(id: string) { | ||
const { data, ...rest } = useSchedule(); | ||
const item = data?.find((item) => item.id === id); | ||
return { data: item, ...rest }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.