Skip to content

Commit 43634a9

Browse files
authored
Merge pull request #377 from eurofurence/feat/coming-soon
feat: coming soon for delaers & schedule
2 parents b3d3d1b + a3930f8 commit 43634a9

10 files changed

Lines changed: 97 additions & 1 deletion

File tree

assets/static/dealers-empty.png

842 KB
Loading

assets/static/events-empty.png

694 KB
Loading

src/app/(areas)/dealers/_layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import { StyleSheet, View } from 'react-native'
1717
import { useSafeAreaInsets } from 'react-native-safe-area-context'
1818
import { Icon, type IconNames } from '@/components/generic/atoms/Icon'
1919
import { Search } from '@/components/generic/atoms/Search'
20+
import { ComingSoon } from '@/components/generic/containers/ComingSoon'
21+
import { conName } from '@/configuration'
2022
import { DealersSearchContext } from '@/context/DealersSearchContext'
23+
import { useCache } from '@/context/data/Cache'
2124
import { useThemeBackground } from '@/hooks/themes/useThemeHooks'
2225

2326
export const unstable_settings = {
@@ -53,6 +56,7 @@ export default function DealersLayout() {
5356
const { t } = useTranslation('Dealers')
5457
const insets = useSafeAreaInsets()
5558
const backgroundSurface = useThemeBackground('surface')
59+
const { dealers } = useCache()
5660
const [filter, setFilter] = useState('')
5761

5862
const options = useMemo(() => {
@@ -65,6 +69,15 @@ export default function DealersLayout() {
6569
}
6670
}, [])
6771

72+
if (dealers.length === 0)
73+
return (
74+
<ComingSoon
75+
image={require('@/assets/static/dealers-empty.png')}
76+
title={t('coming_soon_title')}
77+
text={t('coming_soon_body', { conName })}
78+
/>
79+
)
80+
6881
return (
6982
<DealersSearchContext.Provider
7083
value={{ query: filter, setQuery: setFilter }}

src/app/(areas)/schedule/_layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
1919
import { ShowInternalEventsToggle } from '@/components/events/ShowInternalEventsToggle'
2020
import { Icon, type IconNames } from '@/components/generic/atoms/Icon'
2121
import { Search } from '@/components/generic/atoms/Search'
22+
import { ComingSoon } from '@/components/generic/containers/ComingSoon'
23+
import { conName } from '@/configuration'
2224
import { useCache } from '@/context/data/Cache'
2325
import type { EventDayDetails } from '@/context/data/types.details'
2426
import { ScheduleSearchContext } from '@/context/ScheduleSearchContext'
@@ -68,7 +70,7 @@ export default function ScheduleLayout() {
6870
const insets = useSafeAreaInsets()
6971
const now = useNow('static')
7072
const backgroundSurface = useThemeBackground('surface')
71-
const { eventDays } = useCache()
73+
const { events, eventDays } = useCache()
7274
const initialRouteName = getInitialRoute(eventDays, now)
7375
const [filter, setFilter] = useState('')
7476

@@ -86,6 +88,15 @@ export default function ScheduleLayout() {
8688
}
8789
}, [eventDays])
8890

91+
if (events.length === 0)
92+
return (
93+
<ComingSoon
94+
image={require('@/assets/static/events-empty.png')}
95+
title={t('coming_soon_title')}
96+
text={t('coming_soon_body', { conName })}
97+
/>
98+
)
99+
89100
return (
90101
<ScheduleSearchContext.Provider
91102
value={{ query: filter, setQuery: setFilter }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { StyleSheet, View } from 'react-native'
2+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
3+
4+
import { useThemeBackground } from '@/hooks/themes/useThemeHooks'
5+
6+
import { Image, type ImageProps } from '../atoms/Image'
7+
import { Label } from '../atoms/Label'
8+
9+
export type ComingSoonProps = {
10+
image: ImageProps['source']
11+
title: string
12+
text: string
13+
}
14+
15+
export const ComingSoon = ({ image, title, text }: ComingSoonProps) => {
16+
const insets = useSafeAreaInsets()
17+
const backgroundSurface = useThemeBackground('surface')
18+
19+
return (
20+
<View
21+
style={[styles.container, backgroundSurface, { paddingTop: insets.top }]}
22+
accessibilityRole='text'
23+
accessibilityLabel={`${title}. ${text}`}
24+
>
25+
<Image style={styles.image} source={image} contentFit='contain' />
26+
<Label type='h1' variant='middle'>
27+
{title}
28+
</Label>
29+
<Label type='regular' variant='middle' style={styles.text}>
30+
{text}
31+
</Label>
32+
</View>
33+
)
34+
}
35+
36+
const styles = StyleSheet.create({
37+
container: {
38+
flex: 1,
39+
justifyContent: 'center',
40+
alignItems: 'center',
41+
padding: 30,
42+
gap: 20,
43+
},
44+
image: {
45+
height: 240,
46+
aspectRatio: 1,
47+
maxWidth: '100%',
48+
},
49+
text: {
50+
maxWidth: 360,
51+
},
52+
})

src/i18n/translations.de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@
341341
"after_dark": "After Dark",
342342
"all": "Alle",
343343
"alphabetical": "A-Z",
344+
"coming_soon_body": "Die Dealers' Den für {{conName}} wird noch vorbereitet. Schau später wieder vorbei, um zu sehen, wer dabei sein wird!",
345+
"coming_soon_title": "Bald verfügbar!",
344346
"dealers_at_convention": "Dealer auf der {{convention}}",
345347
"dealers_in_ad": "Im After Dark Bereich",
346348
"dealers_in_regular": "Im regulären Bereich",
@@ -414,6 +416,8 @@
414416
},
415417
"Events": {
416418
"afternoon": "Nachmittags",
419+
"coming_soon_body": "Das Programm für {{conName}} ist noch in Arbeit. Schau später wieder vorbei, um deinen Besuch zu planen!",
420+
"coming_soon_title": "Bald verfügbar!",
417421
"current_subtitle": "Diese Events finden gerade jetzt statt",
418422
"current_title": "Aktuelle Events",
419423
"evening": "Am Abend",

src/i18n/translations.en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@
345345
"after_dark": "After dark",
346346
"all": "All",
347347
"alphabetical": "A-Z",
348+
"coming_soon_body": "The Dealers' Den for {{conName}} is still being prepared. Check back later to see who will be there!",
349+
"coming_soon_title": "Coming soon!",
348350
"dealers_at_convention": "Dealers at {{convention}}",
349351
"dealers_in_ad": "After dark dealers den",
350352
"dealers_in_regular": "Regular dealers den",
@@ -419,6 +421,8 @@
419421
},
420422
"Events": {
421423
"afternoon": "In the afternoon",
424+
"coming_soon_body": "The schedule for {{conName}} is still being worked on. Check back later to plan your visit!",
425+
"coming_soon_title": "Coming soon!",
422426
"current_subtitle": "These events are currently happening",
423427
"current_title": "Current Events",
424428
"evening": "In the evening",

src/i18n/translations.it.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@
204204
"dealers_sectioned_list_hint": "Scorri per navigare tra i venditori raggruppati per categoria, trascina verso il basso per aggiornare"
205205
},
206206
"all": "Tutti",
207+
"coming_soon_body": "La Dealers' Den di {{conName}} è ancora in preparazione. Torna più tardi per scoprire chi ci sarà!",
208+
"coming_soon_title": "In arrivo!",
207209
"dealers_at_convention": "Venditori a {{convention}}",
208210
"not_attending_on": "Non disponibile il {{offDays}}",
209211
"search": {
@@ -263,6 +265,8 @@
263265
},
264266
"Events": {
265267
"afternoon": "Al pomeriggio",
268+
"coming_soon_body": "Il programma di {{conName}} è ancora in preparazione. Torna più tardi per pianificare la tua visita!",
269+
"coming_soon_title": "In arrivo!",
266270
"current_subtitle": "Questi eventi si stanno svolgendo ora",
267271
"current_title": "Eventi in corso",
268272
"evening": "Alla sera",

src/i18n/translations.nl.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@
244244
"after_dark": "After dark",
245245
"all": "All",
246246
"alphabetical": "A-Z",
247+
"coming_soon_body": "De Dealers' Den voor {{conName}} wordt nog voorbereid. Kom later terug om te zien wie erbij zal zijn!",
248+
"coming_soon_title": "Binnenkort beschikbaar!",
247249
"dealers_at_convention": "Dealers op {{convention}}",
248250
"dealers_in_ad": "After dark dealers den",
249251
"dealers_in_regular": "Normale dealers",
@@ -314,6 +316,8 @@
314316
},
315317
"Events": {
316318
"afternoon": "In de middag",
319+
"coming_soon_body": "Het programma voor {{conName}} is nog in de maak. Kom later terug om je bezoek te plannen!",
320+
"coming_soon_title": "Binnenkort beschikbaar!",
317321
"current_subtitle": "Deze evenementen zijn momenteel aan het gebeuren",
318322
"current_title": "Huidige evenementen",
319323
"evening": "In de avond",

src/i18n/translations.pl.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@
212212
"dealers_sectioned_list_hint": "Przeciągnij, aby nawigować przez wystawców pogrupowanych według kategorii, przeciągnij w dół, aby odświeżyć"
213213
},
214214
"all": "Wszyscy",
215+
"coming_soon_body": "Dealers' Den na {{conName}} jest jeszcze w przygotowaniu. Zajrzyj później, aby zobaczyć, kto się pojawi!",
216+
"coming_soon_title": "Już wkrótce!",
215217
"dealers_at_convention": "Wystawcy na {{convention}}",
216218
"not_attending_on": "Nie biorą udziału w {{offDays}}",
217219
"search": {
@@ -274,6 +276,8 @@
274276
},
275277
"Events": {
276278
"afternoon": "Po południu",
279+
"coming_soon_body": "Program {{conName}} jest jeszcze w przygotowaniu. Zajrzyj później, aby zaplanować swoją wizytę!",
280+
"coming_soon_title": "Już wkrótce!",
277281
"current_subtitle": "Te punkty programu odbywają się w tej chwili",
278282
"current_title": "Bieżące punkty programu",
279283
"evening": "Wieczorem",

0 commit comments

Comments
 (0)