feat: child webview

This commit is contained in:
2024-03-16 15:05:06 +07:00
parent 16e6d234e5
commit 46cc01e0ee
37 changed files with 1686 additions and 1403 deletions

View File

@@ -1,23 +1,36 @@
import { Newsfeed } from "@/components/newsfeed";
import { LumeColumn } from "@lume/types";
import { Column } from "@lume/ui";
import { createLazyFileRoute } from "@tanstack/react-router";
import { VList } from "virtua";
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">
<VList
className="scrollbar-none h-full w-full overflow-x-auto pb-2 pt-1.5 focus:outline-none"
itemSize={420}
tabIndex={0}
horizontal
<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"
>
<Newsfeed />
<div className="mx-2 h-full w-[420px] rounded-xl bg-white">todo!</div>
</VList>
{DEFAULT_COLUMNS.map((column, index) => (
<Column
key={column.name + index}
column={column}
isScroll={isScroll}
/>
))}
</div>
</div>
);
}