Skip to content

Commit fd26391

Browse files
committed
fix app revenue chart
1 parent 82082ac commit fd26391

File tree

9 files changed

+49
-39
lines changed

9 files changed

+49
-39
lines changed

next.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ const nextConfig = {
202202
source: '/chain/Optimism',
203203
destination: '/chain/OP%20Mainnet',
204204
permanent: true
205+
},
206+
{
207+
source: '/pro',
208+
destination: '/subscribe',
209+
permanent: true
205210
}
206211
]
207212
},

src/api/categories/chains/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function useGetFeesAndRevenueChartDataByChain(chain?: string) {
7070

7171
export function useGetAppRevenueChartDataByChain(chain?: string) {
7272
return useQuery({
73-
queryKey: [`feesAndRevenueChartDataByChain/${chain}`],
73+
queryKey: [`appRevenueByChain/${chain}`],
7474
queryFn:
7575
chain && chain !== 'All'
7676
? () =>

src/components/ECharts/ChainChart/index.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const groupableCharts = [
2020
const colors = {
2121
tvl: '#335cd7',
2222
volume: '#19ab17',
23-
fees: '#f150f4',
24-
revenue: '#b4b625',
23+
chainFees: '#f150f4',
24+
chainRevenue: '#b4b625',
2525
price: '#da1f73',
2626
returningUsers: '#fa4646',
2727
newUsers: '#46faf2',
@@ -182,12 +182,12 @@ export default function AreaChart({
182182
})
183183
}
184184

185-
if (route.fees === 'true' && data?.feesChart) {
186-
const color = getColor(isCompare) || colors.fees
185+
if (route.chainFees === 'true' && data?.feesChart) {
186+
const color = getColor(isCompare) || colors.chainFees
187187
const areaColor = getAreaColor(color, isThemeDark)
188188
series.push({
189189
name: namePrefix + 'Fees',
190-
chartId: 'Fees',
190+
chartId: 'Chain Fees',
191191
symbol: 'none',
192192
type: groupBy === 'cumulative' ? 'line' : 'bar',
193193
data: [],
@@ -202,12 +202,12 @@ export default function AreaChart({
202202
})
203203
}
204204

205-
if (route.revenue === 'true' && data?.feesChart) {
206-
const color = getColor(isCompare) || colors.revenue
205+
if (route.chainRevenue === 'true' && data?.feesChart) {
206+
const color = getColor(isCompare) || colors.chainRevenue
207207
const areaColor = getAreaColor(color, isThemeDark)
208208
series.push({
209209
name: namePrefix + 'Revenue',
210-
chartId: 'Revenue',
210+
chartId: 'Chain Revenue',
211211
symbol: 'none',
212212
type: groupBy === 'cumulative' ? 'line' : 'bar',
213213
data: [],
@@ -559,8 +559,8 @@ export default function AreaChart({
559559
isCompare,
560560
route.tvl,
561561
route.volume,
562-
route.fees,
563-
route.revenue,
562+
route.chainFees,
563+
route.chainRevenue,
564564
route.price,
565565
route.users,
566566
route.raises,
@@ -601,8 +601,8 @@ export default function AreaChart({
601601
const offsets = {
602602
TVL: 60,
603603
Volume: 60,
604-
Fees: 55,
605-
Revenue: 65,
604+
'Chain Fees': 55,
605+
'Chain Revenue': 65,
606606
'App Revenue': 65,
607607
Price: 65,
608608
Raises: 65,
@@ -671,18 +671,18 @@ export default function AreaChart({
671671
},
672672
{
673673
...yAxis,
674-
id: 'Fees',
674+
id: 'Chain Fees',
675675
axisLabel: {
676676
...yAxis.axisLabel,
677-
color: () => (isCompare ? '#fff' : colors.fees)
677+
color: () => (isCompare ? '#fff' : colors.chainFees)
678678
}
679679
},
680680
{
681681
...yAxis,
682-
id: 'Revenue',
682+
id: 'Chain Revenue',
683683
axisLabel: {
684684
...yAxis.axisLabel,
685-
color: () => (isCompare ? '#fff' : colors.revenue)
685+
color: () => (isCompare ? '#fff' : colors.chainRevenue)
686686
}
687687
},
688688
{

src/components/Table/Defi/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ export const chainsColumn: ColumnDef<IChainsRow>[] = [
954954
}
955955
},
956956
{
957-
header: `24h Fees`,
957+
header: `24h Chain Fees`,
958958
accessorKey: 'totalFees24h',
959959
enableSorting: true,
960960
cell: (info) => {

src/containers/ChainContainer/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ export function ChainContainer({
150150
isVisible: volumeData?.totalVolume24h ? true : false
151151
},
152152
{
153-
id: 'fees',
154-
name: 'Fees',
153+
id: 'chainFees',
154+
name: 'Chain Fees',
155155
isVisible: feesAndRevenueData?.totalFees24h ? true : false
156156
},
157157
{
158-
id: 'revenue',
159-
name: 'Revenue',
158+
id: 'chainRevenue',
159+
name: 'Chain Revenue',
160160
isVisible: feesAndRevenueData?.totalRevenue24h ? true : false
161161
},
162162
{
@@ -378,7 +378,7 @@ export function ChainContainer({
378378

379379
{feesAndRevenueData?.totalFees24h ? (
380380
<tr>
381-
<th className="text-[#545757] dark:text-[#cccccc] font-normal text-left pb-1">Fees (24h)</th>
381+
<th className="text-[#545757] dark:text-[#cccccc] font-normal text-left pb-1">Chain Fees (24h)</th>
382382
<td className="font-jetbrains text-right">
383383
{formattedNum(feesAndRevenueData?.totalFees24h, true)}
384384
</td>
@@ -387,7 +387,9 @@ export function ChainContainer({
387387

388388
{feesAndRevenueData?.totalRevenue24h ? (
389389
<tr>
390-
<th className="text-[#545757] dark:text-[#cccccc] font-normal text-left pb-1">Revenue (24h)</th>
390+
<th className="text-[#545757] dark:text-[#cccccc] font-normal text-left pb-1">
391+
Chain Revenue (24h)
392+
</th>
391393
<td className="font-jetbrains text-right">
392394
{formattedNum(feesAndRevenueData?.totalRevenue24h, true)}
393395
</td>

src/containers/ChainContainer/useFetchChainChartData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const useFetchChainChartData = ({
5353

5454
const { data: feesAndRevenueChart, isLoading: fetchingFeesAndRevenueChartDataByChain } =
5555
useGetFeesAndRevenueChartDataByChain(
56-
feesAndRevenueData?.totalFees24h && (router.query.fees === 'true' || router.query.revenue === 'true')
56+
feesAndRevenueData?.totalFees24h && (router.query.chainFees === 'true' || router.query.chainRevenue === 'true')
5757
? selectedChain
5858
: null
5959
)

src/containers/ComparePage/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ function ComparePage() {
224224
key: 'volumeChart'
225225
},
226226
{
227-
id: 'fees',
228-
name: 'Fees',
227+
id: 'chainFees',
228+
name: 'Chain Fees',
229229
key: 'feesChart'
230230
},
231231
{
232-
id: 'revenue',
233-
name: 'Revenue',
232+
id: 'chainRevenue',
233+
name: 'Chain Revenue',
234234
key: 'feesChart'
235235
},
236236
{

src/containers/Subscribe/Home.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function SubscribeHome() {
8181
<h2 className="whitespace-nowrap text-[2rem] font-[800] text-center">Open</h2>
8282
<p className="text-center text-2xl font-medium mt-3">Free</p>
8383
<span className="h-5"></span>
84-
<ul className="flex flex-col mx-auto gap-4 mt-11 mb-auto">
84+
<ul className="flex flex-col mx-auto gap-4 py-11 mb-auto">
8585
<li className="flex flex-nowrap gap-[10px]">
8686
<Icon name="check" height={16} width={16} className="relative top-1" />
8787
<span>Access to TVL, revenue/fees and prices</span>
@@ -122,7 +122,7 @@ export function SubscribeHome() {
122122
300 USD <span className="text-[#8a8c90]">/month</span>
123123
</p>
124124
<p className="text-center font-medium text-[#8a8c90]">Multiple payment options</p>
125-
<ul className="flex flex-col mx-auto gap-4 mt-11 mb-auto">
125+
<ul className="flex flex-col mx-auto gap-4 py-11 mb-auto">
126126
<li className="flex flex-nowrap gap-[10px]">
127127
<Icon name="check" height={16} width={16} className="relative top-1" />
128128
<span>Access to TVL, revenue/fees and prices</span>
@@ -161,7 +161,7 @@ export function SubscribeHome() {
161161
</li>
162162
</ul>
163163

164-
<div className="w-full max-w-[408px] mx-auto mt-0 flex flex-col gap-2">
164+
<div className="w-full max-w-[408px] mx-auto flex flex-col gap-2">
165165
<SignIn text="Already a subscriber? Sign In" />
166166
<div className="flex flex-nowrap gap-2 relative max-sm:flex-col max-sm:*:w-full">
167167
<PayWithCrypto pro={true} />
@@ -213,7 +213,7 @@ export function SubscribeHome() {
213213
))}
214214
</Tooltip>
215215
</p>
216-
<ul className="flex flex-col mx-auto gap-4 mt-11 mb-auto">
216+
<ul className="flex flex-col mx-auto gap-4 py-11 mb-auto">
217217
<li className="flex flex-nowrap gap-[10px]">
218218
<Icon name="check" height={16} width={16} className="relative top-1" />
219219
<span>Access to TVL, revenue/fees and prices</span>
@@ -252,20 +252,20 @@ export function SubscribeHome() {
252252
</li>
253253
</ul>
254254

255-
<div className="w-full max-w-[408px] mx-auto mt-0 flex flex-col gap-2">
255+
<div className="w-full max-w-[408px] mx-auto flex flex-col gap-2">
256256
<SignInWithGithub />
257-
<div className="flex flex-nowrap gap-2 relative max-sm:flex-col max-sm:*:w-full">
258-
{/* <PayWithCrypto pro={false} /> */}
259-
{/* <a
257+
{/* <div className="flex flex-nowrap gap-2 relative max-sm:flex-col max-sm:*:w-full">
258+
<PayWithCrypto pro={false} />
259+
<a
260260
href="https://defillama.com/docs/api"
261261
target="_blank"
262262
rel="noreferrer noopener"
263263
className="font-medium rounded-lg border border-[#5C5CF9] py-[14px] flex-1 text-center mx-auto disabled:cursor-not-allowed flex items-center gap-1 justify-center flex-nowrap"
264264
>
265265
<Icon name="card" height={16} width={16} />
266266
<span>Pay with Stripe</span>
267-
</a> */}
268-
</div>
267+
</a>
268+
</div> */}
269269
</div>
270270
</div>
271271
</div>

src/containers/Subscribe/Layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export function SubscribeLayout({ children }) {
2020
</header>
2121
{children}
2222
<footer className="mt-auto py-3 px-5 flex flex-wrap items-center justify-center gap-4 text-[#8a8c90]">
23+
<a href="https://discord.defillama.com" className="underline">
24+
Discord
25+
</a>
2326
<a href="mailto:support@llama.fi" className="underline">
2427
Contact Us
2528
</a>

0 commit comments

Comments
 (0)