-
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.
8 of N pull requests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced a new `PortfolioPage` component to display user portfolio information. - Added `PortfolioPageView` component for structured financial data presentation. - **Improvements** - Enhanced the `HomePage` layout for better readability and organization. - Updated styles for improved user experience across components. - **Bug Fixes** - Removed unnecessary debug information from the `Form` component. - **Dependency Updates** - Upgraded several `@account-kit` dependencies to stable versions. - Updated `vite` and `vite-plugin-dts` versions across multiple packages for improved performance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Marcin Ciarka <marcin@oazoapps.com>
- Loading branch information
1 parent
b00e22d
commit 9c978c1
Showing
131 changed files
with
1,419 additions
and
519 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
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,10 +1,27 @@ | ||
import { Text } from '@summerfi/app-earn-ui' | ||
import Link from 'next/link' | ||
|
||
export default function HomePage() { | ||
return ( | ||
<div style={{ display: 'flex', gap: '8px', flexDirection: 'column', alignItems: 'center' }}> | ||
Hello 🙌 If youre seeing this page, it means that the app is running correctly. Have a great | ||
day, I love you ❤️ BTW you are probably looking for <Link href="/earn">Earn page</Link> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
gap: '8px', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
textAlign: 'center', | ||
}} | ||
> | ||
<Text as="p" variant="p2"> | ||
Hello 🙌 If youre seeing this page, it means that the app is running correctly. | ||
<br /> | ||
Have a great day, I love you ❤️ | ||
<br /> <br /> | ||
BTW you are probably looking for the{' '} | ||
<Link href="/earn" style={{ display: 'inline', color: 'var(--color-text-link)' }}> | ||
Earn page | ||
</Link> | ||
</Text> | ||
</div> | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
apps/earn-protocol/app/portfolio/[wallet_address]/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,13 @@ | ||
import { PortfolioPageView } from '@/components/layout/PortfolioPageView/PortfolioPageView' | ||
|
||
type PortfolioPageProps = { | ||
params: { | ||
wallet_address: string | ||
} | ||
} | ||
|
||
const PortfolioPage = ({ params }: PortfolioPageProps) => { | ||
return <PortfolioPageView walletAddress={params.wallet_address} /> | ||
} | ||
|
||
export default PortfolioPage |
27 changes: 27 additions & 0 deletions
27
apps/earn-protocol/components/layout/PortfolioPageView/PortfolioPageView.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,27 @@ | ||
'use client' | ||
|
||
import { type FC } from 'react' | ||
import { TabBar } from '@summerfi/app-earn-ui' | ||
|
||
import { PortfolioHeader } from '@/features/portfolio/PortfolioHeader/PortfolioHeader' | ||
import { PortfolioOverview } from '@/features/portfolio/PortfolioOverview/PortfolioOverview' | ||
|
||
const tabs = [ | ||
{ label: 'Overview', content: <PortfolioOverview /> }, | ||
{ label: 'Wallet', content: <div>Wallet content here</div> }, | ||
{ label: 'Rebalance Activity', content: <div>Rebalance content here</div> }, | ||
{ label: 'Rewards', content: <div>Rewards content here</div> }, | ||
] | ||
|
||
interface PortfolioPageViewProps { | ||
walletAddress: string | ||
} | ||
|
||
export const PortfolioPageView: FC<PortfolioPageViewProps> = ({ walletAddress }) => { | ||
return ( | ||
<div style={{ display: 'flex', flexDirection: 'column' }}> | ||
<PortfolioHeader walletAddress={walletAddress} /> | ||
<TabBar tabs={tabs} /> | ||
</div> | ||
) | ||
} |
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
72 changes: 72 additions & 0 deletions
72
apps/earn-protocol/features/portfolio/PortfolioHeader/PortfolioHeader.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,72 @@ | ||
import { type FC } from 'react' | ||
import { Button, DataBlock, Icon, Text } from '@summerfi/app-earn-ui' | ||
import { formatAddress } from '@summerfi/app-utils' | ||
|
||
interface PortfolioHeaderProps { | ||
walletAddress: string | ||
} | ||
|
||
export const PortfolioHeader: FC<PortfolioHeaderProps> = ({ walletAddress }) => { | ||
return ( | ||
<> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
flexWrap: 'wrap', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Text as="h2" variant="h2"> | ||
Portfolio | ||
</Text> | ||
<div style={{ display: 'flex', gap: 'var(--spacing-space-x-small)' }}> | ||
<Button variant="secondaryLarge" style={{ minWidth: 'unset' }}> | ||
Send | ||
</Button> | ||
<Button variant="secondaryLarge" style={{ minWidth: 'unset' }}> | ||
Swap | ||
</Button> | ||
<Button variant="primaryLarge" style={{ minWidth: '156px' }}> | ||
Add funds | ||
<Icon iconName="chevron_down" color="rgba(255, 251, 253, 1)" variant="xs" /> | ||
</Button> | ||
</div> | ||
</div> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
flexWrap: 'wrap', | ||
alignItems: 'center', | ||
marginTop: 'var(--general-space-40)', | ||
marginBottom: 'var(--general-space-40)', | ||
}} | ||
> | ||
<div style={{ display: 'flex', gap: 'var(--spacing-space-x-small)', alignItems: 'center' }}> | ||
<Icon iconName="question_o" color="rgba(255, 73, 164, 1)" /> | ||
<Text as="p" variant="p1semi"> | ||
{formatAddress(walletAddress, { first: 6 })} | ||
</Text> | ||
<Icon iconName="edit" color="rgba(255, 73, 164, 1)" variant="s" /> | ||
</div> | ||
<div style={{ display: 'flex', gap: 'var(--spacing-space-large)', alignItems: 'center' }}> | ||
<DataBlock | ||
title="Total $SUMR" | ||
value="313" | ||
titleSize="large" | ||
valueSize="large" | ||
valueStyle={{ textAlign: 'right' }} | ||
/> | ||
<DataBlock | ||
title="Total Wallet Value" | ||
value="$2.3m" | ||
titleSize="large" | ||
valueSize="large" | ||
valueStyle={{ textAlign: 'right' }} | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} |
95 changes: 95 additions & 0 deletions
95
apps/earn-protocol/features/portfolio/PortfolioOverview/PortfolioOverview.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,95 @@ | ||
import { | ||
Card, | ||
DataBlock, | ||
Icon, | ||
SlideCarousel, | ||
StrategyCard, | ||
Text, | ||
WithArrow, | ||
} from '@summerfi/app-earn-ui' | ||
import Link from 'next/link' | ||
|
||
import { MockedLineChart } from '@/components/organisms/Charts/MockedLineChart' | ||
import { strategiesList } from '@/constants/dev-strategies-list' | ||
|
||
const dataBlocks = [ | ||
{ | ||
title: 'Total Summer.fi Portfolio', | ||
value: '$100,233.32', | ||
gradient: 'var(--gradient-earn-protocol-light)', | ||
titleColor: 'var(--earn-protocol-secondary-60)', | ||
}, | ||
{ | ||
title: 'SUMR Token Rewards', | ||
value: '45,232 $SUMR', | ||
}, | ||
{ | ||
title: 'Available to Migrate', | ||
value: '$1002,322,32', | ||
subValue: ( | ||
<Link href="/"> | ||
<WithArrow as="p" variant="p3semi" style={{ color: 'var(--earn-protocol-primary-100)' }}> | ||
Migrate | ||
</WithArrow> | ||
</Link> | ||
), | ||
}, | ||
] | ||
|
||
export const PortfolioOverview = () => { | ||
return ( | ||
<div> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
gap: 'var(--general-space-16)', | ||
flexWrap: 'wrap', | ||
}} | ||
> | ||
{dataBlocks.map((item) => ( | ||
<Card key={item.title} style={{ flex: 1, background: item.gradient, minHeight: '142px' }}> | ||
<DataBlock | ||
title={item.title} | ||
titleStyle={{ color: item.titleColor }} | ||
value={item.value} | ||
valueSize="large" | ||
subValue={item.subValue} | ||
/> | ||
</Card> | ||
))} | ||
<Card style={{ flexDirection: 'column' }}> | ||
<Text as="h5" variant="h5"> | ||
Positions | ||
</Text> | ||
<MockedLineChart /> | ||
<div style={{ width: '100%', marginTop: 'var(--general-space-24)' }}> | ||
<SlideCarousel | ||
slides={strategiesList.map((strategy) => ( | ||
<StrategyCard | ||
key={strategy.id} | ||
{...strategy} | ||
secondary | ||
withHover | ||
// eslint-disable-next-line no-console | ||
onClick={(item) => console.log('strategy clicked', item)} | ||
/> | ||
))} | ||
options={{ slidesToScroll: 'auto' }} | ||
title={ | ||
<div | ||
style={{ display: 'flex', gap: 'var(--general-space-8)', alignItems: 'center' }} | ||
> | ||
<Icon iconName="stars" variant="s" color="rgba(255, 251, 253, 1)" /> | ||
<Text as="p" variant="p3semi"> | ||
You might like | ||
</Text> | ||
</div> | ||
} | ||
/> | ||
</div> | ||
</Card> | ||
</div> | ||
</div> | ||
) | ||
} |
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
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
Oops, something went wrong.