From bec51a07bb179fe9beef13794f48a6dfcb9d852e Mon Sep 17 00:00:00 2001 From: PhilReact Date: Tue, 22 Oct 2024 20:12:54 +0300 Subject: [PATCH] finished desktop view --- public/appsBg.svg | 9 + src/App.tsx | 19 +- src/assets/svgs/AppIcon.svg | 11 + src/assets/svgs/qappLibraryText.svg | 4 + src/background.ts | 2 +- src/components/Apps/AppInfo.tsx | 56 ++- src/components/Apps/AppPublish.tsx | 12 +- src/components/Apps/AppViewer.tsx | 4 +- src/components/Apps/AppViewerContainer.tsx | 4 +- src/components/Apps/AppsCategoryDesktop.tsx | 223 +++++++++ src/components/Apps/AppsDesktop-styles.tsx | 24 + src/components/Apps/AppsDesktop.tsx | 429 +++++++++++++++++ src/components/Apps/AppsHomeDesktop.tsx | 39 ++ src/components/Apps/AppsLibraryDesktop.tsx | 411 +++++++++++++++++ src/components/Apps/AppsNavBarDesktop.tsx | 347 ++++++++++++++ src/components/Apps/SortablePinnedApps.tsx | 11 +- src/components/Desktop/DesktopFooter.tsx | 143 ++++-- src/components/Group/Group.tsx | 481 +++----------------- src/components/Save/Save.tsx | 18 +- src/index.css | 6 +- src/useAppFullscreen.tsx | 2 + 21 files changed, 1747 insertions(+), 508 deletions(-) create mode 100644 public/appsBg.svg create mode 100644 src/assets/svgs/AppIcon.svg create mode 100644 src/assets/svgs/qappLibraryText.svg create mode 100644 src/components/Apps/AppsCategoryDesktop.tsx create mode 100644 src/components/Apps/AppsDesktop-styles.tsx create mode 100644 src/components/Apps/AppsDesktop.tsx create mode 100644 src/components/Apps/AppsHomeDesktop.tsx create mode 100644 src/components/Apps/AppsLibraryDesktop.tsx create mode 100644 src/components/Apps/AppsNavBarDesktop.tsx diff --git a/public/appsBg.svg b/public/appsBg.svg new file mode 100644 index 0000000..9775d89 --- /dev/null +++ b/public/appsBg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/App.tsx b/src/App.tsx index ac3631c..b459070 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -146,7 +146,7 @@ const defaultValues: MyContextInterface = { message: "", }, }; -export let isMobile = true; +export let isMobile = false; const isMobileDevice = () => { const userAgent = navigator.userAgent || navigator.vendor || window.opera; @@ -240,7 +240,7 @@ export const getBaseApiReact = (customApi?: string) => { // }; export const getArbitraryEndpointReact = () => { if (globalApiKey) { - return `/arbitrary/resources/search`; + return `/arbitrary/resources/searchsimple`; } else { return `/arbitrary/resources/searchsimple`; } @@ -259,6 +259,8 @@ export const getBaseApiReactSocket = (customApi?: string) => { export const isMainWindow = window?.location?.href?.includes("?main=true"); function App() { const [extState, setExtstate] = useState("not-authenticated"); + const [desktopViewMode, setDesktopViewMode] = useState('home') + const [backupjson, setBackupjson] = useState(null); const [rawWallet, setRawWallet] = useState(null); const [ltcBalanceLoading, setLtcBalanceLoading] = useState(false); @@ -1554,12 +1556,13 @@ function App() { - {/* {extState === 'group' && ( - - )} */} - + {extState === "not-authenticated" && ( <> @@ -1780,8 +1783,10 @@ function App() { isMain={isMain} isOpenDrawerProfile={isOpenDrawerProfile} setIsOpenDrawerProfile={setIsOpenDrawerProfile} + desktopViewMode={desktopViewMode} + setDesktopViewMode={setDesktopViewMode} /> - {!isMobile && renderProfile()} + {(!isMobile && desktopViewMode !== 'apps') && renderProfile()} + + + + + + + + + + diff --git a/src/assets/svgs/qappLibraryText.svg b/src/assets/svgs/qappLibraryText.svg new file mode 100644 index 0000000..297c466 --- /dev/null +++ b/src/assets/svgs/qappLibraryText.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/background.ts b/src/background.ts index 8d3fdf0..e2d7b2b 100644 --- a/src/background.ts +++ b/src/background.ts @@ -117,7 +117,7 @@ const getApiKeyFromStorage = async () => { const getArbitraryEndpoint = async () => { const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously if (apiKey) { - return `/arbitrary/resources/search`; + return `/arbitrary/resources/searchsimple`; } else { return `/arbitrary/resources/searchsimple`; } diff --git a/src/components/Apps/AppInfo.tsx b/src/components/Apps/AppInfo.tsx index 615965b..3a3c687 100644 --- a/src/components/Apps/AppInfo.tsx +++ b/src/components/Apps/AppInfo.tsx @@ -22,7 +22,7 @@ import { } from "./Apps-styles"; import { Avatar, Box, ButtonBase, InputBase } from "@mui/material"; import { Add } from "@mui/icons-material"; -import { getBaseApiReact } from "../../App"; +import { getBaseApiReact, isMobile } from "../../App"; import LogoSelected from "../../assets/svgs/LogoSelected.svg"; import { Spacer } from "../../common/Spacer"; @@ -32,7 +32,21 @@ import { AppRating } from "./AppRating"; export const AppInfo = ({ app, myName }) => { const isInstalled = app?.status?.status === "READY"; return ( - + + + + + {!isMobile && } { - - - - - - - - - Category: - - - {app?.metadata?.categoryName || "none"} - - - - - - About this Q-App - + + + + + + + + Category: + + + {app?.metadata?.categoryName || "none"} + + + + + About this Q-App - {app?.metadata?.description || "No description"} + {app?.metadata?.description || "No description"} + ); }; diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 117aff2..22534bd 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -39,7 +39,7 @@ import { Option as BaseOption, optionClasses } from "@mui/base/Option"; import { styled } from "@mui/system"; import UnfoldMoreRoundedIcon from "@mui/icons-material/UnfoldMoreRounded"; import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact } from "../../App"; +import { MyContext, getBaseApiReact, isMobile } from "../../App"; import LogoSelected from "../../assets/svgs/LogoSelected.svg"; import { Spacer } from "../../common/Spacer"; @@ -257,8 +257,14 @@ export const AppPublish = ({ names, categories }) => { } }; return ( - - + + Create Apps! diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index ba371ae..8fa14bb 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -16,7 +16,7 @@ import { } from "./Apps-styles"; import { Avatar, Box, ButtonBase, InputBase } from "@mui/material"; import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact } from "../../App"; +import { MyContext, getBaseApiReact, isMobile } from "../../App"; import LogoSelected from "../../assets/svgs/LogoSelected.svg"; import { Spacer } from "../../common/Spacer"; @@ -61,7 +61,7 @@ export const AppViewer = ({ app }) => { return (