样式修改

main
lvchenpeng 3 months ago
parent 123c9b791f
commit c6b516d6b5

@ -20,7 +20,7 @@ const Layout = ({ children }: PropsWithChildren) => {
> >
<Flexbox <Flexbox
gap={16} gap={16}
style={{ maxWidth: MAX_WIDTH, position: 'relative' }} style={{ position: 'relative' }}
width={'100%'} width={'100%'}
> >
{children} {children}

@ -12,14 +12,16 @@ const Layout = async ({ children }: PropsWithChildren) => {
const categoryList = await discoverService.getProviderList(DEFAULT_LANG); const categoryList = await discoverService.getProviderList(DEFAULT_LANG);
return ( return (
<Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}> <div>
<CategoryContainer> <Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}>
<Category data={categoryList} /> <CategoryContainer>
</CategoryContainer> <Category data={categoryList} />
<Flexbox flex={1} gap={16}> </CategoryContainer>
{children} <Flexbox flex={1} gap={16}>
{children}
</Flexbox>
</Flexbox> </Flexbox>
</Flexbox> </div>
); );
}; };

@ -74,7 +74,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
}; };
fetchData(); fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次 }, []); // 空数组[]意味着仅在组件挂载时调用一次
const handleClickCard = (item) => { const handleClickCard = (item) => {
console.log(item) console.log(item)
router.push(urlJoin('/discover/model/', item.identifier)) router.push(urlJoin('/discover/model/', item.identifier))
@ -108,7 +108,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
<Grid maxItemWidth={280} rows={4}> <Grid maxItemWidth={280} rows={4}>
{stData.map((item) => ( {stData.map((item) => (
// <Link href={urlJoin('/discover/assistant/', item.identifier)} key={item.identifier}> // <Link href={urlJoin('/discover/assistant/', item.identifier)} key={item.identifier}>
<Card key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} /> <Card style={{boxShadow: "1px 0px 12px 0px rgba(42, 77, 255, 0.19)"}} key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} />
// </Link> // </Link>
))} ))}
</Grid> </Grid>
@ -121,7 +121,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
initialItemCount={24} initialItemCount={24}
itemContent={(_, item) => ( itemContent={(_, item) => (
// <Link href={urlJoin('/discover/model/', item.identifier)} key={item.identifier}> // <Link href={urlJoin('/discover/model/', item.identifier)} key={item.identifier}>
<Card key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} /> <Card style={{boxShadow: "1px 0px 12px 0px rgba(42, 77, 255, 0.19)"}} key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} />
// </Link> // </Link>
)} )}
style={{ style={{

Loading…
Cancel
Save