-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
174 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/components/Project/ProjectTabs/CyclesPayoutsTab/CountdownCallout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ClockIcon } from '@heroicons/react/24/outline' | ||
import { Trans } from '@lingui/macro' | ||
import { useCountdownClock } from 'components/Project/hooks/useCountdownClock' | ||
import { twMerge } from 'tailwind-merge' | ||
|
||
export function CountdownCallout({ | ||
cycleStart, | ||
}: { | ||
cycleStart: number | undefined | ||
}) { | ||
const { remainingTimeText } = useCountdownClock(cycleStart) | ||
|
||
return ( | ||
<div | ||
className={twMerge( | ||
'flex items-center gap-2 rounded-lg py-2 px-3.5 text-sm font-medium shadow-sm', | ||
'border-bluebs-100 bg-bluebs-25 text-bluebs-700 dark:border-bluebs-800 dark:bg-bluebs-950 dark:text-bluebs-400', | ||
)} | ||
> | ||
<ClockIcon className="h-5 w-5" /> | ||
<Trans>Starts in {remainingTimeText}</Trans> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ents/V2V3Project/ProjectDashboard/components/PayRedeemCard/FirstCycleCountdownCallout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ClockIcon } from '@heroicons/react/24/outline' | ||
import { Trans } from '@lingui/macro' | ||
import { useCountdownClock } from 'components/Project/hooks/useCountdownClock' | ||
import { useProjectMetadataContext } from 'contexts/ProjectMetadataContext' | ||
import { useProjectUpcomingFundingCycle } from 'packages/v2v3/hooks/contractReader/useProjectUpcomingFundingCycle' | ||
import { twMerge } from 'tailwind-merge' | ||
|
||
export function FirstCycleCountdownCallout() { | ||
const { projectId } = useProjectMetadataContext() | ||
|
||
// inefficient extra call, but meh | ||
const fc = useProjectUpcomingFundingCycle({ projectId }) | ||
const start = fc?.data?.[0]?.start?.toNumber() | ||
const { remainingTimeText } = useCountdownClock(start) | ||
|
||
if (!start) { | ||
return null | ||
} | ||
return ( | ||
<div | ||
className={twMerge( | ||
'flex items-center gap-2 rounded-lg py-2 px-3.5 text-sm font-medium shadow-sm', | ||
'border-warning-100 bg-warning-25 text-warning-700 dark:border-warning-800 dark:bg-warning-950 dark:text-warning-400', | ||
)} | ||
> | ||
<ClockIcon className="h-5 w-5" /> | ||
<Trans>Payments open in {remainingTimeText}</Trans> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters