fix(home,settings): updated homepage, settings

* new home screen
* cleaned up settings
This commit is contained in:
trashtemp
2021-12-23 18:21:42 +01:00
committed by Paul Makles
parent 73d99e4518
commit d2d7083542
9 changed files with 238 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
import { Chrome, Android, Apple, Windows } from "@styled-icons/boxicons-logos";
import { HelpCircle, Desktop } from "@styled-icons/boxicons-regular";
import { HelpCircle, Desktop, LogOut } from "@styled-icons/boxicons-regular";
import {
Safari,
Firefoxbrowser,
@@ -24,6 +24,7 @@ import { AppContext } from "../../../context/revoltjs/RevoltClient";
import Button from "../../../components/ui/Button";
import Preloader from "../../../components/ui/Preloader";
import Tip from "../../../components/ui/Tip";
import CategoryButton from "../../../components/ui/fluent/CategoryButton";
dayjs.extend(relativeTime);
@@ -207,7 +208,7 @@ export function Sessions() {
</div>
);
})}
<Button
{/*<Button
error
onClick={async () => {
// ! FIXME: add to rAuth
@@ -230,7 +231,37 @@ export function Sessions() {
setSessions(sessions.filter((x) => x._id === deviceId));
}}>
<Text id="app.settings.pages.sessions.logout" />
</Button>
</Button>*/}
<CategoryButton
onClick={async () => {
// ! FIXME: add to rAuth
const del: string[] = [];
render.forEach((session) => {
if (deviceId !== session._id) {
del.push(session._id);
}
});
setDelete(del);
for (const id of del) {
await client.req(
"DELETE",
`/auth/session/${id}` as "/auth/session/id",
);
}
setSessions(sessions.filter((x) => x._id === deviceId));
}}
icon={<LogOut size={24} color={"var(--error)"} />}
action={"chevron"}
description={
"Logs you out of all sessions except this device."
}>
<Text id="app.settings.pages.sessions.logout" />
</CategoryButton>
<Tip>
<span>
<Text id="app.settings.tips.sessions.a" />