From 6acf4c3028ec99b7115358b774ba165020fadec2 Mon Sep 17 00:00:00 2001 From: daniyal Date: Wed, 14 Aug 2024 12:08:58 +0500 Subject: [PATCH] feat: display extra auth details along with downdload links --- src/pages/innerMod.tsx | 71 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/src/pages/innerMod.tsx b/src/pages/innerMod.tsx index 30720df..bec80b1 100644 --- a/src/pages/innerMod.tsx +++ b/src/pages/innerMod.tsx @@ -22,7 +22,7 @@ import '../styles/styles.css' import '../styles/tabs.css' import '../styles/tags.css' import '../styles/write.css' -import { ModDetails, PaymentRequest } from '../types' +import { DownloadUrl, ModDetails, PaymentRequest } from '../types' import { abbreviateNumber, copyTextToClipboard, @@ -134,7 +134,7 @@ export const InnerModPage = () => {

Mod Download

{modData.downloadUrls.length > 0 && (
- +
)} {modData.downloadUrls.length > 1 && ( @@ -160,7 +160,7 @@ export const InnerModPage = () => { .map((download, index) => ( ))} @@ -566,11 +566,16 @@ const PublishDetails = ({ ) } -type DownloadProps = { - url: string -} +const Download = ({ + url, + hash, + signatureKey, + malwareScanLink, + modVersion, + customNote +}: DownloadUrl) => { + const [showAuthDetails, setShowAuthDetails] = useState(false) -const Download = ({ url }: DownloadProps) => { const handleDownload = () => { // Get the filename from the URL const filename = getFilenameFromUrl(url) @@ -754,6 +759,58 @@ const Download = ({ url }: DownloadProps) => { +
+

setShowAuthDetails((prev) => !prev)} + > + Authentication Details +

+ {showAuthDetails && ( +
+
+
+

SHA-256 hash

+
+
+

{hash}

+
+
+
+
+

Signature from

+
+
+

{signatureKey}

+
+
+
+
+

Scan

+
+
+

{malwareScanLink}

+
+
+
+
+

Mod Version

+
+
+

{modVersion}

+
+
+
+
+

Note

+
+
+

{customNote}

+
+
+
+ )} +
) }