add label to home sort by

This commit is contained in:
beckerinj
2023-03-08 16:10:23 -05:00
parent b5a5103cfc
commit f32eeb413b
4 changed files with 6 additions and 3 deletions
@@ -58,6 +58,7 @@ const Builds: Component<{}> = (p) => {
style={{ width: "100%", padding: "0.5rem" }}
/>
<Selector
label={<div class="dimmed">sort by:</div>}
selected={sort()}
items={TREE_SORTS as any as string[]}
onSelect={(mode) => setSort(mode as TreeSortType)}
@@ -51,6 +51,7 @@ const Groups: Component<{}> = (p) => {
style={{ width: "100%", padding: "0.5rem" }}
/>
<Selector
label={<div class="dimmed">sort by:</div>}
selected={sort()}
items={TREE_SORTS as any as string[]}
onSelect={(mode) => setSort(mode as TreeSortType)}
@@ -2,14 +2,14 @@ import { ParentComponent, createContext, useContext } from "solid-js";
import { useAppState } from "../../../state/StateProvider";
import { useLocalStorage } from "../../../util/hooks";
export const TREE_SORTS = ["name", "created"] as const;
export const TREE_SORTS = ["name", "created at"] as const;
export type TreeSortType = typeof TREE_SORTS[number];
const value = () => {
const { servers, groups, builds } = useAppState();
const [sort, setSort] = useLocalStorage<TreeSortType>(
TREE_SORTS[0],
"home-sort-v1"
"home-sort-v2"
);
const server_sorter = () => {
if (!servers.loaded()) return () => 0;
@@ -42,7 +42,8 @@ const Servers: Component<{ serverIDs: string[]; showAdd?: boolean }> = (p) => {
onEdit={setServerFilter}
style={{ width: "100%", padding: "0.5rem" }}
/>
<Selector
<Selector
label={<div class="dimmed">sort by:</div>}
selected={sort()}
items={TREE_SORTS as any as string[]}
onSelect={(mode) => setSort(mode as TreeSortType)}