's'
This commit is contained in:
@@ -14,17 +14,7 @@ type ModalState = {
|
||||
link: NetdiskLink;
|
||||
} | null;
|
||||
|
||||
function BaiduDownloadIcon() {
|
||||
return (
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||
<path d="M12 3v12" />
|
||||
<path d="m7 10 5 5 5-5" />
|
||||
<path d="M21 21H3" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function QuarkDownloadIcon() {
|
||||
function DownloadIcon() {
|
||||
return (
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||
<path d="M12 3v12" />
|
||||
@@ -35,6 +25,7 @@ function QuarkDownloadIcon() {
|
||||
}
|
||||
|
||||
function buildCopyText(resource: NetdiskResource, link: NetdiskLink) {
|
||||
if (link.copyText?.trim()) return link.copyText.trim();
|
||||
const url = link.url?.trim() || "";
|
||||
const code = link.code?.trim() || "";
|
||||
const codeLabel = link.codeLabel || "提取码";
|
||||
@@ -111,29 +102,11 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
||||
{variant === "vip" && isOpen && (
|
||||
<div id={`netdisk-panel-${r.id}`} className={styles.panel} role="region" aria-label={`${r.title} 链接`}>
|
||||
{(() => {
|
||||
const baidu = getLinkByProvider(r, "baidu");
|
||||
const quark = getLinkByProvider(r, "quark");
|
||||
const baiduUrl = baidu?.url?.trim() || "";
|
||||
const quarkUrl = quark?.url?.trim() || "";
|
||||
|
||||
return (
|
||||
<div className={styles.iconRow} aria-label="下载图标">
|
||||
<button
|
||||
type="button"
|
||||
className={`${styles.netdiskIconBtn} ${!baiduUrl ? styles.netdiskIconBtnDisabled : ""}`}
|
||||
onClick={() => {
|
||||
if (!baidu || !baiduUrl) return;
|
||||
setModal({ resource: r, link: baidu });
|
||||
}}
|
||||
disabled={!baiduUrl}
|
||||
aria-disabled={!baiduUrl}
|
||||
title={baiduUrl ? "打开分享链接" : "链接待补充"}
|
||||
>
|
||||
<span className={styles.iconColorBaidu} aria-hidden="true">
|
||||
<BaiduDownloadIcon />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className={`${styles.netdiskIconBtn} ${!quarkUrl ? styles.netdiskIconBtnDisabled : ""}`}
|
||||
@@ -143,10 +116,10 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
||||
}}
|
||||
disabled={!quarkUrl}
|
||||
aria-disabled={!quarkUrl}
|
||||
title={quarkUrl ? "打开分享链接" : "链接待补充"}
|
||||
title={quarkUrl ? "打开夸克网盘分享" : "链接待补充"}
|
||||
>
|
||||
<span className={styles.iconColorQuark} aria-hidden="true">
|
||||
<QuarkDownloadIcon />
|
||||
<DownloadIcon />
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -173,7 +146,7 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
||||
<div className={styles.modalHeader}>
|
||||
<div className={styles.modalTitleRow}>
|
||||
<span className={styles.modalIcon} aria-hidden="true">
|
||||
{modal.link.provider === "baidu" ? <BaiduDownloadIcon /> : <QuarkDownloadIcon />}
|
||||
<DownloadIcon />
|
||||
</span>
|
||||
<div className={styles.modalTitle}>{modal.resource.title}</div>
|
||||
</div>
|
||||
@@ -186,16 +159,8 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
||||
</div>
|
||||
|
||||
<div className={styles.modalBody}>
|
||||
<div className={styles.modalRow}>
|
||||
<div className={styles.modalLabel}>分享链接</div>
|
||||
<div className={styles.modalMono} title={modal.link.url || ""}>
|
||||
{modal.link.url || "链接待补充"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.modalRow}>
|
||||
<div className={styles.modalLabel}>{modal.link.codeLabel || "提取码"}</div>
|
||||
<div className={styles.modalMono}>{modal.link.code?.trim() || "——"}</div>
|
||||
<div className={styles.modalPre} aria-label="网盘分享内容">
|
||||
{buildCopyText(modal.resource, modal.link)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user