Skip to content

Commit dea0047

Browse files
committed
Merge branch 'main' into feat-embedded-stripe
2 parents f71fc37 + 01767ea commit dea0047

File tree

28 files changed

+447
-182
lines changed

28 files changed

+447
-182
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[DefiLlama](https://defillama.com) is the leading DeFi analytics and insights platform, providing comprehensive data on total value locked (TVL), yields, stablecoins, and more across all blockchain ecosystems.
44

5-
Check it out live at https://defillama.com
5+
Check it out live at: https://defillama.com
66

77
## Features
88

@@ -16,21 +16,26 @@ Check it out live at https://defillama.com
1616
## Local Setup
1717

1818
#### 1. Clone the repository:
19+
1920
```bash
20-
git clone https://github.com/DefiLlama/DefiLlama.git
21-
cd DefiLlama
21+
git clone https://github.com/DefiLlama/defillama-app.git
22+
cd defillama-app
2223
```
2324

2425
#### 2. Install dependencies:
26+
2527
```bash
2628
yarn
2729
```
2830

2931
#### 3. Start the development server:
32+
3033
```bash
3134
yarn dev
3235
```
3336

37+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
38+
3439
## Contributing
3540

3641
Contributions are welcome. New features, small fixes, docs updates, whatever helps.
@@ -57,4 +62,8 @@ Join the conversation and stay up to date:
5762

5863
- [X/Twitter](https://twitter.com/DefiLlama)
5964
- [Discord](https://discord.defillama.com/)
60-
- [Documentation](https://docs.llama.fi/)
65+
- [Documentation](https://docs.llama.fi/)
66+
67+
## License
68+
69+
[GPL-3.0](./LICENSE)

eslint.config.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,28 @@ const eslintConfig = [
1717
},
1818
{
1919
rules: {
20-
'no-undef': 1,
21-
'no-unused-vars': 1,
2220
'react/no-unescaped-entities': 0,
2321
'@next/next/no-img-element': 0,
2422
'@typescript-eslint/no-explicit-any': 0,
25-
'@typescript-eslint/no-unused-vars': 1,
2623
'prefer-const': 0
2724
}
2825
},
26+
{
27+
files: ['**/*.js', '**/*.jsx'],
28+
rules: {
29+
'no-undef': 1,
30+
'no-unused-vars': 1
31+
}
32+
},
2933
{
3034
files: ['**/*.ts', '**/*.tsx'],
3135
languageOptions: {
3236
parser: typescriptParser
37+
},
38+
rules: {
39+
'no-undef': 0, // TypeScript handles this
40+
'no-unused-vars': 0, // Disable base rule for TypeScript files
41+
'@typescript-eslint/no-unused-vars': 1 // Use TypeScript-specific rule instead
3342
}
3443
}
3544
]

public/game/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@
12031203
* @param {Obstacle.type} type
12041204
* @param {Object} spritePos Obstacle position in sprite.
12051205
* @param {Object} dimensions
1206-
* @param {number} gapCoefficient Mutipler in determining the gap.
1206+
* @param {number} gapCoefficient Multiplier in determining the gap.
12071207
* @param {number} speed
12081208
* @param {number} opt_xOffset
12091209
*/
@@ -1570,7 +1570,7 @@
15701570

15711571
/**
15721572
* Setter for the jump velocity.
1573-
* The approriate drop velocity is also set.
1573+
* The appropriate drop velocity is also set.
15741574
*/
15751575
setJumpVelocity: function (setting) {
15761576
this.config.INIITAL_JUMP_VELOCITY = -setting
@@ -2036,7 +2036,7 @@
20362036
},
20372037

20382038
/**
2039-
* Set the highscore as a array string.
2039+
* Set the high score as an array string.
20402040
* Position of char in the sprite: H - 10, I - 11.
20412041
* @param {number} distance Distance ran in pixels.
20422042
*/
@@ -2156,7 +2156,7 @@
21562156
//******************************************************************************
21572157

21582158
/**
2159-
* Nightmode shows a moon and stars on the horizon.
2159+
* Night mode shows a moon and stars on the horizon.
21602160
*/
21612161
function NightMode(canvas, spritePos, containerWidth) {
21622162
this.spritePos = spritePos
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import { Dialog, DialogDismiss, DialogHeading } from '@ariakit/react'
22
import { Icon } from '~/components/Icon'
33

4-
export function PortfolioDialog({ open, setOpen, addPortfolio }) {
4+
export function DialogForm({
5+
open,
6+
setOpen,
7+
title,
8+
description,
9+
onSubmit
10+
}: {
11+
open: boolean
12+
setOpen: (value: boolean) => void
13+
title: string
14+
description: string
15+
onSubmit: (name: string) => void
16+
}) {
517
return (
618
<Dialog
719
open={open}
@@ -10,7 +22,7 @@ export function PortfolioDialog({ open, setOpen, addPortfolio }) {
1022
className="fixed top-[50%] left-[50%] flex h-fit w-8/10 max-w-150 translate-x-[-50%] translate-y-[-50%] flex-col gap-4 rounded-md border border-(--cards-border) bg-(--cards-bg) p-6 sm:w-1/2 lg:w-1/3"
1123
>
1224
<div className="flex items-center justify-between gap-2">
13-
<DialogHeading className="text-lg font-medium">New portfolio</DialogHeading>
25+
<DialogHeading className="text-lg font-medium">{title}</DialogHeading>
1426
<DialogDismiss
1527
className="-my-2 ml-auto rounded-lg p-2 text-(--text-tertiary) hover:bg-(--divider) hover:text-(--text-primary)"
1628
onClick={() => setOpen(false)}
@@ -21,27 +33,33 @@ export function PortfolioDialog({ open, setOpen, addPortfolio }) {
2133
</DialogDismiss>
2234
</div>
2335
<form
24-
id='newPortfolio'
36+
id="newPortfolio"
2537
onSubmit={(e) => {
2638
e.preventDefault()
2739
const form = e.target as HTMLFormElement
2840
const formData = new FormData(form)
2941
const name = formData.get('name') as string
30-
addPortfolio(name)
42+
onSubmit(name)
3143
setOpen(false)
3244
form.reset()
3345
}}
3446
>
3547
<label className="flex flex-col gap-1">
36-
<span className="text-sm text-(--text-secondary)">Enter the name of your new portfolio</span>
48+
<span className="text-sm text-(--text-secondary)">{description}</span>
3749
<input
3850
required
3951
className="rounded-md border border-(--form-control-border) bg-white p-2 text-black disabled:opacity-50 dark:bg-black dark:text-white"
4052
name="name"
4153
/>
4254
</label>
4355
</form>
44-
<button type='submit' form='newPortfolio' className="mt-3 rounded-md bg-(--link-active-bg) p-3 text-white disabled:opacity-50">Save</button>
56+
<button
57+
type="submit"
58+
form="newPortfolio"
59+
className="mt-3 rounded-md bg-(--link-active-bg) p-3 text-white disabled:opacity-50"
60+
>
61+
Save
62+
</button>
4563
</Dialog>
4664
)
4765
}

src/components/Nav/Desktop.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,14 @@ const LinkToPage = React.memo(function LinkToPage({
210210
asPath: string
211211
}) {
212212
const isActive = route === asPath.split('/?')[0].split('?')[0]
213+
const isExternal = route.startsWith('http')
213214

214215
return (
215216
<BasicLink
216217
href={route}
217218
data-linkactive={isActive}
219+
target={isExternal ? '_blank' : undefined}
220+
rel={isExternal ? 'noopener noreferrer' : undefined}
218221
className="group/link -ml-1.5 flex flex-1 items-center gap-3 rounded-md p-1.5 hover:bg-black/5 focus-visible:bg-black/5 data-[linkactive=true]:bg-(--link-active-bg) data-[linkactive=true]:text-white dark:hover:bg-white/10 dark:focus-visible:bg-white/10"
219222
>
220223
{icon ? (

src/components/Nav/Mobile/Menu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,13 @@ const LinkToPage = React.memo(function LinkToPage({
168168
setShow: (show: boolean) => void
169169
}) {
170170
const isActive = route === asPath.split('/?')[0].split('?')[0]
171+
const isExternal = route.startsWith('http')
172+
171173
return (
172174
<BasicLink
173175
href={route}
176+
target={isExternal ? '_blank' : undefined}
177+
rel={isExternal ? 'noopener noreferrer' : undefined}
174178
data-linkactive={isActive}
175179
className="-ml-1.5 flex items-center gap-3 rounded-md p-1.5 hover:bg-black/5 focus-visible:bg-black/5 data-[linkactive=true]:bg-(--link-active-bg) data-[linkactive=true]:text-white dark:hover:bg-white/10 dark:focus-visible:bg-white/10"
176180
onClick={() => setShow(false)}

src/containers/Correlations/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ export default function Correlations({ coinsData }) {
139139
)
140140

141141
useEffect(() => {
142+
if (!router.isReady) return
143+
142144
if (!queryCoins?.length)
143145
router.replace(
144146
{
@@ -151,7 +153,7 @@ export default function Correlations({ coinsData }) {
151153
undefined,
152154
{ shallow: true }
153155
)
154-
}, [queryCoins, router])
156+
}, [queryCoins, router, router.isReady])
155157

156158
const dialogStore = Ariakit.useDialogStore()
157159

src/containers/DeFiWatchlist/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMemo, useState } from 'react'
22
import { useRouter } from 'next/router'
3+
import { DialogForm } from '~/components/DialogForm'
34
import { Icon } from '~/components/Icon'
45
import { Menu } from '~/components/Menu'
56
import { SelectWithCombobox } from '~/components/SelectWithCombobox'
@@ -10,7 +11,6 @@ import { ChainProtocolsTable } from '../ChainOverview/Table'
1011
import { IProtocol } from '../ChainOverview/types'
1112
import { useGroupAndFormatChains } from '../ChainsByCategory'
1213
import { WatchListTabs } from '../Yields/Watchlist'
13-
import { PortfolioDialog } from './PortfolioDialog'
1414

1515
export function DefiWatchlistContainer({ protocols, chains }) {
1616
const [extraTvlsEnabled] = useLocalStorageSettingsManager('tvl')
@@ -218,7 +218,13 @@ function PortfolioSelection({
218218
onItemClick={(value) => setSelectedPortfolio(value)}
219219
className="relative flex min-w-[120px] cursor-pointer flex-nowrap items-center justify-between gap-2 rounded-md border border-(--form-control-border) px-3 py-2 text-sm font-medium text-(--text-primary) hover:bg-(--link-hover-bg) focus-visible:bg-(--link-hover-bg)"
220220
/>
221-
<PortfolioDialog open={open} setOpen={setOpen} addPortfolio={addPortfolio} />
221+
<DialogForm
222+
title="New Portfolio"
223+
description="Enter the name of your new portfolio"
224+
open={open}
225+
setOpen={setOpen}
226+
onSubmit={addPortfolio}
227+
/>
222228
<button
223229
onClick={() => setOpen(true)}
224230
className="flex items-center gap-2 rounded-md border border-(--form-control-border) px-3 py-2 text-sm text-(--text-primary) transition-colors hover:bg-(--link-hover-bg) focus-visible:bg-(--link-hover-bg)"

src/containers/LlamaAI/components/ChartRenderer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const SingleChart = memo(function SingleChart({ config, data, isActive }: Single
141141
grid: {
142142
top: 24,
143143
right: 12,
144-
bottom: 12,
144+
bottom: 68,
145145
left: 12
146146
},
147147
tooltip: {
@@ -233,12 +233,11 @@ const SingleChart = memo(function SingleChart({ config, data, isActive }: Single
233233
],
234234
title: config.title,
235235
valueSymbol: config.valueSymbol || '$',
236-
height: '300px',
237-
hideDataZoom: true,
236+
height: '360px',
238237
xAxisType: 'category',
239238
chartOptions: {
240239
grid: {
241-
bottom: 12,
240+
bottom: 68,
242241
left: 12,
243242
right: 12
244243
},

0 commit comments

Comments
 (0)