File tree Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -28,20 +28,15 @@ const Countdown: React.FC = () => {
28
28
minutes : Math . floor ( ( difference % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) )
29
29
. toString ( )
30
30
. padStart ( 2 , '0' ) ,
31
- seconds : Math . floor ( ( difference % ( 1000 * 60 ) ) / 1000 )
32
- . toString ( )
33
- . padStart ( 2 , '0' ) ,
34
31
}
35
32
}
36
33
37
34
return timeLeft
38
35
}
39
36
40
37
const [ timeLeft , setTimeLeft ] = useState < TimeLeft > ( calculateTimeLeft ( ) )
41
- const [ isMounted , setIsMounted ] = useState ( false )
42
38
43
39
useEffect ( ( ) => {
44
- setIsMounted ( true )
45
40
const timer = setInterval ( ( ) => {
46
41
setTimeLeft ( calculateTimeLeft ( ) )
47
42
} , 1000 )
@@ -51,25 +46,21 @@ const Countdown: React.FC = () => {
51
46
}
52
47
} , [ ] )
53
48
54
- if ( ! isMounted ) {
55
- return null
56
- }
57
-
58
- if ( timeLeft . seconds === undefined ) {
49
+ if ( timeLeft . minutes === undefined ) {
59
50
return null
60
51
}
61
52
62
53
return (
63
- < div className = "px-6 pb-6 " >
54
+ < div className = "px-6" >
64
55
< p
65
56
className = "cursor-default"
66
57
title = "Using Client smart contract is available only for new applications. Select Contract as allocation type to start using it"
67
58
>
68
- Direct client allocation will be deprecated in{ ' ' }
69
- < span className = "inline-block text-center" style = { { width : '90px' } } >
70
- { timeLeft . days } : { timeLeft . hours } : { timeLeft . minutes } : { timeLeft . seconds }
71
- </ span >
72
- . Start using the Client smart contract today.
59
+ Direct allocation of DataCap will be deprecated in{ ' ' }
60
+ < span className = "whitespace-nowrap" >
61
+ { timeLeft . days } d { timeLeft . hours } h { timeLeft . minutes } m
62
+ </ span > { ' ' }
63
+ (June 1) . Start using the Client smart contract today.
73
64
</ p >
74
65
</ div >
75
66
)
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { Button } from '@/components/ui/button'
20
20
import { AllocationUnit , type Allocation , type Application } from '@/type'
21
21
import { type ReactNode , useState } from 'react'
22
22
import { bytesToiB } from '@/lib/utils'
23
+ import Countdown from './Countdown'
23
24
24
25
type AllocationType = 'directly' | 'contract'
25
26
@@ -78,6 +79,7 @@ const DatacapAmountModal = ({
78
79
return (
79
80
< Dialog open = { allocationConfig . isDialogOpen } onClose = { onClose } fullWidth >
80
81
< DialogTitle > { title } </ DialogTitle >
82
+ < Countdown />
81
83
< DialogContent >
82
84
{ ( isApiCalling || isWalletConnecting ) && (
83
85
< div className = "fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50" >
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ import {
52
52
DialogTitle as DialogTitlePrimitive ,
53
53
DialogTrigger ,
54
54
} from '@/components/ui/Dialog'
55
- import Countdown from '../Countdown'
56
55
interface ComponentProps {
57
56
initialApplication : Application
58
57
repo : string
@@ -1046,7 +1045,6 @@ const AppInfoCard: React.FC<ComponentProps> = ({
1046
1045
/>
1047
1046
) }
1048
1047
</ CardContent >
1049
- < Countdown />
1050
1048
< div >
1051
1049
< CardFooter className = "flex flex-row items-center border-t pt-4 pb-2 mt-4 justify-between gap-3" >
1052
1050
< div className = "flex gap-2 pb-4" >
You can’t perform that action at this time.
0 commit comments