Add platform icons to publish progress bars

This commit is contained in:
CPTProgrammer
2026-07-16 15:22:06 +08:00
parent 7bb932910a
commit 95a3900aec
3 changed files with 47 additions and 34 deletions
+45 -32
View File
@@ -11,6 +11,7 @@ import {
Select,
Row,
Col,
Flex,
Progress,
Typography,
Empty,
@@ -364,38 +365,50 @@ export function PublishModal({
<div>
{/* Progress bars */}
<div style={{ marginBottom: token.marginLG }}>
{hasModrinth && (
<div style={{ marginBottom: token.marginSM }}>
<Text>Modrinth: </Text>
<Progress
percent={Math.round(
(progress.modrinth.done /
Math.max(progress.modrinth.total, 1)) *
100,
)}
format={() =>
`${progress.modrinth.done} / ${progress.modrinth.total}`
}
style={{ width: "80%" }}
/>
</div>
)}
{hasCurseforge && (
<div>
<Text>CurseForge: </Text>
<Progress
percent={Math.round(
(progress.curseforge.done /
Math.max(progress.curseforge.total, 1)) *
100,
)}
format={() =>
`${progress.curseforge.done} / ${progress.curseforge.total}`
}
style={{ width: "80%" }}
/>
</div>
)}
<Flex vertical gap={token.marginSM}>
{hasModrinth && (
<Flex align="center" gap={token.marginXS}>
<img
src="/platform/modrinth.svg"
alt="Modrinth"
style={{ width: 30, height: 30, flexShrink: 0 }}
/>
<Text style={{ width: 80, flexShrink: 0, fontFamily: "Inter", fontWeight: "bold" }}>Modrinth</Text>
<Progress
percent={Math.round(
(progress.modrinth.done /
Math.max(progress.modrinth.total, 1)) *
100,
)}
format={() =>
`${progress.modrinth.done} / ${progress.modrinth.total}`
}
style={{ flex: 1 }}
/>
</Flex>
)}
{hasCurseforge && (
<Flex align="center" gap={token.marginXS}>
<img
src="/platform/curseforge.svg"
alt="CurseForge"
style={{ width: 30, height: 30, flexShrink: 0 }}
/>
<Text style={{ width: 80, flexShrink: 0, fontFamily: "Inter", fontWeight: "bold" }}>CurseForge</Text>
<Progress
percent={Math.round(
(progress.curseforge.done /
Math.max(progress.curseforge.total, 1)) *
100,
)}
format={() =>
`${progress.curseforge.done} / ${progress.curseforge.total}`
}
style={{ flex: 1 }}
/>
</Flex>
)}
</Flex>
</div>
{/* Result */}