diff --git a/client/src/App.tsx b/client/src/App.tsx index 8b5d0c7..c358460 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -8,7 +8,6 @@ import { GamesStore } from "./stores/GamesStore"; import { ipcRenderer } from "electron"; import { Button, - Image, Modal, ModalHeader, ModalBody, @@ -16,12 +15,9 @@ import { ModalContent, Progress, } from "@nextui-org/react"; -import launcherIcon from "./assets/images/ICON_GrayScale.png"; import exportedRoutes from "./routes"; import { SelectLauncherImage } from "./components/images/selectlauncher.component"; -import { toast } from "react-toastify"; -import { FiCheckCircle, FiUserCheck } from "react-icons/fi"; -import { UserStore } from "./stores/UserStore"; +import { FiUserCheck } from "react-icons/fi"; import { observer } from "mobx-react"; import { ThemeStore } from "./stores/ThemeStore"; //#endregion @@ -35,10 +31,6 @@ const AppComp: React.FC = () => { const [verificationModalVisible, setVerificationModalVisible] = React.useState(false); - const closeHandler = () => { - setUpdateModalVisible(false); - }; - //#region Routes const page = useRoutes(exportedRoutes); @@ -93,6 +85,7 @@ const AppComp: React.FC = () => { isDismissable={false} onClose={() => setUpdateModalVisible(false)} isOpen={updateModalVisible} + // isOpen={true} hideCloseButton > @@ -108,17 +101,20 @@ const AppComp: React.FC = () => {

{updateMessage}

-
- -
+ {!updateDownloaded && ( +
+ +
+ )}
{updateDownloaded && ( )} diff --git a/client/src/assets/styles/index.css b/client/src/assets/styles/index.css index f3fdae3..261cca8 100644 --- a/client/src/assets/styles/index.css +++ b/client/src/assets/styles/index.css @@ -18,6 +18,7 @@ --toastify-color-success: #17c964; --toastify-color-warning: #f5a524; --toastify-color-error: #f31260; + --animate-delay: 0.5s; } .Toastify__toast { diff --git a/client/src/components/appbar/appbar-end.component.tsx b/client/src/components/appbar/appbar-end.component.tsx new file mode 100644 index 0000000..47f5328 --- /dev/null +++ b/client/src/components/appbar/appbar-end.component.tsx @@ -0,0 +1,44 @@ +import { Button, Tooltip } from "@nextui-org/react"; +import React, { FC } from "react"; +import { HiCog } from "react-icons/hi"; +import { Link } from "react-router-dom"; +import UserDropdown from "../dropdowns/user/userdropdown.component"; +import { User } from "@/stores/UserStore"; + +interface IProps { + dashboard: boolean; + user: User; + cookies: any; +} + +/** + * @author + * @function @AppbarEnd + **/ + +export const AppbarEnd: FC = ({ dashboard, user, cookies }) => { + return ( +
+ {dashboard && ( +
+ + + + + + +
+ )} +
+ ); +}; diff --git a/client/src/components/appbar/appbar-start.component.tsx b/client/src/components/appbar/appbar-start.component.tsx new file mode 100644 index 0000000..0cc007c --- /dev/null +++ b/client/src/components/appbar/appbar-start.component.tsx @@ -0,0 +1,56 @@ +import { SidebarStore } from "@/stores/SidebarStore"; +import { Button, Tooltip } from "@nextui-org/react"; +import React, { FC } from "react"; +import { FiArrowLeft, FiMenu } from "react-icons/fi"; +import { Link } from "react-router-dom"; +import { SearchInput } from "../search/search-input.component"; +import { observer } from "mobx-react"; + +interface IProps { + isSettings: boolean; + pageName: string; + searchBarVisible: boolean; +} + +/** + * @author + * @function @AppbarStart + **/ + +const AppbarStartComp: FC = ({ + isSettings, + pageName, + searchBarVisible, +}) => { + const { open } = SidebarStore; + + return ( + + ); +}; + +export const AppbarStart = observer(AppbarStartComp); diff --git a/client/src/components/appbar/appbar.component.tsx b/client/src/components/appbar/appbar.component.tsx index f6e7d62..fe147b2 100644 --- a/client/src/components/appbar/appbar.component.tsx +++ b/client/src/components/appbar/appbar.component.tsx @@ -1,6 +1,6 @@ import UserDropdown from "../dropdowns/user/userdropdown.component"; import { getTokensCookie } from "@/utils/storage"; -import { User } from "@/stores/UserStore"; +import { User, UserStore } from "@/stores/UserStore"; import { Badge, Button, Input, Tooltip } from "@nextui-org/react"; import { HiCog } from "react-icons/hi"; import { Link } from "react-router-dom"; @@ -11,6 +11,10 @@ import { SearchStore } from "@/stores/SearchStore"; import { HiBellAlert } from "react-icons/hi2"; import { sendVerificationLink } from "@/handlers/api"; import { useState } from "react"; +import { SearchInput } from "../search/search-input.component"; +import { VerificationBanner } from "./verification-banner.component"; +import { AppbarStart } from "./appbar-start.component"; +import { AppbarEnd } from "./appbar-end.component"; export interface AppBarProps { user?: User; @@ -35,87 +39,25 @@ export const AppBar: React.FC = ({ return ( <> {user && !user?.verified && ( -
- {" "} - - Some features are disabled. Please verify your e-mail to secure - your account. - - -
+ )}
- -
- {dashboard && ( -
- - - - - - -
- )} -
+ + {user && ( + + )}
); diff --git a/client/src/components/appbar/verification-banner.component.tsx b/client/src/components/appbar/verification-banner.component.tsx new file mode 100644 index 0000000..67a5758 --- /dev/null +++ b/client/src/components/appbar/verification-banner.component.tsx @@ -0,0 +1,42 @@ +import { sendVerificationLink } from "@/handlers/api"; +import { User } from "@/stores/UserStore"; +import { Button } from "@nextui-org/react"; +import React, { FC } from "react"; +import { HiBellAlert } from "react-icons/hi2"; + +interface IProps { + user: User; + loading: boolean; + setLoading: any; +} + +/** + * @author + * @function @VerificationBanner + **/ + +export const VerificationBanner: FC = ({ + user, + loading, + setLoading, +}) => { + return ( +
+ {" "} + + Some features are disabled. Please verify your e-mail to secure your + account. + + +
+ ); +}; diff --git a/client/src/components/search/search-input.component.tsx b/client/src/components/search/search-input.component.tsx new file mode 100644 index 0000000..03c96e0 --- /dev/null +++ b/client/src/components/search/search-input.component.tsx @@ -0,0 +1,34 @@ +import { SearchStore, SearchType } from "@/stores/SearchStore"; +import { Input } from "@nextui-org/react"; +import { observer } from "mobx-react"; +import React, { FC } from "react"; + +interface IProps { + searchType: SearchType; +} + +/** + * @author + * @function @SearchInput + **/ + +const SearchInputComp: FC = ({ searchType }) => { + return ( + { + SearchStore.setSearch({ + type: searchType || "game", + query: e.target.value, + }); + }} + className="mr-5" + placeholder="Search..." + value={ + (SearchStore.search.type == searchType || "game") && + SearchStore.search.query + } + /> + ); +}; + +export const SearchInput = observer(SearchInputComp); diff --git a/client/src/components/sidebar/sidebar.component.tsx b/client/src/components/sidebar/sidebar.component.tsx index f4308bc..7f2f7cc 100644 --- a/client/src/components/sidebar/sidebar.component.tsx +++ b/client/src/components/sidebar/sidebar.component.tsx @@ -81,7 +81,7 @@ export const Sidebar: React.FC = ({ active, settings }) => { variants={sidebarVariants} initial={false} animate={SidebarStore.open ? "sidebarOpen" : "sidebarClosed"} - className="bg-content1 mr-10 rounded-tr-xl h-full rounded-br-xl" + className="bg-content1 mr-10 h-full rounded-br-xl" >
diff --git a/client/src/components/titlebar/titlebar.tsx b/client/src/components/titlebar/titlebar.tsx index 603294b..dbabcba 100644 --- a/client/src/components/titlebar/titlebar.tsx +++ b/client/src/components/titlebar/titlebar.tsx @@ -6,7 +6,7 @@ import { FiMaximize, FiMinus, FiX } from "react-icons/fi"; const Titlebar = () => { return ( -