diff --git a/index.html b/index.html index 9bef75d3..70ebae87 100644 --- a/index.html +++ b/index.html @@ -1,37 +1,82 @@ - - - Revolt - + + + Revolt + - - - + + - - - + + + - - - - - - - - - - - - - -
- - - - \ No newline at end of file + + + + + + + + + + + + + +
+ + + + diff --git a/src/pages/settings/GenericSettings.tsx b/src/pages/settings/GenericSettings.tsx index b9c9f546..c2b0dfee 100644 --- a/src/pages/settings/GenericSettings.tsx +++ b/src/pages/settings/GenericSettings.tsx @@ -3,8 +3,9 @@ import { Helmet } from "react-helmet"; import { Switch, useHistory, useParams } from "react-router-dom"; import styles from "./Settings.module.scss"; +import classNames from "classnames"; import { Text } from "preact-i18n"; -import { useContext, useEffect } from "preact/hooks"; +import { useContext, useEffect, useState } from "preact/hooks"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; @@ -25,6 +26,7 @@ interface Props { id: string; icon: Children; title: Children; + hidden?: boolean; hideTitle?: boolean; }[]; custom?: Children; @@ -48,9 +50,14 @@ export function GenericSettings({ const theme = useContext(ThemeContext); const { page } = useParams<{ page: string }>(); + const [closing, setClosing] = useState(false); function exitSettings() { - if (history.length > 0) { - history.goBack(); + if (history.length > 1) { + setClosing(true); + + setTimeout(() => { + history.goBack(); + }, 100); } else { history.push("/"); } @@ -68,7 +75,12 @@ export function GenericSettings({ }, []); return ( -
+
- {pages.map((entry, i) => ( - <> - {entry.category && ( - - )} - switchPage(entry.id)} - compact> - {entry.icon} {entry.title} - - {entry.divider && } - - ))} + {pages.map((entry, i) => + entry.hidden ? undefined : ( + <> + {entry.category && ( + + )} + switchPage(entry.id)} + compact> + {entry.icon} {entry.title} + + {entry.divider && } + + ), + )} {custom}
diff --git a/src/pages/settings/Settings.module.scss b/src/pages/settings/Settings.module.scss index b34ddd97..7dc73b2f 100644 --- a/src/pages/settings/Settings.module.scss +++ b/src/pages/settings/Settings.module.scss @@ -69,6 +69,10 @@ height: 100%; position: fixed; animation: open 0.18s ease-out, opacity 0.18s; + + &.closing { + animation: close 0.18s ease-in; + } } .settings { diff --git a/src/pages/settings/Settings.tsx b/src/pages/settings/Settings.tsx index c5911dd4..01c6e500 100644 --- a/src/pages/settings/Settings.tsx +++ b/src/pages/settings/Settings.tsx @@ -104,6 +104,7 @@ export default function Settings() { }, { id: "native", + hidden: !window.isNative, icon: , title: , }, @@ -140,11 +141,9 @@ export default function Settings() { , - window.isNative && ( - - - - ), + + + , ,