Cleanup the etails page

This commit is contained in:
Zoe Roux 2023-06-13 00:37:46 +09:00
parent eeb111dd9e
commit 4993ae50fe
2 changed files with 10 additions and 10 deletions

View File

@ -36,7 +36,7 @@ export const EpisodeList = <Props,>({
slug: string; slug: string;
season: string | number; season: string | number;
Header: ComponentType<Props & { children: JSX.Element }>; Header: ComponentType<Props & { children: JSX.Element }>;
headerProps: Props headerProps: Props;
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();

View File

@ -42,7 +42,10 @@ const SvgWave = (props: SvgProps) => {
); );
}; };
const ShowHeader = forwardRef<View, ViewProps & { slug: string }>(function _ShowHeader({ children, slug, ...props }, ref) { const ShowHeader = forwardRef<View, ViewProps & { slug: string }>(function _ShowHeader(
{ children, slug, ...props },
ref,
) {
const { css, theme } = useYoshiki(); const { css, theme } = useYoshiki();
return ( return (
@ -78,7 +81,7 @@ const ShowHeader = forwardRef<View, ViewProps & { slug: string }>(function _Show
</View> </View>
</View> </View>
); );
}); });
const query = (slug: string): QueryIdentifier<Show> => ({ const query = (slug: string): QueryIdentifier<Show> => ({
parser: ShowP, parser: ShowP,
@ -89,14 +92,11 @@ const query = (slug: string): QueryIdentifier<Show> => ({
}); });
export const ShowDetails: QueryPage<{ slug: string; season: string }> = ({ slug, season }) => { export const ShowDetails: QueryPage<{ slug: string; season: string }> = ({ slug, season }) => {
const { css, theme } = useYoshiki();
return ( return (
<SwitchVariant> <View {...css({ bg: theme.variant.background, flex: 1 })}>
{({ css, theme }) => ( <EpisodeList slug={slug} season={season} Header={ShowHeader} headerProps={{ slug }} />
<View {...css({ bg: theme.background, flex: 1 })}> </View>
<EpisodeList slug={slug} season={season} Header={ShowHeader} headerProps={{slug}} />
</View>
)}
</SwitchVariant>
); );
}; };