From f5282721b56592fbdd826ae2faa59c79dd9dc975 Mon Sep 17 00:00:00 2001 From: chloe <44501120+chloezxyy@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:16:13 +0800 Subject: [PATCH] feat(ui-ux): hover ux on card --- .../locales/en-US/page-explore-wallets.json | 3 +- src/components/commons/Buttons.tsx | 9 +- .../_components/DownloadAssetsCard.tsx | 82 ++++++------ .../_components/VisualAssetsSection.tsx | 123 ++++++++++-------- 4 files changed, 123 insertions(+), 94 deletions(-) diff --git a/public/locales/en-US/page-explore-wallets.json b/public/locales/en-US/page-explore-wallets.json index 9ccaa8f00..2a6c9935f 100644 --- a/public/locales/en-US/page-explore-wallets.json +++ b/public/locales/en-US/page-explore-wallets.json @@ -55,7 +55,8 @@ "title": "DFI 3D Coin", "desc": "3D asset for illustration purposes" } - } + }, + "button": "Download .zipped files" }, "advanceUseSection": { "sectionTitle": "SUITABLE FOR ADVANCE USAGE", diff --git a/src/components/commons/Buttons.tsx b/src/components/commons/Buttons.tsx index a490aa9da..741375464 100644 --- a/src/components/commons/Buttons.tsx +++ b/src/components/commons/Buttons.tsx @@ -88,6 +88,8 @@ export function SecondaryButton({ customSize, customClass, testID, + hasIcon = true, + download = false, }: { text: string; className?: string; @@ -97,6 +99,8 @@ export function SecondaryButton({ customClass?: string; customSize?: number; testID: string; + hasIcon: boolean; + download?: boolean; }) { const size = customSize ?? 20; const customClassName = customClass ?? "ml-[15px]"; @@ -107,6 +111,7 @@ export function SecondaryButton({ href={href} className={classNames("block w-fit", { "pointer-events-none": disabled })} data-testid={`secondary-button-${testID}`} + download={download} > ); diff --git a/src/pages/explore/wallets/_components/DownloadAssetsCard.tsx b/src/pages/explore/wallets/_components/DownloadAssetsCard.tsx index 79457aa0e..c8d0027d4 100644 --- a/src/pages/explore/wallets/_components/DownloadAssetsCard.tsx +++ b/src/pages/explore/wallets/_components/DownloadAssetsCard.tsx @@ -24,49 +24,51 @@ export function DownloadAssetsCard( children, } = props; return ( -
+
-
- {/* Image */} -
- {children} -
-
-
-
-

- {title} -

-
- {desc} + > +
+ {/* Image */} +
+ {children}
-
- - - SVG - - - - PNG - +
+
+

+ {title} +

+
+ {desc} +
+
+
+ + + SVG + + + + PNG + +
diff --git a/src/pages/explore/wallets/_components/VisualAssetsSection.tsx b/src/pages/explore/wallets/_components/VisualAssetsSection.tsx index 632268282..91d58ca6d 100644 --- a/src/pages/explore/wallets/_components/VisualAssetsSection.tsx +++ b/src/pages/explore/wallets/_components/VisualAssetsSection.tsx @@ -7,11 +7,16 @@ import PoweredByDeFiChainLogo from "@components/icons/assets/downloadAssets/Powe import DeFiChainAsset from "@components/icons/assets/downloadAssets/DeFiChainAsset"; import BTCDFILogo from "@components/icons/assets/downloadAssets/BTCDFILogo"; import DFI3D from "@components/icons/assets/downloadAssets/DFI3D"; +import { SecondaryButton } from "@components/commons/Buttons"; +import { useWindowDimensions } from "@hooks/useWindowDimensions"; import { DownloadAssetsCard } from "./DownloadAssetsCard"; export function VisualAssetsSection() { const { t } = useTranslation(["page-explore-wallets"]); + const dimension = useWindowDimensions(); + const mobileView = dimension.width <= 800; + return (
@@ -43,62 +48,76 @@ export function VisualAssetsSection() {

-
- - - +
+ {/* Download cards */} +
+ + + - - - + + + - - - + + + - - - + + + - - - + + + +
+ +