11import Modal from 'apps/web/src/components/Modal' ;
22import data from 'apps/web/src/data/usernamePriceDecayTable.json' ;
3- import { useBasenamesNameExpiresWithGracePeriod } from 'apps/web/src/hooks/useBasenamesNameExpiresWithGracePeriod ' ;
3+ import { useBasenamesLaunchTime } from 'apps/web/src/hooks/useBasenamesLaunchTime ' ;
44import { CartesianGrid , Line , LineChart , ResponsiveContainer , Tooltip } from 'recharts' ;
55import { formatEther } from 'viem' ;
66
77type CustomTooltipProps = {
88 active ?: boolean ;
99 baseSingleYearEthCost ?: bigint ;
10- auctionStartTimeSeconds ?: bigint ;
10+ launchTimeSeconds ?: bigint ;
1111 payload : [
1212 {
1313 dataKey : 'premium' ;
1414 name : 'premium' ;
15- payload : { days : number ; premium : number } ;
15+ payload : { hours : number ; premium : number } ;
1616 value : number ;
1717 } ,
1818 ] ;
@@ -22,13 +22,13 @@ function CustomTooltip({
2222 active,
2323 payload,
2424 baseSingleYearEthCost,
25- auctionStartTimeSeconds ,
25+ launchTimeSeconds ,
2626} : CustomTooltipProps ) {
27- if ( active && payload ?. length && auctionStartTimeSeconds && baseSingleYearEthCost ) {
27+ if ( active && payload ?. length && launchTimeSeconds && baseSingleYearEthCost ) {
2828 const premium = payload [ 0 ] . value ;
29- const days = payload [ 0 ] . payload . days ;
30- const seconds = days * 24 * 60 * 60 ; // Convert days to seconds
31- const tooltipSeconds = seconds + Number ( auctionStartTimeSeconds ) ;
29+ const hours = payload [ 0 ] . payload . hours ;
30+ const seconds = hours * 60 * 60 ;
31+ const tooltipSeconds = seconds + Number ( launchTimeSeconds ) ;
3232 const timeOfPremium = new Date ( tooltipSeconds * 1000 ) . toLocaleString ( undefined , {
3333 year : 'numeric' ,
3434 month : '2-digit' ,
@@ -65,17 +65,15 @@ type PremiumExplainerModalProps = {
6565 toggleModal : ( ) => void ;
6666 premiumEthAmount : bigint | undefined ;
6767 baseSingleYearEthCost : bigint ;
68- name : string ;
6968} ;
7069const chartMarginValues = { top : 2 , right : 2 , left : 2 , bottom : 2 } ;
7170export function PremiumExplainerModal ( {
7271 isOpen,
7372 toggleModal,
7473 premiumEthAmount,
7574 baseSingleYearEthCost,
76- name,
7775} : PremiumExplainerModalProps ) {
78- const { data : auctionStartTimeSeconds } = useBasenamesNameExpiresWithGracePeriod ( name ) ;
76+ const { data : launchTimeSeconds } = useBasenamesLaunchTime ( ) ;
7977
8078 if ( ! premiumEthAmount || ! baseSingleYearEthCost ) return null ;
8179 const formattedOneYearCost = Number ( formatEther ( baseSingleYearEthCost ) ) . toLocaleString (
@@ -96,8 +94,8 @@ export function PremiumExplainerModal({
9694 < div className = "flex max-w-[491px] flex-1 flex-col gap-3" >
9795 < h1 className = "w-full text-2xl font-bold" > This name has a temporary premium</ h1 >
9896 < p className = "mb-3 text-illoblack" >
99- To ensure fair distribution of recently expired Basenames, all names have a price premium
100- which starts at 100 ETH that then decays exponentially to 0 over 21 days .
97+ To ensure fair distribution of Basenames, all names have a temporary premium starting at
98+ 100 ETH that then decays exponentially to 0 over 36 hours .
10199 </ p >
102100 < div className = "grid grid-cols-2 grid-rows-4" >
103101 < div className = "col-span-2 mb-2 text-sm font-medium uppercase text-gray-60" >
@@ -149,7 +147,7 @@ export function PremiumExplainerModal({
149147 // @ts -expect-error type wants an unnecessary prop
150148 < CustomTooltip
151149 baseSingleYearEthCost = { baseSingleYearEthCost }
152- auctionStartTimeSeconds = { auctionStartTimeSeconds }
150+ launchTimeSeconds = { launchTimeSeconds }
153151 />
154152 }
155153 />
0 commit comments