From 36adf231a8946cc474203c7f5890edc2d8463e79 Mon Sep 17 00:00:00 2001 From: Matthew Callens Date: Thu, 6 Apr 2023 14:33:16 -0400 Subject: [PATCH] add xnft library link button to apps page (#3629) --- .../src/components/Unlocked/Apps/index.tsx | 77 +++++++++++++------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/packages/app-extension/src/components/Unlocked/Apps/index.tsx b/packages/app-extension/src/components/Unlocked/Apps/index.tsx index 298d7bc3d..8697db3d3 100644 --- a/packages/app-extension/src/components/Unlocked/Apps/index.tsx +++ b/packages/app-extension/src/components/Unlocked/Apps/index.tsx @@ -1,3 +1,4 @@ +import type { CSSProperties } from "react"; import { Blockchain, XNFT_GG_LINK } from "@coral-xyz/common"; import { EmptyState, @@ -169,9 +170,7 @@ function WalletXnftGrid({ [wallet] ); - return !isLoading && plugins.length === 0 ? ( - <> - ) : ( + return !isLoading && plugins.length === 0 ? null : (
- {showContent ?
- - {isLoading - ? Array.from(Array(iconsPerRow).keys()).map((_, idx) => { - return ( - = iconsPerRow ? "24px" : 0, - }} - > - - - ); - }) - : plugins.map((p: any, idx: number) => { + + {isLoading ? ( + Array.from(Array(iconsPerRow).keys()).map((_, idx) => { + return ( + = iconsPerRow ? "24px" : 0, + }} + > + + + ); + }) + ) : ( + <> + + {plugins.map((p: any, idx: number) => { return ( = iconsPerRow ? "24px" : 0, + marginTop: idx + 1 >= iconsPerRow ? "24px" : 0, }} > onClickPlugin(p)} /> ); })} - -
: null} + + )} + +
+ ) : null} ); } +function LibraryLink({ isXs }: { isXs: boolean }) { + const theme = useCustomTheme(); + + return ( + + window.open("https://xnft.gg", "_blank")} + /> + + ); +} + function PluginIcon({ plugin, onClick }: any) { return ( @@ -268,10 +292,12 @@ function PluginIcon({ plugin, onClick }: any) { function AppIcon({ title, + iconStyle, iconUrl, onClick, }: { title: string; + iconStyle?: CSSProperties; iconUrl: string; onClick: () => void; }) { @@ -302,6 +328,7 @@ function AppIcon({ style={{ width: ICON_WIDTH, height: ICON_WIDTH, + ...(iconStyle ?? {}), }} />