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

Commit

Permalink
poolsummary: fix label and padding
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Jan 27, 2025
1 parent b86a59a commit 97b556e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 34 deletions.
55 changes: 29 additions & 26 deletions src/components/IconLabel/IconLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,35 @@ export const IconLabel: React.FC<
))}
</IconLabelContainer>
))
.with({ type: "roundPeriod" }, ({ startDate, endDate = undefined, className, isLoading }) => (
<IconLabelContainer
type="period"
className={className}
iconType={IconType.CLOCK}
iconVariant={icon({ type: isLoading ? "loading" : "roundPeriod" })}
>
{match(isLoading)
.with(true, () => (
<div className="flex items-center gap-1">
<span className={text({ type: "roundPeriod" })}>{`Review period:`}</span>
<Skeleton className="h-6 w-72 rounded-lg" />
</div>
))
.otherwise(() => (
<span className={text({ type: "roundPeriod" })}>{`Review period: ${formatDate(
startDate,
DateFormat.ShortMonthDayYear24HourUTC,
)} - ${
endDate
? formatDate(endDate, DateFormat.ShortMonthDayYear24HourUTC)
: "No end date (open round)"
}`}</span>
))}
</IconLabelContainer>
))
.with(
{ type: "roundPeriod" },
({ startDate, endDate = undefined, className, isLoading, label }) => (
<IconLabelContainer
type="period"
className={className}
iconType={IconType.CLOCK}
iconVariant={icon({ type: isLoading ? "loading" : "roundPeriod" })}
>
{match(isLoading)
.with(true, () => (
<div className="flex items-center gap-1">
<span className={text({ type: "roundPeriod" })}>{label}</span>
<Skeleton className="h-6 w-72 rounded-lg" />
</div>
))
.otherwise(() => (
<span className={text({ type: "roundPeriod" })}>{`${label}: ${formatDate(
startDate,
DateFormat.ShortMonthDayYear24HourUTC,
)} - ${
endDate
? formatDate(endDate, DateFormat.ShortMonthDayYear24HourUTC)
: "No end date (open round)"
}`}</span>
))}
</IconLabelContainer>
),
)
.with({ type: "dateWithPrefix" }, ({ date, prefix, className, isLoading }) => (
<IconLabelContainer
type="date"
Expand Down
1 change: 1 addition & 0 deletions src/components/IconLabel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface PeriodProps {

interface RoundPeriodProps {
type: "roundPeriod";
label: string;
startDate: Date;
endDate?: Date;
className?: string;
Expand Down
27 changes: 19 additions & 8 deletions src/features/pool/components/PoolSummary/PoolSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export const PoolSummary = (pool: PoolSummaryProps) => {
},
];
return (
<div className={cn(variants.variants.default, "grid grid-cols-2")}>
<div className={cn(variants.variants.default, "grid grid-cols-2 py-6")}>
<div className="flex flex-col items-start justify-start gap-4">
<Breadcrumb items={breadcrumbItems} isLoading={pool?.isLoading} />
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-4">
<div>
<PoolBadge type="poolType" badge={poolType} isLoading={pool?.isLoading} />
</div>
Expand All @@ -98,12 +98,23 @@ export const PoolSummary = (pool: PoolSummaryProps) => {
isLoading={pool.isLoading}
laodingSkeletonClassName="h-10 w-72 rounded-lg"
/>
<IconLabel
type="roundPeriod"
startDate={allocationStartDate}
endDate={allocationEndDate}
isLoading={pool.isLoading}
/>

<div className="flex flex-col gap-2">
<IconLabel
type="roundPeriod"
startDate={registerStartDate}
endDate={registerEndDate}
isLoading={pool.isLoading}
label="Review"
/>
<IconLabel
type="roundPeriod"
startDate={allocationStartDate}
endDate={allocationEndDate}
isLoading={pool.isLoading}
label="Voting"
/>
</div>
</div>
</div>
<div className="flex flex-col items-end justify-between">
Expand Down

0 comments on commit 97b556e

Please sign in to comment.