feat: display extra auth details along with downdload links
All checks were successful
Release to Staging / build_and_release (push) Successful in 42s

This commit is contained in:
daniyal 2024-08-14 12:08:58 +05:00
parent 7fa59d6a52
commit 6acf4c3028

View File

@ -22,7 +22,7 @@ import '../styles/styles.css'
import '../styles/tabs.css' import '../styles/tabs.css'
import '../styles/tags.css' import '../styles/tags.css'
import '../styles/write.css' import '../styles/write.css'
import { ModDetails, PaymentRequest } from '../types' import { DownloadUrl, ModDetails, PaymentRequest } from '../types'
import { import {
abbreviateNumber, abbreviateNumber,
copyTextToClipboard, copyTextToClipboard,
@ -134,7 +134,7 @@ export const InnerModPage = () => {
<h4 className='IBMSMSMBSSDownloadsTitle'>Mod Download</h4> <h4 className='IBMSMSMBSSDownloadsTitle'>Mod Download</h4>
{modData.downloadUrls.length > 0 && ( {modData.downloadUrls.length > 0 && (
<div className='IBMSMSMBSSDownloadsPrime'> <div className='IBMSMSMBSSDownloadsPrime'>
<Download url={modData.downloadUrls[0].url} /> <Download {...modData.downloadUrls[0]} />
</div> </div>
)} )}
{modData.downloadUrls.length > 1 && ( {modData.downloadUrls.length > 1 && (
@ -160,7 +160,7 @@ export const InnerModPage = () => {
.map((download, index) => ( .map((download, index) => (
<Download <Download
key={`downloadUrl-${index}`} key={`downloadUrl-${index}`}
url={download.url} {...download}
/> />
))} ))}
</div> </div>
@ -566,11 +566,16 @@ const PublishDetails = ({
) )
} }
type DownloadProps = { const Download = ({
url: string url,
} hash,
signatureKey,
malwareScanLink,
modVersion,
customNote
}: DownloadUrl) => {
const [showAuthDetails, setShowAuthDetails] = useState(false)
const Download = ({ url }: DownloadProps) => {
const handleDownload = () => { const handleDownload = () => {
// Get the filename from the URL // Get the filename from the URL
const filename = getFilenameFromUrl(url) const filename = getFilenameFromUrl(url)
@ -754,6 +759,58 @@ const Download = ({ url }: DownloadProps) => {
</div> </div>
</div> </div>
</div> </div>
<div className='IBMSMSMBSSDownloadsElementInside IBMSMSMBSSDownloadsElementInsideAlt'>
<p
className='IBMSMSMBSSDownloadsElementInsideAltText'
onClick={() => setShowAuthDetails((prev) => !prev)}
>
Authentication Details
</p>
{showAuthDetails && (
<div className='IBMSMSMBSSDownloadsElementInsideAltTable'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRow'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol IBMSMSMBSSDownloadsElementInsideAltTableRowColFirst'>
<p>SHA-256 hash</p>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol'>
<p>{hash}</p>
</div>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRow'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol IBMSMSMBSSDownloadsElementInsideAltTableRowColFirst'>
<p>Signature from</p>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol'>
<p>{signatureKey}</p>
</div>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRow'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol IBMSMSMBSSDownloadsElementInsideAltTableRowColFirst'>
<p>Scan</p>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol'>
<p>{malwareScanLink}</p>
</div>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRow'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol IBMSMSMBSSDownloadsElementInsideAltTableRowColFirst'>
<p>Mod Version</p>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol'>
<p>{modVersion}</p>
</div>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRow'>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol IBMSMSMBSSDownloadsElementInsideAltTableRowColFirst'>
<p>Note</p>
</div>
<div className='IBMSMSMBSSDownloadsElementInsideAltTableRowCol'>
<p>{customNote}</p>
</div>
</div>
</div>
)}
</div>
</div> </div>
) )
} }