From 9d5766b4110a15bdafff5c76d42720ee69432f4c Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Jun 2023 22:39:26 +0800 Subject: [PATCH] chore: add about dialog --- web/src/components/AboutDialog.tsx | 37 +++++++++++++ web/src/components/Header.tsx | 85 +++++++++++++++++------------- 2 files changed, 86 insertions(+), 36 deletions(-) create mode 100644 web/src/components/AboutDialog.tsx diff --git a/web/src/components/AboutDialog.tsx b/web/src/components/AboutDialog.tsx new file mode 100644 index 0000000..554e507 --- /dev/null +++ b/web/src/components/AboutDialog.tsx @@ -0,0 +1,37 @@ +import { Button, Link, Modal, ModalDialog } from "@mui/joy"; +import Icon from "./Icon"; + +interface Props { + onClose: () => void; +} + +const AboutDialog: React.FC = (props: Props) => { + const { onClose } = props; + + return ( + + +
+ About + +
+
+

+ Shortify is a free and open source project. It is a simple bookmarking tool that allows you + to save your favorite links and access them from anywhere. +

+
+ See more in: + + GitHub + +
+
+
+
+ ); +}; + +export default AboutDialog; diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 159d575..293a335 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -1,56 +1,69 @@ +import { Avatar } from "@mui/joy"; +import { useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import { useAppSelector } from "../stores"; import Icon from "./Icon"; import Dropdown from "./common/Dropdown"; -import { Avatar } from "@mui/joy"; +import AboutDialog from "./AboutDialog"; const Header: React.FC = () => { const navigate = useNavigate(); const user = useAppSelector((state) => state.user).user as User; + const [showAboutDialog, setShowAboutDialog] = useState(false); const handleSignOutButtonClick = async () => { navigate("/auth"); }; return ( -
-
-
- - - Shortify - -
-
- - - {user.nickname} - - - } - actionsClassName="!w-36" - actions={ - <> - - Setting - - - - } - > + } + actionsClassName="!w-36" + actions={ + <> + + Setting + + + + + } + > +
- + + {showAboutDialog && setShowAboutDialog(false)} />} + ); };