diff --git a/src/components/button.tsx b/src/components/button.tsx index acda2d3..b36c9dd 100644 --- a/src/components/button.tsx +++ b/src/components/button.tsx @@ -2,6 +2,7 @@ import { JSX } from "solid-js"; export interface ButtonProps { class?: string; + classList?: Record; onClick?: JSX.EventHandlerUnion; children?: JSX.Element; } @@ -12,8 +13,9 @@ export const Button = (props: ButtonProps) => { type="button" class={ props.class ?? - "dark:hover:bg-dark-100 dark:bg-dark-300 dark:shadow-dark-800 dark:active:bg-dark-100 flex items-center gap-1 rounded-lg bg-white px-2 py-1.5 text-xs font-semibold shadow-sm hover:bg-neutral-50 active:bg-neutral-50" + "dark:hover:bg-dark-100 dark:bg-dark-300 dark:shadow-dark-800 dark:active:bg-dark-100 flex items-center gap-1 rounded-lg border-[0.5px] border-neutral-300 bg-white px-2 py-1.5 text-xs font-semibold shadow-md hover:bg-neutral-50 active:bg-neutral-50 dark:border-neutral-700" } + classList={props.classList} onClick={props.onClick} > {props.children} diff --git a/src/views/collection.tsx b/src/views/collection.tsx index ae49f25..512421f 100644 --- a/src/views/collection.tsx +++ b/src/views/collection.tsx @@ -3,9 +3,18 @@ import { Client, CredentialManager } from "@atcute/client"; import { $type, ActorIdentifier, InferXRPCBodyOutput } from "@atcute/lexicons"; import * as TID from "@atcute/tid"; import { A, useParams } from "@solidjs/router"; -import { createEffect, createResource, createSignal, For, Show, untrack } from "solid-js"; +import { + createEffect, + createResource, + createSignal, + For, + onCleanup, + onMount, + Show, + untrack, +} from "solid-js"; import { createStore } from "solid-js/store"; -import { Button } from "../components/button.jsx"; +import { Button, type ButtonProps } from "../components/button.jsx"; import { JSONType, JSONValue } from "../components/json.jsx"; import { agent } from "../components/login.jsx"; import { TextInput } from "../components/text-input.jsx"; @@ -72,9 +81,11 @@ const CollectionView = () => { const [batchDelete, setBatchDelete] = createSignal(false); const [lastSelected, setLastSelected] = createSignal(); const [reverse, setReverse] = createSignal(false); + const [filterStuck, setFilterStuck] = createSignal(false); const did = params.repo; let pds: string; let rpc: Client; + let sticky!: HTMLDivElement; const fetchRecords = async () => { if (!pds) pds = await resolvePDS(did); @@ -157,10 +168,58 @@ const CollectionView = () => { true, ); + const FilterButton = (props: ButtonProps) => { + return ( + +
{records.filter((rec) => rec.toDelete).length} @@ -244,7 +303,7 @@ const CollectionView = () => {
- + refetch()}>Load More