Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3094 from cardano-foundation/fix/update-logic-dis…
Browse files Browse the repository at this point in the history
…play-status-epoch

fix: update logic display status epoch
  • Loading branch information
Sotatek-TaiTruong authored Mar 1, 2024
2 parents 9450b1b + ccd7a2c commit 0692884
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/components/commons/Epoch/FirstEpoch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,35 @@ export default function FirstEpoch({ data: currentEpochData, onClick }: IProps)
icon: ExchangeIcon,
hideHeader: true,
title: (
<EpochNumber>
<EpochNumber sx={{ mt: `${currentEpochData?.status === "SYNCING" ? "30px" : ""}` }}>
<Box component={"span"}>{currentEpochData?.no}</Box>
</EpochNumber>
),
value: (
<Box display={"flex"} alignItems="center" justifyContent={"center"}>
<ProgressCircle
size={100}
pathLineCap="butt"
pathWidth={6}
trailWidth={6}
percent={Number(progress)}
trailOpacity={1}
>
<EpochProgress
status={currentEpochData?.status as keyof typeof EPOCH_STATUS}
>{`${progress}%`}</EpochProgress>
<Status status={currentEpochData?.status as keyof typeof EPOCH_STATUS}>
{EPOCH_STATUS_MAPPING[EPOCH_STATUS[currentEpochData?.status]]}
</Status>
</ProgressCircle>
{currentEpochData?.status === "SYNCING" ? (
<Box>
<Status status={currentEpochData?.status as keyof typeof EPOCH_STATUS}>
{EPOCH_STATUS_MAPPING[EPOCH_STATUS[currentEpochData?.status]]}
</Status>
</Box>
) : (
<ProgressCircle
size={100}
pathLineCap="butt"
pathWidth={6}
trailWidth={6}
percent={Number(progress)}
trailOpacity={1}
>
<EpochProgress
status={currentEpochData?.status as keyof typeof EPOCH_STATUS}
>{`${progress}%`}</EpochProgress>
<Status status={currentEpochData?.status as keyof typeof EPOCH_STATUS}>
{EPOCH_STATUS_MAPPING[EPOCH_STATUS[currentEpochData?.status]]}
</Status>
</ProgressCircle>
)}
</Box>
)
},
Expand Down

0 comments on commit 0692884

Please sign in to comment.