-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5 of N pull requests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced new components: `EarnNetworkSelectedStrategyPage` and `EarnNetworkStrategiesPage` for improved navigation and strategy selection. - Added a new `StrategiesListView` component for displaying a list of strategies in a grid layout. - Implemented `UserActivity` and `StrategyExposure` components for enhanced user interaction and strategy data presentation. - **Enhancements** - Improved layout and data presentation in the `EarnStrategyPage` with expandable sections for better organization of strategy details. - Updated the `Form` component to dynamically handle strategy data and improve user interface context. - **Bug Fixes** - Resolved layout issues in the `Carousel` component and ensured consistent behavior in the `AccountKitFeatures` component when the signer is unavailable. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Marcin Ciarka <[email protected]>
- Loading branch information
1 parent
1c764d4
commit 2e4e03c
Showing
91 changed files
with
2,439 additions
and
987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 9 additions & 56 deletions
65
...landing-page/components/organisms/LandingPageStrategyPicker/LandingPageStrategyPicker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,20 @@ | ||
import { type ChangeEvent, useState } from 'react' | ||
import { Sidebar, SidebarFootnote, sidebarFootnote, StrategyCard } from '@summerfi/app-earn-ui' | ||
import { type DropdownOption, type Risk, type TokenSymbolsList } from '@summerfi/app-types' | ||
import { mapNumericInput } from '@summerfi/app-utils' | ||
'use client' | ||
|
||
import { StrategyCard, StrategySimulationForm } from '@summerfi/app-earn-ui' | ||
|
||
import { type strategiesList } from '@/constants/dev-strategies-list' | ||
|
||
import classNames from '@/components/organisms/LandingPageStrategyPicker/LandingPageStrategyPicker.module.scss' | ||
|
||
export const LandingPageStrategyPicker = ({ | ||
apy, | ||
symbol, | ||
risk, | ||
totalAssets, | ||
bestFor, | ||
options, | ||
strategy, | ||
}: { | ||
id: string | ||
apy: string | ||
symbol: TokenSymbolsList | ||
risk: Risk | ||
totalAssets: string | ||
bestFor: string | ||
options: DropdownOption[] | ||
strategy: (typeof strategiesList)[number] | ||
}) => { | ||
const [value, setValue] = useState(mapNumericInput('10000')) | ||
|
||
const handleChange = (e: ChangeEvent<HTMLInputElement>) => { | ||
setValue(mapNumericInput(e.target.value)) | ||
} | ||
|
||
const dropdownValue = options.find((option) => option.value === symbol) || options[0] | ||
|
||
const sidebarProps = { | ||
title: 'Deposit', | ||
inputValue: value, | ||
dropdown: { value: dropdownValue, options }, | ||
handleInputChange: handleChange, | ||
banner: { | ||
title: 'Estimated earnings after 1 year', | ||
value: '67,353 USDC', | ||
}, | ||
primaryButton: { | ||
label: 'Get Started', | ||
action: () => null, | ||
disabled: false, | ||
}, | ||
footnote: ( | ||
<SidebarFootnote | ||
title={sidebarFootnote.title} | ||
list={sidebarFootnote.list} | ||
tooltip={{ style: sidebarFootnote.tooltip.style, showAbove: true }} | ||
/> | ||
), | ||
} | ||
|
||
return ( | ||
<div className={classNames.wrapper}> | ||
<StrategyCard | ||
apy={apy} | ||
bestFor={bestFor} | ||
symbol={symbol} | ||
risk={risk} | ||
totalAssets={totalAssets} | ||
/> | ||
<Sidebar {...sidebarProps} /> | ||
<StrategyCard {...strategy} /> | ||
<StrategySimulationForm strategyData={strategy} /> | ||
</div> | ||
) | ||
} |
64 changes: 64 additions & 0 deletions
64
apps/earn-protocol-landing-page/constants/dev-strategies-list.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { NetworkNames, type Risk, type TokenSymbolsList } from '@summerfi/app-types' | ||
|
||
export const strategiesList = [ | ||
{ | ||
id: 'USDT-ethereum-high', | ||
symbol: 'USDT' as TokenSymbolsList, | ||
network: NetworkNames.ethereumMainnet, | ||
apy: '3.2', | ||
tokenBonus: '1.1%', | ||
bestFor: 'Higher yields', | ||
risk: 'high' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
{ | ||
id: 'USDC-ethereum-low', | ||
symbol: 'USDC' as TokenSymbolsList, | ||
network: NetworkNames.ethereumMainnet, | ||
apy: '7.2', | ||
tokenBonus: '2.1%', | ||
bestFor: 'Lending only exposure', | ||
risk: 'low' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
{ | ||
id: 'ETH-ethereum-high', | ||
symbol: 'ETH' as TokenSymbolsList, | ||
network: NetworkNames.ethereumMainnet, | ||
apy: '2.1', | ||
tokenBonus: '2.1%', | ||
bestFor: 'Higher yields', | ||
risk: 'high' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
{ | ||
id: 'ETH-base-high', | ||
symbol: 'ETH' as TokenSymbolsList, | ||
network: NetworkNames.baseMainnet, | ||
apy: '2.1', | ||
tokenBonus: '2.1%', | ||
bestFor: 'Lending only exposure', | ||
risk: 'high' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
{ | ||
id: 'DAI-base-medium', | ||
symbol: 'DAI' as TokenSymbolsList, | ||
network: NetworkNames.baseMainnet, | ||
apy: '2.1', | ||
tokenBonus: '2.1%', | ||
bestFor: 'Higher yields', | ||
risk: 'medium' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
{ | ||
id: 'AAVE-base-low', | ||
symbol: 'AAVE' as TokenSymbolsList, | ||
network: NetworkNames.baseMainnet, | ||
apy: '2.1', | ||
tokenBonus: '2.1%', | ||
bestFor: 'Lending only exposure', | ||
risk: 'low' as Risk, | ||
totalAssets: '800,130,321', | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,4 @@ module.exports = { | |
sourceType: 'module', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
rules: { | ||
'no-magic-numbers': 'off', | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/earn-protocol/app/earn/[network]/[strategy_id]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { type NetworkNames } from '@summerfi/app-types' | ||
|
||
import { StrategiesListView } from '@/components/layout/StrategiesListView/StrategiesListView' | ||
|
||
const EarnNetworkSelectedStrategyPage = ({ | ||
params, | ||
}: { | ||
params: { | ||
network: NetworkNames | ||
strategy_id: string | ||
} | ||
}) => { | ||
// particular strategy loaded | ||
return ( | ||
<StrategiesListView selectedNetwork={params.network} selectedStrategy={params.strategy_id} /> | ||
) | ||
} | ||
|
||
export default EarnNetworkSelectedStrategyPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { type NetworkNames } from '@summerfi/app-types' | ||
|
||
import { StrategiesListView } from '@/components/layout/StrategiesListView/StrategiesListView' | ||
|
||
type EarnNetworkStrategiesPageProps = { | ||
params: { | ||
network: NetworkNames | 'all-networks' | ||
} | ||
} | ||
|
||
const EarnNetworkStrategiesPage = ({ params }: EarnNetworkStrategiesPageProps) => { | ||
// list of strategies (for a network) | ||
return <StrategiesListView selectedNetwork={params.network} /> | ||
} | ||
|
||
export default EarnNetworkStrategiesPage |
Oops, something went wrong.