2023-10-10 15:38:02 +00:00
|
|
|
import type { PageProps } from '../types'
|
2023-11-14 15:10:00 +00:00
|
|
|
|
|
|
|
import { createMemo } from 'solid-js'
|
|
|
|
|
|
|
|
import { PageLayout } from '../../components/_shared/PageLayout'
|
2023-10-10 15:38:02 +00:00
|
|
|
import { Topics } from '../../components/Nav/Topics'
|
|
|
|
import { Expo } from '../../components/Views/Expo'
|
|
|
|
import { useLocalize } from '../../context/localize'
|
|
|
|
import { useRouter } from '../../stores/router'
|
2023-11-14 15:10:00 +00:00
|
|
|
import { LayoutType } from '../types'
|
2023-10-10 15:38:02 +00:00
|
|
|
|
|
|
|
export const ExpoPage = (props: PageProps) => {
|
|
|
|
const { t } = useLocalize()
|
2023-11-14 10:45:44 +00:00
|
|
|
const { page } = useRouter()
|
|
|
|
const getLayout = createMemo<LayoutType>(() => page().params['layout'] as LayoutType)
|
|
|
|
|
2023-10-10 15:38:02 +00:00
|
|
|
const title = createMemo(() => {
|
|
|
|
switch (getLayout()) {
|
|
|
|
case 'music': {
|
|
|
|
return t('Audio')
|
|
|
|
}
|
|
|
|
case 'video': {
|
|
|
|
return t('Video')
|
|
|
|
}
|
|
|
|
case 'image': {
|
|
|
|
return t('Artworks')
|
|
|
|
}
|
|
|
|
case 'literature': {
|
|
|
|
return t('Literature')
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
return t('Art')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
2023-11-14 10:45:44 +00:00
|
|
|
<PageLayout withPadding={true} zeroBottomPadding={true} title={title()}>
|
2023-10-10 15:38:02 +00:00
|
|
|
<Topics />
|
|
|
|
<Expo shouts={props.expoShouts} />
|
|
|
|
</PageLayout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Page = ExpoPage
|