From 8e7a531d195b949d15565e10eebfe7e906a1f129 Mon Sep 17 00:00:00 2001 From: Game Glide Date: Wed, 20 Mar 2024 11:51:32 +0530 Subject: [PATCH] fix app icons and home page styling progress nextui v2 migration --- client/electron/main/index.ts | 2 +- client/index.html | 2 +- .../dropdowns/user/userdropdown.component.tsx | 57 ++++++++++--------- .../game/card/gamecard.component.tsx | 12 ++-- .../components/sidebar/sidebar.component.tsx | 4 +- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/client/electron/main/index.ts b/client/electron/main/index.ts index d8a8503..04707b3 100644 --- a/client/electron/main/index.ts +++ b/client/electron/main/index.ts @@ -2,7 +2,7 @@ process.env.DIST_ELECTRON = join(__dirname, "../.."); process.env.DIST = join(process.env.DIST_ELECTRON, "../dist"); process.env.PUBLIC = app.isPackaged ? process.env.DIST - : join(process.env.DIST_ELECTRON, "./public"); + : join(process.env.DIST_ELECTRON, "../public"); import { app, BrowserWindow, shell, ipcMain, dialog } from "electron"; import settings from "electron-settings"; diff --git a/client/index.html b/client/index.html index ad57f95..94a8b1c 100644 --- a/client/index.html +++ b/client/index.html @@ -2,7 +2,7 @@ - + = ({ user }) => { return (
- + { + onAction={(key: Key) => { if (key == "logout") { const storedRfToken = localStorage.getItem("refreshToken"); if (storedRfToken && storedRfToken.length) { const refreshToken = JSON.parse(storedRfToken).refreshToken; logout(refreshToken, navigate); } - } else if (key == "verified" && !user?.verified) { + } else if (key.toString() == "verified" && !user?.verified) { sendVerificationLink(user.accessToken); - } else if (key == "profile") { + } else if (key.toString() == "profile") { navigate("/settings/profile"); - } else if (key == "home") { + } else if (key.toString() == "home") { navigate("/"); - } else if (key == "settings") { + } else if (key.toString() == "settings") { navigate("/settings"); - } else if (key == "admindashboard") { + } else if (key.toString() == "admindashboard") { navigate("/admin/dashboard"); } }} @@ -77,31 +78,33 @@ const UserDropdown: React.FC = ({ user }) => { )} - } key="home"> - Home - - } key="profile"> - Profile - - }> - Settings - - {(!user?.verified as Boolean) && ( - } - key="verified" - color="warning" - description="Resend verification link." - > - Not verified + + } key="home"> + Home - )} + } key="profile"> + Profile + + }> + Settings + + {(!user?.verified as Boolean) && ( + } + key="verified" + color="warning" + description="Resend verification link." + > + Not verified + + )} + {(user?.moderator as Boolean) && ( } + startContent={} > Dashboard @@ -111,7 +114,7 @@ const UserDropdown: React.FC = ({ user }) => { } + startContent={} > Logout diff --git a/client/src/components/game/card/gamecard.component.tsx b/client/src/components/game/card/gamecard.component.tsx index b82d86f..7290c66 100644 --- a/client/src/components/game/card/gamecard.component.tsx +++ b/client/src/components/game/card/gamecard.component.tsx @@ -81,7 +81,7 @@ export const GameCard: React.FC = ({ game }) => {
-

+

{game.name} {game.verified && ( @@ -98,7 +98,7 @@ export const GameCard: React.FC = ({ game }) => { )}

-
+
{game.tags.map((tag, i) => ( = ({ game }) => {
-

+

{game.description}

{downloadStatus.gameName === game.downloadName && ( - +

{downloadStatus.msg}

{downloadStatus.percentage && downloadStatus.percentage > 0 && ( = ({ game }) => { value={Number(Number(downloadStatus.percentage).toFixed(0))} /> )} -

+

{downloadStatus.percentage && downloadStatus.percentage > 0 && Number((downloadStatus.remainingSize || 0) / 1e6).toFixed(1) + @@ -177,7 +177,7 @@ export const GameCard: React.FC = ({ game }) => { startContent={} size="md" color="primary" - className="ml-2 shadow-md w-auto" + className="ml-2 shadow-md w-auto font-bold" onPressEnd={() => { window.gamesAPI.downloadGame(game.downloadName); ipcRenderer.once("finish-download", (event, message) => { diff --git a/client/src/components/sidebar/sidebar.component.tsx b/client/src/components/sidebar/sidebar.component.tsx index 3b81962..5e31adf 100644 --- a/client/src/components/sidebar/sidebar.component.tsx +++ b/client/src/components/sidebar/sidebar.component.tsx @@ -86,8 +86,8 @@ const SidebarComp: React.FC = ({ active, settings }) => {