feat: improve official columns

This commit is contained in:
2024-04-18 07:50:46 +07:00
parent f3c52237fa
commit cd31b99559
10 changed files with 59 additions and 77 deletions

View File

@@ -18,6 +18,7 @@ export const Route = createFileRoute("/foryou")({
beforeLoad: async ({ search, context }) => {
const ark = context.ark;
const interests = await ark.get_interest();
const settings = await ark.get_settings();
if (!interests) {
throw redirect({
@@ -31,6 +32,7 @@ export const Route = createFileRoute("/foryou")({
return {
interests,
settings,
};
},
component: Screen,
@@ -48,7 +50,6 @@ export function Screen() {
interests.hashtags,
20,
pageParam,
true,
);
return events;
},
@@ -87,13 +88,12 @@ export function Screen() {
{data.map((item) => renderItem(item))}
</Virtualizer>
)}
{data?.length && hasNextPage ? (
<div className="flex h-20 items-center justify-center">
<button
type="button"
onClick={() => fetchNextPage()}
disabled={isFetchingNextPage || isFetchingNextPage}
disabled={isFetchingNextPage}
className="inline-flex h-12 w-36 items-center justify-center gap-2 rounded-full bg-neutral-100 px-3 font-medium hover:bg-neutral-200 focus:outline-none dark:bg-neutral-900 dark:hover:bg-neutral-800"
>
{isFetchingNextPage ? (