import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useAtom, useAtomValue, useSetAtom } from "jotai"; import { Slider, Switch } from "radix-ui"; import { useEffect, useState } from "react"; import { Header } from "~/components/Header"; import Login from "~/components/Login"; import { constellationURLAtom, defaultconstellationURL, defaulthue, defaultImgCDN, defaultLycanURL, defaultslingshotURL, defaultVideoCDN, enableBitesAtom, enableBridgyTextAtom, enableWafrnTextAtom, hueAtom, imgCDNAtom, lycanURLAtom, slingshotURLAtom, videoCDNAtom, } from "~/utils/atoms"; import { MaterialNavItem } from "./__root"; export const Route = createFileRoute("/settings")({ component: Settings, }); export function Settings() { const navigate = useNavigate(); return ( <>
{ if (window.history.length > 1) { window.history.back(); } else { window.location.assign("/"); } }} />
} ActiveIcon={} active={false} onClickCallbback={() => navigate({ to: "/feeds", //params: { did: agent.assertDid }, }) } text="Feeds" /> } ActiveIcon={} active={false} onClickCallbback={() => navigate({ to: "/moderation", //params: { did: agent.assertDid }, }) } text="Moderation" />
Service Endpoints Customize the servers to be used by the app

Notice: Please restart/refresh the app if changes arent applying correctly

); } export function SettingHeading({ title, top, }: { title: string; top?: boolean; }) { return (
{title}
); } export function SwitchSetting({ atom, title, description, }: { atom: typeof enableBitesAtom; title?: string; description?: string; }) { const value = useAtomValue(atom); const setValue = useSetAtom(atom); const [hydrated, setHydrated] = useState(false); // eslint-disable-next-line react-hooks/set-state-in-effect useEffect(() => setHydrated(true), []); if (!hydrated) { // Avoid rendering Switch until we know storage is loaded return null; } return (
setValue(v)} className="m3switch root" >
); } function Hue() { const [hue, setHue] = useAtom(hueAtom); return (
Hue Change the colors of the app
); } export function TextInputSetting({ atom, title, description, init, }: { atom: typeof constellationURLAtom; title?: string; description?: string; init?: string; }) { const [value, setValue] = useAtom(atom); return (
{/*
{title && (

{title}

)} {description && (

{description}

)}
*/}
setValue(e.target.value)} />
{/* setValue(e.target.value)} className="flex-1 px-3 py-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-gray-600" placeholder="Enter value..." /> */}
); } interface SliderProps { atom: typeof hueAtom; min?: number; max?: number; step?: number; } export const SliderComponent: React.FC = ({ atom, min = 0, max = 100, step = 1, }) => { const [value, setValue] = useAtom(atom); return ( setValue(v[0])} > ); }; interface SliderPProps { value: number; min?: number; max?: number; step?: number; } export const SliderPrimitive: React.FC = ({ value, min = 0, max = 100, step = 1, }) => { return ( {}} > ); };