Skip to content

Commit d7219f6

Browse files
committed
Revert "feat(BA-2964): Premium auction UI/UX for expired names in auction (#2691)"
This reverts commit 1e1cb3f.
1 parent e488f12 commit d7219f6

File tree

8 files changed

+1072
-488
lines changed

8 files changed

+1072
-488
lines changed

apps/web/src/components/Basenames/PremiumExplainerModal/index.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import Modal from 'apps/web/src/components/Modal';
22
import 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';
44
import { CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip } from 'recharts';
55
import { formatEther } from 'viem';
66

77
type 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
};
7069
const chartMarginValues = { top: 2, right: 2, left: 2, bottom: 2 };
7170
export 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
/>

apps/web/src/components/Basenames/RegistrationForm/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function RegistrationForm() {
138138
const usdPrice = hasResolvedUSDPrice ? formatUsdPrice(price, ethUsdPrice) : '--.--';
139139
const nameIsFree = !hasRegisteredWithDiscount && price === 0n;
140140

141-
const { seconds, timestamp: premiumEndTimestamp } = usePremiumEndDurationRemaining(selectedName);
141+
const { seconds, timestamp: premiumEndTimestamp } = usePremiumEndDurationRemaining();
142142

143143
const isPremiumActive = Boolean(premiumPrice && premiumPrice !== 0n && seconds !== 0n);
144144
const mainRegistrationElementClasses = classNames(
@@ -331,7 +331,6 @@ export default function RegistrationForm() {
331331
baseSingleYearEthCost={singleYearBasePrice}
332332
isOpen={premiumExplainerModalOpen}
333333
toggleModal={togglePremiumExplainerModal}
334-
name={selectedName}
335334
/>
336335
)}
337336
</>

0 commit comments

Comments
 (0)