UI: switch some icons
This commit is contained in:
@@ -26,7 +26,7 @@ export const BlockDevicesView: Component = () => {
|
|||||||
<div class="tooltip tooltip-bottom" data-tip="Refresh">
|
<div class="tooltip tooltip-bottom" data-tip="Refresh">
|
||||||
<Button
|
<Button
|
||||||
onClick={() => loadDevices()}
|
onClick={() => loadDevices()}
|
||||||
startIcon={<Icon icon="Reload" />}
|
startIcon={<Icon icon="Update" />}
|
||||||
></Button>
|
></Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex max-w-screen-lg flex-col gap-4">
|
<div class="flex max-w-screen-lg flex-col gap-4">
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { callApi, ClanServiceInstance, SuccessQuery } from "@/src/api";
|
import { callApi, ClanServiceInstance, SuccessQuery } from "@/src/api";
|
||||||
import { BackButton } from "@/src/components/BackButton";
|
|
||||||
import { useParams } from "@solidjs/router";
|
import { useParams } from "@solidjs/router";
|
||||||
import { createQuery, useQueryClient } from "@tanstack/solid-query";
|
import { createQuery, useQueryClient } from "@tanstack/solid-query";
|
||||||
import { createSignal, For, Match, Switch } from "solid-js";
|
import { createSignal, For, Match, Switch } from "solid-js";
|
||||||
import { Show } from "solid-js";
|
|
||||||
import {
|
import {
|
||||||
createForm,
|
createForm,
|
||||||
FieldValues,
|
FieldValues,
|
||||||
@@ -15,9 +13,10 @@ import {
|
|||||||
} from "@modular-forms/solid";
|
} from "@modular-forms/solid";
|
||||||
import { TextInput } from "@/src/components/TextInput";
|
import { TextInput } from "@/src/components/TextInput";
|
||||||
import toast from "solid-toast";
|
import toast from "solid-toast";
|
||||||
import { get_single_service, set_single_service } from "@/src/api/inventory";
|
import { set_single_service } from "@/src/api/inventory";
|
||||||
import { Button } from "@/src/components/button";
|
import { Button } from "@/src/components/button";
|
||||||
import Icon from "@/src/components/icon";
|
import Icon from "@/src/components/icon";
|
||||||
|
import { Header } from "@/src/layout/header";
|
||||||
|
|
||||||
interface AdminModuleFormProps {
|
interface AdminModuleFormProps {
|
||||||
admin: AdminData;
|
admin: AdminData;
|
||||||
@@ -65,30 +64,17 @@ const EditClanForm = (props: EditClanFormProps) => {
|
|||||||
<Field name="icon">
|
<Field name="icon">
|
||||||
{(field) => (
|
{(field) => (
|
||||||
<>
|
<>
|
||||||
<figure class="p-1">
|
<div class="flex flex-col items-center">
|
||||||
<div class="flex flex-col items-center">
|
<div class="text-3xl text-primary-800">{curr_name()}</div>
|
||||||
<div class="text-3xl text-primary-800">{curr_name()}</div>
|
<div class="text-secondary-800">Wide settings</div>
|
||||||
<div class="text-secondary-800">Wide settings</div>
|
<Icon
|
||||||
</div>
|
class="mt-4"
|
||||||
</figure>
|
icon="ClanIcon"
|
||||||
<figure>
|
viewBox="0 0 72 89"
|
||||||
<Show
|
width={96}
|
||||||
when={field.value}
|
height={96}
|
||||||
fallback={
|
/>
|
||||||
<span class="material-icons aspect-square size-60 rounded-lg text-[18rem]">
|
</div>
|
||||||
group
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{(icon) => (
|
|
||||||
<img
|
|
||||||
class="aspect-square size-60 rounded-lg"
|
|
||||||
src={icon()}
|
|
||||||
alt="Clan Logo"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Show>
|
|
||||||
</figure>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
@@ -344,7 +330,6 @@ type AdminData = ClanServiceInstance<"admin">;
|
|||||||
|
|
||||||
export const ClanDetails = () => {
|
export const ClanDetails = () => {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const queryClient = useQueryClient();
|
|
||||||
const clan_dir = window.atob(params.id);
|
const clan_dir = window.atob(params.id);
|
||||||
// Fetch general meta data
|
// Fetch general meta data
|
||||||
const clanQuery = createQuery(() => ({
|
const clanQuery = createQuery(() => ({
|
||||||
@@ -355,48 +340,17 @@ export const ClanDetails = () => {
|
|||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
// Fetch admin settings
|
|
||||||
const adminQuery = createQuery(() => ({
|
|
||||||
queryKey: [clan_dir, "inventory", "services", "admin"],
|
|
||||||
queryFn: async () => {
|
|
||||||
const result = await get_single_service(queryClient, clan_dir, "admin");
|
|
||||||
if (!result) throw new Error("Failed to fetch data");
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="card card-normal">
|
<>
|
||||||
<BackButton />
|
<Header title={clan_dir} showBack />
|
||||||
<Show
|
<div class="flex flex-col justify-center">
|
||||||
when={!adminQuery.isLoading}
|
|
||||||
fallback={
|
|
||||||
<div>
|
|
||||||
<span class="loading loading-lg"></span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Switch fallback={<>General data not available</>}>
|
<Switch fallback={<>General data not available</>}>
|
||||||
<Match when={clanQuery.data}>
|
<Match when={clanQuery.data}>
|
||||||
{(d) => <EditClanForm initial={d()} directory={clan_dir} />}
|
{(d) => <EditClanForm initial={d()} directory={clan_dir} />}
|
||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
</Show>
|
</div>
|
||||||
<div class="divider"></div>
|
</>
|
||||||
<Show
|
|
||||||
when={!adminQuery.isLoading}
|
|
||||||
fallback={
|
|
||||||
<div>
|
|
||||||
<span class="loading loading-lg"></span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Switch fallback={<>Admin data not available</>}>
|
|
||||||
<Match when={adminQuery.data}>
|
|
||||||
{(d) => <AdminModuleForm admin={d()} base_url={clan_dir} />}
|
|
||||||
</Match>
|
|
||||||
</Switch>
|
|
||||||
</Show>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user