import { LaurelIcon } from "@lume/icons"; import { NostrQuery } from "@lume/system"; import { Spinner } from "@lume/ui"; import * as Switch from "@radix-ui/react-switch"; import { createFileRoute } from "@tanstack/react-router"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; export const Route = createFileRoute("/auth/$account/settings")({ beforeLoad: async () => { const settings = await NostrQuery.getSettings(); return { settings }; }, component: Screen, pendingComponent: Pending, }); function Screen() { const { settings } = Route.useRouteContext(); const { account } = Route.useParams(); const { t } = useTranslation(); const [newSettings, setNewSettings] = useState(settings); const [loading, setLoading] = useState(false); const navigate = Route.useNavigate(); const toggleEnhancedPrivacy = () => { setNewSettings((prev) => ({ ...prev, enhancedPrivacy: !newSettings.enhancedPrivacy, })); }; const toggleZap = () => { setNewSettings((prev) => ({ ...prev, zap: !newSettings.zap, })); }; const toggleNsfw = () => { setNewSettings((prev) => ({ ...prev, nsfw: !newSettings.nsfw, })); }; const submit = async () => { try { // start loading setLoading(true); // publish settings const eventId = await NostrQuery.setSettings(newSettings); if (eventId) { return navigate({ to: "/$account/home", params: { account }, replace: true, }); } } catch (e) { setLoading(false); toast.error(e); } }; return (
{t("onboardingSettings.subtitle")}
Lume will display external resources like image, video or link preview as plain text.
Show the Zap button in each note and user's profile screen, use for send Bitcoin tip to other users.
By default, Lume will display all content which have Content Warning tag, it's may include NSFW content.