11import { Button , cn } from '@venusprotocol/ui' ;
2+ import { useState } from 'react' ;
23import ReactCountdown from 'react-countdown' ;
34
45import { Card } from 'components' ;
56import { useTranslation } from 'libs/translations' ;
67
8+ import { LastCycleSummaryModal } from '../LastCycleSummaryModal' ;
79import { Timer } from './Timer' ;
810
911export interface EndOfCycleProps {
@@ -21,6 +23,7 @@ interface CountdownState {
2123
2224export const EndOfCycle : React . FC < EndOfCycleProps > = ( { endDate, className } ) => {
2325 const { t, Trans } = useTranslation ( ) ;
26+ const [ isSummaryModalOpen , setIsSummaryModalOpen ] = useState ( false ) ;
2427
2528 const deadline = t ( 'primeLeaderboard.endOfCycle.deadline' , { date : endDate } ) ;
2629
@@ -49,9 +52,12 @@ export const EndOfCycle: React.FC<EndOfCycleProps> = ({ endDate, className }) =>
4952 values = { { deadline } }
5053 components = { {
5154 bold : < span className = "text-b1s text-white" /> ,
52- // TODO: open the last cycle summary modal once it's available
5355 summaryLink : (
54- < Button variant = "text" className = "h-auto p-0 text-b1s text-blue underline" />
56+ < Button
57+ variant = "text"
58+ onClick = { ( ) => setIsSummaryModalOpen ( true ) }
59+ className = "h-auto p-0 text-b1s text-blue underline"
60+ />
5561 ) ,
5662 } }
5763 />
@@ -60,5 +66,13 @@ export const EndOfCycle: React.FC<EndOfCycleProps> = ({ endDate, className }) =>
6066 </ Card >
6167 ) ;
6268
63- return < ReactCountdown date = { endDate } renderer = { renderCard } /> ;
69+ return (
70+ < >
71+ < ReactCountdown date = { endDate } renderer = { renderCard } />
72+
73+ { isSummaryModalOpen && (
74+ < LastCycleSummaryModal isOpen handleClose = { ( ) => setIsSummaryModalOpen ( false ) } />
75+ ) }
76+ </ >
77+ ) ;
6478} ;
0 commit comments