import { useStorage } from "@lume/ark"; import { InfoIcon } from "@lume/icons"; import * as Switch from "@radix-ui/react-switch"; import { isPermissionGranted, requestPermission, } from "@tauri-apps/plugin-notification"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; export function OnboardingScreen() { const storage = useStorage(); const navigate = useNavigate(); const [settings, setSettings] = useState({ autoupdate: false, outbox: false, notification: false, }); const next = () => { if (!storage.account.contacts.length) return navigate("/auth/follow"); return navigate("/auth/finish"); }; const toggleOutbox = async () => { await storage.createSetting("outbox", String(+!settings.outbox)); // update state setSettings((prev) => ({ ...prev, outbox: !settings.outbox })); }; const toggleAutoupdate = async () => { await storage.createSetting("autoupdate", String(+!settings.autoupdate)); // update state setSettings((prev) => ({ ...prev, autoupdate: !settings.autoupdate })); }; const toggleNofitication = async () => { await requestPermission(); // update state setSettings((prev) => ({ ...prev, notification: !settings.notification })); }; useEffect(() => { async function loadSettings() { const permissionGranted = await isPermissionGranted(); setSettings((prev) => ({ ...prev, notification: permissionGranted })); const data = await storage.getAllSettings(); if (!data) return; for (const item of data) { if (item.key === "autoupdate") setSettings((prev) => ({ ...prev, autoupdate: !!parseInt(item.value), })); if (item.key === "outbox") setSettings((prev) => ({ ...prev, outbox: !!parseInt(item.value), })); } } loadSettings(); }, []); return (

You're almost ready to use Lume.

Let's start personalizing your experience.

toggleAutoupdate()} className="relative mt-1 h-7 w-12 shrink-0 cursor-default rounded-full bg-neutral-200 outline-none data-[state=checked]:bg-blue-500 dark:bg-neutral-800" >

Auto check for update on Login

Keep Lume up to date with latest version, always have new features and bug free.

toggleNofitication()} className="relative mt-1 h-7 w-12 shrink-0 cursor-default rounded-full bg-neutral-200 outline-none data-[state=checked]:bg-blue-500 dark:bg-neutral-800" >

Push notification

Enabling push notifications will allow you to receive notifications from Lume directly on your device.

toggleOutbox()} className="relative mt-1 h-7 w-12 shrink-0 cursor-default rounded-full bg-neutral-200 outline-none data-[state=checked]:bg-blue-500 dark:bg-neutral-800" >

Use Gossip model (recommended)

Automatically discover relays to connect based on the preferences of each author.

There are many more settings you can configure from the "Settings" screen. Be sure to visit it later.

); }