chore: clean up

This commit is contained in:
2024-03-16 18:45:54 +07:00
parent 46cc01e0ee
commit c8e014f33e
67 changed files with 163 additions and 2723 deletions

View File

@@ -0,0 +1,50 @@
import { LoaderIcon } from "@lume/icons";
import { Column } from "@lume/ui";
import { createFileRoute } from "@tanstack/react-router";
import { useState } from "react";
export const Route = createFileRoute("/$account/home")({
component: Screen,
pendingComponent: Pending,
loader: async () => {
const columns = [
{ name: "Tauri v2", content: "https://beta.tauri.app" },
{ name: "Tauri v1", content: "https://tauri.app" },
{ name: "Lume", content: "https://lume.nu" },
{ name: "Snort", content: "https://snort.social" },
];
return columns;
},
});
function Screen() {
const data = Route.useLoaderData();
const [isScroll, setIsScroll] = useState(false);
return (
<div className="relative h-full w-full">
<div
onScroll={() => setIsScroll((state) => !state)}
className="flex h-full w-full flex-nowrap gap-3 overflow-x-auto px-3 pb-3 pt-1.5 focus:outline-none"
>
{data.map((column, index) => (
<Column
key={column.name + index}
column={column}
isScroll={isScroll}
/>
))}
</div>
</div>
);
}
function Pending() {
return (
<div className="flex h-full w-full items-center justify-center">
<button type="button" disabled>
<LoaderIcon className="size-5 animate-spin" />
</button>
</div>
);
}

View File

@@ -1,36 +0,0 @@
import { LumeColumn } from "@lume/types";
import { Column } from "@lume/ui";
import { createLazyFileRoute } from "@tanstack/react-router";
import { useState } from "react";
const DEFAULT_COLUMNS: LumeColumn[] = [
{ name: "Tauri v2", content: "https://beta.tauri.app" },
{ name: "Tauri v1", content: "https://tauri.app" },
{ name: "Lume", content: "https://lume.nu" },
{ name: "Snort", content: "https://snort.social" },
];
export const Route = createLazyFileRoute("/$account/home")({
component: Screen,
});
function Screen() {
const [isScroll, setIsScroll] = useState(false);
return (
<div className="relative h-full w-full">
<div
onScroll={() => setIsScroll((state) => !state)}
className="flex h-full w-full flex-nowrap gap-3 overflow-x-auto px-3 pb-3 pt-1.5 focus:outline-none"
>
{DEFAULT_COLUMNS.map((column, index) => (
<Column
key={column.name + index}
column={column}
isScroll={isScroll}
/>
))}
</div>
</div>
);
}