-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🍿 [Portfolio] New portfolio view (#3052)
* 🍿 [Portfolio] Route component (#3030) * New portfolio empty page * new portfolio link * 🍿 [Portfolio] Wallet endpoint (#3038) * Added api/portfolio/wallet endpoint, some types, logging on the new empty portfolio page * add debank env * remove switch * 🍿 [Portfolio] Positions mock (#3043) * mock skeleton * new reply types * the rest of the mock and types * 🍿 [Portfolio] First batch of components - header + overview (#3056) * PortfolioHeader and PortfolioLayout * PortfolioOverview, PortfolioOverviewItem and Tag component + i18n type fixes * fancy supplied number * type fixes + rwd simple view * 🍿 [Portfolio] Second batch of components (#3059) * separated change helpers (#3063) * Added lambdas and infra provisioning (#3048) * Added lambdas and infra provisioning * Added infra integration helpers Added new infra env variables Added infra documentation * Updated lambda build flow * Fixed local dev bug in getProductBorrowNavItems.ts * fixed undefined issue * improved validation * cleanup * format fix * updated ts config * fix lint * tsc check * test * cleanup * test * moved server side call to fe * added cors headers * Refactored to use shared validators Added new lambdas for positions and assers * install lambdas deps on post * fix * fix review comments * Pw/integrate-lambdas (#3068) * improved error handling * added backend client integrated views with backend integrated lambda with fe types * added mock to lambda * 🍿 [Portfolio] Position components (#3064) * Portfolio wallet tab (#3069) * summary * PortfolioWalletSummary * top assets * real data + skeleton * top assets data connection * assets list * assets list * parse products * list with products * guards * resolve wallet changes --------- Co-authored-by: codesandbox-bot <[email protected]> * 🍿 [Portfolio] Build fixes (#3071) * fixes and updates to lambdas (#3072) * fixes and updates to lambdas * fixed comments --------- Co-authored-by: Marcin Ciarka <[email protected]> * Fixed types naming * Fixed lambda logic Updated overview * Fixed portfolio overview --------- Co-authored-by: Piotr Konowrocki <[email protected]> Co-authored-by: Piotr Witek <[email protected]> Co-authored-by: codesandbox-bot <[email protected]>
- Loading branch information
1 parent
b153806
commit 84be14e
Showing
234 changed files
with
9,106 additions
and
1,144 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 |
---|---|---|
|
@@ -13,6 +13,8 @@ yalc.lock | |
.log | ||
.DS_Store | ||
.sentryclirc | ||
*.zip | ||
artifacts | ||
|
||
public/precache.*.*.js | ||
public/sw.js | ||
|
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 |
---|---|---|
|
@@ -11,3 +11,5 @@ coverage | |
.run | ||
.swc | ||
.vercel | ||
jest.config.js | ||
setup.js |
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
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,26 @@ | ||
import { NetworkNames } from './network-names' | ||
|
||
// based on https://docs.cloud.debank.com/en/readme/api-pro-reference/chain#returns-1 | ||
export enum DebankNetworkNames { | ||
ethereumMainnet = 'eth', | ||
arbitrumMainnet = 'arb', | ||
polygonMainnet = 'matic', | ||
optimismMainnet = 'op', | ||
baseMainnet = 'base', | ||
} | ||
|
||
export const DebankNetworkNameToOurs = { | ||
[DebankNetworkNames.ethereumMainnet]: NetworkNames.ethereumMainnet, | ||
[DebankNetworkNames.arbitrumMainnet]: NetworkNames.arbitrumMainnet, | ||
[DebankNetworkNames.polygonMainnet]: NetworkNames.polygonMainnet, | ||
[DebankNetworkNames.optimismMainnet]: NetworkNames.optimismMainnet, | ||
[DebankNetworkNames.baseMainnet]: NetworkNames.baseMainnet, | ||
} | ||
|
||
export const OursNameToDebankNetworkName = { | ||
[NetworkNames.ethereumMainnet]: DebankNetworkNames.ethereumMainnet, | ||
[NetworkNames.arbitrumMainnet]: DebankNetworkNames.arbitrumMainnet, | ||
[NetworkNames.polygonMainnet]: DebankNetworkNames.polygonMainnet, | ||
[NetworkNames.optimismMainnet]: DebankNetworkNames.optimismMainnet, | ||
[NetworkNames.baseMainnet]: DebankNetworkNames.baseMainnet, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Icon } from 'components/Icon' | ||
import { StatefulTooltip } from 'components/Tooltip' | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { auto_buy, auto_sell, stop_loss, take_profit } from 'theme/icons' | ||
import { Text } from 'theme-ui' | ||
|
||
import type { PortfolioPosition } from 'lambdas/src/portfolio-positions/types' | ||
|
||
const automationIconMap: Record<keyof PortfolioPosition['automations'], typeof stop_loss> = { | ||
autoBuy: auto_buy, | ||
autoSell: auto_sell, | ||
takeProfit: take_profit, | ||
stopLoss: stop_loss, | ||
} | ||
|
||
export const AutomationIcon = ({ | ||
enabled, | ||
type, | ||
}: { | ||
enabled: boolean | ||
type: keyof PortfolioPosition['automations'] | ||
}) => { | ||
const { t: tPortfolio } = useTranslation('portfolio') | ||
return ( | ||
<StatefulTooltip | ||
tooltip={<Text variant="paragraph4">{tPortfolio(`automation-details.${type}`)}</Text>} | ||
tooltipSx={{ | ||
mt: '-98px', // just above the icon | ||
height: '58px', | ||
borderRadius: 'medium', | ||
}} | ||
containerSx={{ | ||
width: '34px', | ||
height: '34px', | ||
backgroundColor: enabled ? 'success100' : 'secondary60', | ||
':hover': { | ||
backgroundColor: enabled ? 'success10' : 'secondary60', | ||
'& path': { | ||
color: enabled ? 'success100' : 'primary60', | ||
}, | ||
}, | ||
cursor: 'pointer', | ||
borderRadius: 'round', | ||
mr: 2, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<Icon | ||
icon={automationIconMap[type]} | ||
size={20} | ||
sx={{ | ||
'& path': { | ||
color: enabled ? 'white' : 'primary60', | ||
}, | ||
}} | ||
/> | ||
</StatefulTooltip> | ||
) | ||
} |
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.