From 3f141ed58b609736bbaabcca891f174882c57391 Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 21 Jan 2025 15:47:05 +0100 Subject: [PATCH] feat(download): add title and remove show more links --- src/components/ModForm.tsx | 24 ++++++++++++++ src/pages/mod/index.tsx | 64 +++++++++----------------------------- src/types/mod.ts | 1 + 3 files changed, 39 insertions(+), 50 deletions(-) diff --git a/src/components/ModForm.tsx b/src/components/ModForm.tsx index b9a476f..1d17a72 100644 --- a/src/components/ModForm.tsx +++ b/src/components/ModForm.tsx @@ -524,6 +524,7 @@ export const ModForm = () => { type DownloadUrlFieldsProps = { index: number url: string + title?: string hash: string signatureKey: string malwareScanLink: string @@ -537,6 +538,7 @@ const DownloadUrlFields = React.memo( ({ index, url, + title, hash, signatureKey, malwareScanLink, @@ -579,6 +581,28 @@ const DownloadUrlFields = React.memo( +
+
+ + + +
+ +
+
{ const [commentCount, setCommentCount] = useState(0) - const oldDownloadListRef = useRef(null) - - const handleViewOldLinks = () => { - if (oldDownloadListRef.current) { - // Toggle styles - if (oldDownloadListRef.current.style.height === '0px') { - // Enable styles - oldDownloadListRef.current.style.padding = '' - oldDownloadListRef.current.style.height = '' - oldDownloadListRef.current.style.border = '' - } else { - // Disable styles - oldDownloadListRef.current.style.padding = '0' - oldDownloadListRef.current.style.height = '0' - oldDownloadListRef.current.style.border = 'unset' - } - } - } - return ( <> @@ -136,37 +117,16 @@ export const ModPage = () => {
)} {mod.downloadUrls.length > 1 && ( - <> -
- -
-
- {mod.downloadUrls - .slice(1) - .map((download, index) => ( - - ))} -
- +
+ {mod.downloadUrls + .slice(1) + .map((download, index) => ( + + ))} +
)}
@@ -608,6 +568,7 @@ const Body = ({ const Download = ({ url, + title, hash, signatureKey, malwareScanLink, @@ -645,6 +606,9 @@ const Download = ({ return (
+ {typeof title !== 'undefined' && title !== '' && ( + {title} + )}