import { Text } from "preact-i18n"; import { Sync } from "./panes/Sync"; import { useContext } from "preact/hooks"; import styles from "./Settings.module.scss"; import { LIBRARY_VERSION } from "revolt.js"; import { APP_VERSION } from "../../version"; import { GenericSettings } from "./GenericSettings"; import { Route, useHistory } from "react-router-dom"; import { Bell, Palette, Coffee, Globe, IdCard, LogOut, Sync as SyncIcon, Shield, Vial, User } from "@styled-icons/boxicons-regular"; import { Brush, Megaphone } from "@styled-icons/boxicons-solid"; import { Gitlab } from "@styled-icons/boxicons-logos"; import { GIT_BRANCH, GIT_REVISION, REPO_URL } from "../../revision"; import LineDivider from "../../components/ui/LineDivider"; import RequiresOnline from "../../context/revoltjs/RequiresOnline"; import ButtonItem from "../../components/navigation/items/ButtonItem"; import { AppContext, OperationsContext } from "../../context/revoltjs/RevoltClient"; import { Account } from "./panes/Account"; import { Profile } from "./panes/Profile"; import { Sessions } from "./panes/Sessions"; import { Feedback } from "./panes/Feedback"; import { Languages } from "./panes/Languages"; import { Appearance } from "./panes/Appearance"; import { Notifications } from "./panes/Notifications"; import { ExperimentsPage } from "./panes/Experiments"; 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: }, { 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} API: {client.configuration?.revolt ?? "N/A"} revolt.js: {LIBRARY_VERSION}
]} /> ) }