Skip to content

Commit

Permalink
Add remove server
Browse files Browse the repository at this point in the history
  • Loading branch information
prayag17 committed Jul 6, 2023
1 parent fea68f8 commit e81f4f6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ function App() {
</Routes>
</div>
</AnimatePresence>
<ReactQueryDevtools position="top-right" />
</ThemeProvider>
</SnackbarProvider>
);
Expand Down
17 changes: 17 additions & 0 deletions src/components/appBar/appBar.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -196,6 +201,18 @@ export const AppBar = () => {
</ListItemIcon>
About
</MenuItem>
<MenuItem
onClick={async () => {
await delServer();
await delUser();
await relaunch();
}}
>
<ListItemIcon>
<MdiDelete />
</ListItemIcon>
Remove Server
</MenuItem>
</Menu>
</Box>
</Toolbar>
Expand Down
12 changes: 12 additions & 0 deletions src/components/icons/mdiDelete.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";

import { mdiDelete } from "@mdi/js";

export const MdiDelete = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiDelete}></path>
</SvgIcon>
);
};

0 comments on commit e81f4f6

Please sign in to comment.