Skip to content

Commit 96b3569

Browse files
committed
Changes according to CR
1 parent 8115719 commit 96b3569

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

src/components/Countdown.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ const Countdown: React.FC = () => {
2828
minutes: Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))
2929
.toString()
3030
.padStart(2, '0'),
31-
seconds: Math.floor((difference % (1000 * 60)) / 1000)
32-
.toString()
33-
.padStart(2, '0'),
3431
}
3532
}
3633

3734
return timeLeft
3835
}
3936

4037
const [timeLeft, setTimeLeft] = useState<TimeLeft>(calculateTimeLeft())
41-
const [isMounted, setIsMounted] = useState(false)
4238

4339
useEffect(() => {
44-
setIsMounted(true)
4540
const timer = setInterval(() => {
4641
setTimeLeft(calculateTimeLeft())
4742
}, 1000)
@@ -51,25 +46,21 @@ const Countdown: React.FC = () => {
5146
}
5247
}, [])
5348

54-
if (!isMounted) {
55-
return null
56-
}
57-
58-
if (timeLeft.seconds === undefined) {
49+
if (timeLeft.minutes === undefined) {
5950
return null
6051
}
6152

6253
return (
63-
<div className="px-6 pb-6">
54+
<div className="px-6">
6455
<p
6556
className="cursor-default"
6657
title="Using Client smart contract is available only for new applications. Select Contract as allocation type to start using it"
6758
>
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.
7364
</p>
7465
</div>
7566
)

src/components/DatacapAmountModel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Button } from '@/components/ui/button'
2020
import { AllocationUnit, type Allocation, type Application } from '@/type'
2121
import { type ReactNode, useState } from 'react'
2222
import { bytesToiB } from '@/lib/utils'
23+
import Countdown from './Countdown'
2324

2425
type AllocationType = 'directly' | 'contract'
2526

@@ -78,6 +79,7 @@ const DatacapAmountModal = ({
7879
return (
7980
<Dialog open={allocationConfig.isDialogOpen} onClose={onClose} fullWidth>
8081
<DialogTitle>{title}</DialogTitle>
82+
<Countdown />
8183
<DialogContent>
8284
{(isApiCalling || isWalletConnecting) && (
8385
<div className="fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50">

src/components/cards/AppInfoCard.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import {
5252
DialogTitle as DialogTitlePrimitive,
5353
DialogTrigger,
5454
} from '@/components/ui/Dialog'
55-
import Countdown from '../Countdown'
5655
interface ComponentProps {
5756
initialApplication: Application
5857
repo: string
@@ -1046,7 +1045,6 @@ const AppInfoCard: React.FC<ComponentProps> = ({
10461045
/>
10471046
)}
10481047
</CardContent>
1049-
<Countdown />
10501048
<div>
10511049
<CardFooter className="flex flex-row items-center border-t pt-4 pb-2 mt-4 justify-between gap-3">
10521050
<div className="flex gap-2 pb-4">

0 commit comments

Comments
 (0)