Skip to content

Commit 3117a3b

Browse files
committed
updates
1 parent 9170c8f commit 3117a3b

File tree

6 files changed

+94
-26
lines changed

6 files changed

+94
-26
lines changed

apps/dashboard/src/@/components/blocks/distribution-chart.tsx

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import { cn } from "@/lib/utils";
33
export type Segment = {
44
label: string;
55
percent: number;
6+
value: string;
67
color: string;
78
};
89

910
type DistributionBarChartProps = {
1011
segments: Segment[];
11-
title: string;
12+
title?: string;
13+
titleClassName?: string;
14+
barClassName?: string;
1215
};
1316

1417
export function DistributionBarChart(props: DistributionBarChartProps) {
@@ -21,24 +24,36 @@ export function DistributionBarChart(props: DistributionBarChartProps) {
2124

2225
return (
2326
<div>
24-
<div className="mb-2 flex items-center justify-between">
25-
<h3 className="font-medium text-sm">{props.title}</h3>
26-
<div
27-
className={cn(
28-
"font-medium text-muted-foreground text-sm",
29-
invalidTotalPercentage && "text-red-500",
30-
)}
31-
>
32-
Total: {totalPercentage}%
27+
{props.title && (
28+
<div className="mb-2 flex items-center justify-between">
29+
<h3 className={cn("font-medium text-sm", props.titleClassName)}>
30+
{props.title}
31+
</h3>
32+
<div
33+
className={cn(
34+
"font-medium text-muted-foreground text-sm",
35+
invalidTotalPercentage && "text-red-500",
36+
)}
37+
>
38+
Total: {totalPercentage}%
39+
</div>
3340
</div>
34-
</div>
41+
)}
3542

3643
{/* Bar */}
37-
<div className="flex h-3 overflow-hidden rounded-lg">
44+
<div
45+
className={cn(
46+
"flex h-3 overflow-hidden rounded-lg",
47+
props.barClassName,
48+
)}
49+
>
3850
{props.segments.map((segment) => {
3951
return (
4052
<div
41-
className="flex h-full items-center justify-center transition-all duration-200"
53+
className={cn(
54+
"flex h-full items-center justify-center transition-all duration-200",
55+
segment.percent > 0 && "border-r-2 border-background",
56+
)}
4257
key={segment.label}
4358
style={{
4459
backgroundColor: segment.color,
@@ -67,7 +82,7 @@ export function DistributionBarChart(props: DistributionBarChartProps) {
6782
"text-destructive-text",
6883
)}
6984
>
70-
{segment.label}: {segment.percent}%
85+
{segment.label}: {segment.value}
7186
</p>
7287
</div>
7388
);

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/create-token-page-impl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function CreateTokenAssetPage(props: {
113113
params.values.pool.startingPricePerToken,
114114
),
115115
}),
116-
referrerRewardBps: 5000, // 50%
116+
referrerRewardBps: 1250, // 12.5%
117117
},
118118
}
119119
: undefined,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/distribution/token-airdrop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function TokenAirdropSection(props: {
6767
return (
6868
<DynamicHeight>
6969
<div className="relative border-t border-dashed">
70-
<div className="flex items-center justify-between gap-3 px-4 py-5 md:px-6">
70+
<div className="flex items-center justify-between gap-3 px-4 py-6 md:px-6">
7171
<div>
7272
<h2 className="font-semibold text-lg">Airdrop</h2>
7373
<p className="text-muted-foreground text-sm">

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/distribution/token-distribution.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,19 @@ export function TokenDistributionBarChart(props: {
144144
color: "hsl(var(--chart-1))",
145145
label: "Owner",
146146
percent: ownerPercentage,
147+
value: `${ownerPercentage}%`,
147148
},
148149
{
149150
color: "hsl(var(--chart-3))",
150151
label: "Airdrop",
151152
percent: airdropPercentage,
153+
value: `${airdropPercentage}%`,
152154
},
153155
{
154156
color: "hsl(var(--chart-4))",
155157
label: "Sale",
156158
percent: salePercentage,
159+
value: `${salePercentage}%`,
157160
},
158161
];
159162

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/token/distribution/token-sale.tsx

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

33
import { useQuery } from "@tanstack/react-query";
4-
import { XIcon } from "lucide-react";
4+
import { DollarSignIcon, XIcon } from "lucide-react";
55
import { useEffect, useState } from "react";
66
import type { ThirdwebClient } from "thirdweb";
77
import { defineChain } from "thirdweb";
88
import { isRouterEnabled } from "thirdweb/assets";
9+
import { DistributionBarChart } from "@/components/blocks/distribution-chart";
910
import { FormFieldSetup } from "@/components/blocks/FormFieldSetup";
1011
import { DynamicHeight } from "@/components/ui/DynamicHeight";
1112
import { DecimalInput } from "@/components/ui/decimal-input";
@@ -65,6 +66,11 @@ export function TokenSaleSection(props: {
6566
}
6667
}, [isRouterEnabledValue, props.form, hasUserUpdatedSaleMode, isSaleEnabled]);
6768

69+
const protocolFee = 20;
70+
const leftOverFee = 100 - protocolFee;
71+
const convenienceFee = (12.5 * leftOverFee) / 100;
72+
const deployerFee = leftOverFee - convenienceFee;
73+
6874
return (
6975
<DynamicHeight>
7076
<div className="relative border-t border-dashed p-4 md:p-6">
@@ -131,6 +137,46 @@ export function TokenSaleSection(props: {
131137
client={props.client}
132138
form={props.form}
133139
/>
140+
141+
<div className="mt-5 border p-4 bg-background rounded-lg relative">
142+
<div className="flex mb-4">
143+
<div className="p-2 rounded-full border bg-card">
144+
<DollarSignIcon className="size-5 text-muted-foreground" />
145+
</div>
146+
</div>
147+
<h3 className="font-medium text-base mt-2"> Sale Rewards </h3>
148+
<p className="text-muted-foreground text-sm mb-4">
149+
All trades on the market are subjected to{" "}
150+
<em className="text-foreground font-medium not-italic"> 1% </em>{" "}
151+
fee distributed as:
152+
</p>
153+
154+
<div className="relative">
155+
<div className="absolute -top-6 right-0 text-sm">Total: 1%</div>
156+
<DistributionBarChart
157+
segments={[
158+
{
159+
label: "Your Wallet",
160+
percent: deployerFee,
161+
color: "hsl(var(--chart-1))",
162+
value: `${deployerFee / 100}%`,
163+
},
164+
{
165+
label: "Protocol",
166+
percent: protocolFee,
167+
color: "hsl(var(--chart-2))",
168+
value: `${protocolFee / 100}%`,
169+
},
170+
{
171+
label: "Convenience fee",
172+
percent: convenienceFee,
173+
color: "hsl(var(--chart-3))",
174+
value: `${convenienceFee / 100}%`,
175+
},
176+
]}
177+
/>
178+
</div>
179+
</div>
134180
</div>
135181
)}
136182
</div>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/rewards/components/claim-rewards-page.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ export function ClaimRewardsPageUI(props: {
128128
<div>
129129
<div className="bg-card rounded-lg border">
130130
<div className="p-4 lg:px-6 py-5 border-b">
131-
<h2 className="font-semibold text-xl tracking-tight mb-0.5 lg:mb-0">
132-
Uniswap LP Rewards
131+
<h2 className="font-semibold text-2xl tracking-tight mb-0.5 lg:mb-0">
132+
Rewards
133133
</h2>
134134
<p className="text-muted-foreground text-sm">
135135
Earnings received by Liquidity Providers (LPs) in exchange for
@@ -140,7 +140,7 @@ export function ClaimRewardsPageUI(props: {
140140

141141
<div className="p-4 lg:p-6 border-b border-dashed">
142142
<div className="mb-2">
143-
<h3 className="font-medium text-sm">Unclaimed Rewards</h3>
143+
<h3 className="font-medium text-base">Unclaimed Rewards</h3>
144144
</div>
145145
<div className="flex flex-col gap-3 lg:flex-row">
146146
<TokenReward
@@ -161,21 +161,25 @@ export function ClaimRewardsPageUI(props: {
161161
<div className="p-4 lg:p-6">
162162
<DistributionBarChart
163163
title="Reward Distribution"
164+
titleClassName="text-base"
164165
segments={[
165166
{
166167
label: "Recipient",
167168
color: recipientColor,
168169
percent: fees.recipientPercentage,
170+
value: `${fees.recipientPercentage}%`,
171+
},
172+
{
173+
label: "Protocol",
174+
color: protocolFeesColor,
175+
percent: fees.protocolFees,
176+
value: `${fees.protocolFees}%`,
169177
},
170178
{
171179
label: "Referrer",
172180
color: referrerColor,
173181
percent: fees.referrerPercentage,
174-
},
175-
{
176-
label: "Protocol Fees",
177-
color: protocolFeesColor,
178-
percent: fees.protocolFees,
182+
value: `${fees.referrerPercentage}%`,
179183
},
180184
]}
181185
/>
@@ -289,7 +293,7 @@ function TokenReward(props: {
289293
<Link
290294
target="_blank"
291295
rel="noopener noreferrer"
292-
href={`https://thirdweb.com/${props.chainSlug}/${props.token.address}`}
296+
href={`/${props.chainSlug}/${props.token.address}`}
293297
className="flex items-center gap-1.5 text-muted-foreground before:absolute before:inset-0"
294298
>
295299
<span className="text-xs font-mono">

0 commit comments

Comments
 (0)