-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
63 lines (56 loc) · 2.43 KB
/
index.tsx
File metadata and controls
63 lines (56 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { useFeatureFlag } from 'posthog-react-native';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Logo } from '../../../components/base/logo';
import { Screen } from '../../../components/base/screen';
import { ScrollContent } from '../../../components/base/scroll-content';
import { ErrorMessage } from '../../../components/common/error-message';
import { Header } from '../../../components/common/header';
import { HomePrText } from '../../../components/common/home-pr-text';
import { SectionTitle } from '../../../components/common/sectiontitle';
import { Separator } from '../../../components/common/separator';
import { StatusMessage } from '../../../components/common/status-message';
import { HomePresentationList } from '../../../components/schedule/layouts/home-presentation-list';
import { PresentationItemSkeletonList } from '../../../components/schedule/layouts/presentation-item-skeleton-list';
import { useConference } from '../../../hooks/use-conference';
// import { useNews } from '../../../hooks/use-news';
import { isConferenceDay } from '../../../utils/date.utils';
export default function HomePage() {
const conference = useConference();
// const news = useNews();
const { t } = useTranslation();
const isArchive = useFeatureFlag('archive_mode');
const showPresentations = isConferenceDay();
return (
<Screen analyticsScreenName='home'>
<Header>
<Logo />
</Header>
<ScrollContent>
{isArchive && (
<>
<StatusMessage type='warning'>{t('home.archive')}</StatusMessage>
<Separator className='mb-5' />
</>
)}
{showPresentations && (
<>
<SectionTitle>{t('home.presentationTitle')}</SectionTitle>
{conference.isLoading && <PresentationItemSkeletonList className='mx-0' />}
{conference.isError && <ErrorMessage>{t('home.error')}</ErrorMessage>}
{!conference.isError && !conference.isLoading && (
<HomePresentationList presentations={conference.data?.presentations ?? []} />
)}
<Separator className='mb-5' />
</>
)}
{!showPresentations && <HomePrText />}
{/*
<SectionTitle>{t('home.newsTitle')}</SectionTitle>
{news.isLoading && <NewsItemSkeletonList />}
{news.data && <HomeNewsList news={news.data.news} />}
*/}
</ScrollContent>
</Screen>
);
}