From e81f4f6c562d796592fdc58577636eed6c1e2fb6 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Thu, 6 Jul 2023 15:33:06 +0530 Subject: [PATCH] Add remove server --- src/App.jsx | 1 - src/components/appBar/appBar.jsx | 17 +++++++++++++++++ src/components/icons/mdiDelete.jsx | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/components/icons/mdiDelete.jsx diff --git a/src/App.jsx b/src/App.jsx index 67da1df4..2ce2a949 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -397,7 +397,6 @@ function App() { - ); diff --git a/src/components/appBar/appBar.jsx b/src/components/appBar/appBar.jsx index 62e1eee5..a6a605f5 100644 --- a/src/components/appBar/appBar.jsx +++ b/src/components/appBar/appBar.jsx @@ -1,6 +1,8 @@ /** @format */ import { useEffect, useState } from "react"; +import { relaunch } from "@tauri-apps/api/process"; + import MuiAppBar from "@mui/material/AppBar"; import TextField from "@mui/material/TextField"; import IconButton from "@mui/material/IconButton"; @@ -28,6 +30,9 @@ import { MdiCog } from "../icons/mdiCog"; import { MdiInformation } from "../icons/mdiInformation"; import { MdiMenu } from "../icons/mdiMenu"; import { useDrawerStore } from "../../utils/store/drawer"; +import { delServer } from "../../utils/storage/servers"; +import { delUser } from "../../utils/storage/user"; +import { MdiDelete } from "../icons/mdiDelete"; export const AppBar = () => { const navigate = useNavigate(); @@ -196,6 +201,18 @@ export const AppBar = () => { About + { + await delServer(); + await delUser(); + await relaunch(); + }} + > + + + + Remove Server + diff --git a/src/components/icons/mdiDelete.jsx b/src/components/icons/mdiDelete.jsx new file mode 100644 index 00000000..db38d8ce --- /dev/null +++ b/src/components/icons/mdiDelete.jsx @@ -0,0 +1,12 @@ +/** @format */ +import SvgIcon from "@mui/material/SvgIcon"; + +import { mdiDelete } from "@mdi/js"; + +export const MdiDelete = (props) => { + return ( + + + + ); +};