diff --git a/src/app/(main)/character/[id]/chat/Main/actions/index.tsx b/src/app/(main)/character/[id]/chat/Main/actions/index.tsx deleted file mode 100644 index e0031f7..0000000 --- a/src/app/(main)/character/[id]/chat/Main/actions/index.tsx +++ /dev/null @@ -1,75 +0,0 @@ -'use client'; -import { - GenerateInputIcon, - PhoneCallIcon, - PortraitModeIcon, -} from '@/assets/chatacter'; -import { useChatStore } from '../../store'; -import IconFont from '@/components/ui/iconFont'; -import { cn } from '@/lib'; -import Image from 'next/image'; - -export default function Actions() { - const isPortraitMode = useChatStore((state) => state.isPortraitMode); - const setIsPortraitMode = useChatStore((state) => state.setIsPortraitMode); - const setIsPhoneCallMode = useChatStore((state) => state.setIsPhoneCallMode); - const className = 'text-[#0066FF] cursor-pointer hover:text-[#4269D6]'; - - const suggestMessages = [ - 'The threads of fate intertwine once more...The threads of fate intert', - 'The threads of fate intertwine once more.', - 'The threads of fate intertwine once more.', - ]; - - return ( -
-
- {suggestMessages.map((message, index) => ( -
- {message} -
- ))} - - - -
- {/* action */} -
-
null} className="flex items-center gap-5"> -
- -
-
setIsPhoneCallMode(true)} - className={cn(className, 'relative')} - > - - phone call -
-
-
setIsPortraitMode(!isPortraitMode)} - className="hover:cursor-pointer" - > - -
-
-
- ); -} diff --git a/src/app/(main)/character/[id]/chat/PhoneCallMode/index.tsx b/src/app/(main)/character/[id]/chat/PhoneCallMode/index.tsx index b83fe64..71a3013 100644 --- a/src/app/(main)/character/[id]/chat/PhoneCallMode/index.tsx +++ b/src/app/(main)/character/[id]/chat/PhoneCallMode/index.tsx @@ -61,7 +61,7 @@ export default function PhoneCallMode() { 'bg-white/10 hover:bg-white/20' )} > - + ); diff --git a/src/app/(main)/character/page.tsx b/src/app/(main)/character/page.tsx index 4d6c3da..32ac2ba 100644 --- a/src/app/(main)/character/page.tsx +++ b/src/app/(main)/character/page.tsx @@ -1,9 +1,8 @@ 'use client'; import { TagSelect, VirtualGrid, Rate } from '@/components'; import React from 'react'; -import Image from 'next/image'; import { useRouter } from 'next/navigation'; -import { useInfiniteScroll } from '@/hooks/useInfiniteScroll'; +import useSmartInfiniteQuery from '@/hooks/useSmartInfiniteQuery'; import { fetchCharacters } from './service-client'; import { fetchTags } from '@/services/tag'; import { useQuery } from '@tanstack/react-query'; @@ -16,11 +15,16 @@ const RoleCard: React.FC = React.memo(({ item }) => { onClick={() => router.push(`/character/${item.id}`)} className="cover-bg relative flex h-full w-full cursor-pointer flex-col justify-between overflow-hidden rounded-[20]" style={{ - backgroundImage: `url(${item.from || '/test.png'})`, + backgroundImage: `url(${item.coverImage || '/test.png'})`, }} > {/* from */} - from + from {/* info */}
@@ -54,8 +58,9 @@ export default function Novel() { noMoreData, onLoadMore, onSearch, - } = useInfiniteScroll(fetchCharacters, { + } = useSmartInfiniteQuery(fetchCharacters, { queryKey: 'characters', + defaultQuery: { tagId: undefined }, }); // 使用useQuery查询tags @@ -84,7 +89,7 @@ export default function Novel() { options={tags} render={(item) => `# ${item.label}`} onChange={(v) => { - onSearch({ tagId: v }); + onSearch({ tagId: v as any }); }} className="mx-12.5 my-7.5 mb-7.5" /> diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 07514b6..dca8e3c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -30,7 +30,7 @@ export default function RootLayout({ className={`${geistSans.variable} ${geistMono.variable} antialiased`} >