Skip to content

Commit

Permalink
Merge pull request #2232 from zeitgeistpm/#1931-hide-progress-when-in…
Browse files Browse the repository at this point in the history
…definet-time-left

Hide market stage progress bare on indefinite stages
  • Loading branch information
yornaath authored Feb 7, 2024
2 parents 138c9e1 + 98646c9 commit 926b252
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions components/markets/MarketTimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { isInfinite, MarketStage } from "@zeitgeistpm/sdk";
import { clamp } from "lodash-es";
import Skeleton from "components/ui/Skeleton";
import moment from "moment";
import { isInfinity } from "@zeitgeistpm/utility/dist/infinity";

export type MarketTimerProps = {
stage: MarketStage;
Expand Down Expand Up @@ -32,19 +33,21 @@ export const MarketTimer = ({ stage }: MarketTimerProps) => {
</div>
)}
</div>
<div className="w-full">
<div className="text-right text-xs text-sky-600">
{percentage.toFixed(0)}%
</div>
<div className="h-1.5 w-full rounded-lg bg-gray-100">
<div
className={`h-full rounded-lg transition-all ${
copy[stage.type].color
}`}
style={{ width: `${percentage}%` }}
/>
{!isInfinity(stage.remainingTime) && (
<div className="w-full">
<div className="text-right text-xs text-sky-600">
{percentage.toFixed(0)}%
</div>
<div className="h-1.5 w-full rounded-lg bg-gray-100">
<div
className={`h-full rounded-lg transition-all ${
copy[stage.type].color
}`}
style={{ width: `${percentage}%` }}
/>
</div>
</div>
</div>
)}
</div>
);
};
Expand Down

0 comments on commit 926b252

Please sign in to comment.