import { Gitlab } from "@styled-icons/boxicons-logos"; import { Sync as SyncIcon, Globe, LogOut, Desktop, } from "@styled-icons/boxicons-regular"; import { Bell, Palette, Coffee, IdCard, CheckShield, Flask, User, Megaphone, } from "@styled-icons/boxicons-solid"; import { Route, Switch, useHistory } from "react-router-dom"; import { LIBRARY_VERSION } from "revolt.js"; import styles from "./Settings.module.scss"; import { Text } from "preact-i18n"; import { useContext } from "preact/hooks"; import RequiresOnline from "../../context/revoltjs/RequiresOnline"; import { AppContext, OperationsContext, } from "../../context/revoltjs/RevoltClient"; import LineDivider from "../../components/ui/LineDivider"; import ButtonItem from "../../components/navigation/items/ButtonItem"; import { GIT_BRANCH, GIT_REVISION, REPO_URL } from "../../revision"; import { APP_VERSION } from "../../version"; import { GenericSettings } from "./GenericSettings"; import { Account } from "./panes/Account"; import { Appearance } from "./panes/Appearance"; import { ExperimentsPage } from "./panes/Experiments"; import { Feedback } from "./panes/Feedback"; import { Languages } from "./panes/Languages"; import { Native } from "./panes/Native"; import { Notifications } from "./panes/Notifications"; import { Profile } from "./panes/Profile"; import { Sessions } from "./panes/Sessions"; import { Sync } from "./panes/Sync"; export default function Settings() { const history = useHistory(); const client = useContext(AppContext); const operations = useContext(OperationsContext); function switchPage(to?: string) { if (to) { history.replace(`/settings/${to}`); } else { history.replace(`/settings`); } } return ( ), id: "account", icon: , title: , }, { id: "profile", icon: , title: , }, { id: "sessions", icon: , title: , }, { category: ( ), id: "appearance", icon: , title: , }, { id: "notifications", icon: , title: , }, { id: "language", icon: , title: , }, { id: "sync", icon: , title: , }, { id: "native", hidden: !window.isNative, icon: , title: , }, { divider: true, id: "experiments", icon: , title: , }, { id: "feedback", icon: , title: , }, ]} children={ } defaultPage="account" switchPage={switchPage} category="pages" custom={ <> operations.logout()} className={styles.logOut} compact>
{GIT_REVISION.substr(0, 7)} {` `} ({GIT_BRANCH}) {GIT_BRANCH === "production" ? "Stable" : "Nightly"}{" "} {APP_VERSION} {window.isNative && ( Native: {window.nativeVersion} )} API: {client.configuration?.revolt ?? "N/A"} revolt.js: {LIBRARY_VERSION}
} /> ); }