Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add portfolio liquidity #2436

Closed
wants to merge 159 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
fbaac87
wip
nguyenhoaidanh Nov 1, 2023
1645516
done detail page
nguyenhoaidanh Nov 2, 2023
59fc538
menu edit
nguyenhoaidanh Nov 2, 2023
97d3196
edit delete
nguyenhoaidanh Nov 3, 2023
51d2df2
reuse profile content
nguyenhoaidanh Nov 3, 2023
1edabd4
fix: ui
nguyenhoaidanh Nov 5, 2023
fd7a23a
allowance tab
nguyenhoaidanh Nov 6, 2023
de57a4e
can revoke allowance
nguyenhoaidanh Nov 6, 2023
383de9c
wip: transaction tabs
nguyenhoaidanh Nov 7, 2023
c827ba8
connect api create and delete
nguyenhoaidanh Nov 7, 2023
2244066
title
nguyenhoaidanh Nov 7, 2023
fdbd01b
done crud
nguyenhoaidanh Nov 8, 2023
054fdf6
add connect wallet
nguyenhoaidanh Nov 9, 2023
05c033b
fix render false
nguyenhoaidanh Nov 9, 2023
79316e8
fix menu click
nguyenhoaidanh Nov 9, 2023
22cac15
dont required acess token
nguyenhoaidanh Nov 9, 2023
7036350
update suggest name
nguyenhoaidanh Nov 9, 2023
06ec301
fix: display name
nguyenhoaidanh Nov 9, 2023
19a711e
use isfetching instead
nguyenhoaidanh Nov 9, 2023
720fc5f
rm options
nguyenhoaidanh Nov 9, 2023
9344be9
add menu
nguyenhoaidanh Nov 9, 2023
2332238
fix: loading
nguyenhoaidanh Nov 9, 2023
fa631f8
add txs
nguyenhoaidanh Nov 9, 2023
d9da338
chore: typo
nguyenhoaidanh Nov 12, 2023
e4764ff
done mobile tut
nguyenhoaidanh Nov 13, 2023
d146ed4
add title
nguyenhoaidanh Nov 13, 2023
cd53daa
add step title
nguyenhoaidanh Nov 13, 2023
1e70ba9
done txs
nguyenhoaidanh Nov 13, 2023
97aaf1b
add image
nguyenhoaidanh Nov 13, 2023
f4761fa
only show tutorial when account connect
nguyenhoaidanh Nov 13, 2023
a18f287
max length portfolio name
nguyenhoaidanh Nov 14, 2023
c3cb219
done txs ui
nguyenhoaidanh Nov 14, 2023
58a57bf
show wallet
nguyenhoaidanh Nov 14, 2023
37571b0
update path
nguyenhoaidanh Nov 14, 2023
26e42f3
update btn portfolio
nguyenhoaidanh Nov 14, 2023
e59ce08
can clone portfolio
nguyenhoaidanh Nov 14, 2023
30aaeac
save portfolio settings
nguyenhoaidanh Nov 14, 2023
543a14c
can add wallet to portfolio
nguyenhoaidanh Nov 14, 2023
5888af0
done clone flow
nguyenhoaidanh Nov 14, 2023
2fa6ff2
css table
nguyenhoaidanh Nov 14, 2023
2527cb9
can search
nguyenhoaidanh Nov 15, 2023
980ddb8
can search histoty
nguyenhoaidanh Nov 15, 2023
7800431
fix dont show wallet
nguyenhoaidanh Nov 15, 2023
a4d350b
add cursor pointer
nguyenhoaidanh Nov 15, 2023
c4f10a8
css
nguyenhoaidanh Nov 15, 2023
e09975e
nft page
nguyenhoaidanh Nov 15, 2023
6cf481a
fetch muliti addresss 2 tab
nguyenhoaidanh Nov 16, 2023
ed20be1
fetch more txs
nguyenhoaidanh Nov 16, 2023
bd4daf7
done nft
nguyenhoaidanh Nov 16, 2023
b33cd65
add transfer
nguyenhoaidanh Nov 16, 2023
0f92561
refactor nft
nguyenhoaidanh Nov 16, 2023
ca19eb2
bff api
nguyenhoaidanh Nov 17, 2023
4f88951
bff api
nguyenhoaidanh Nov 17, 2023
e1b4823
done draft mobile
nguyenhoaidanh Nov 17, 2023
f52183b
update ux
nguyenhoaidanh Nov 17, 2023
83261c5
reuse component
nguyenhoaidanh Nov 17, 2023
18f3eb2
mobile table
nguyenhoaidanh Nov 17, 2023
78e858f
fix col group
nguyenhoaidanh Nov 17, 2023
1e28c98
update ux
nguyenhoaidanh Nov 18, 2023
d64dc3c
reuse component
nguyenhoaidanh Nov 18, 2023
3de06ad
refactor props
nguyenhoaidanh Nov 18, 2023
ce303a5
allow search more
nguyenhoaidanh Nov 19, 2023
40d49ff
connect api realtime
nguyenhoaidanh Nov 22, 2023
7ae058b
connect api realtime
nguyenhoaidanh Nov 22, 2023
6613a63
placeholder
nguyenhoaidanh Nov 22, 2023
3399fb5
connect api assets
nguyenhoaidanh Nov 23, 2023
4ede91c
wip
nguyenhoaidanh Nov 23, 2023
1e65c76
update tooltip
nguyenhoaidanh Nov 23, 2023
5189116
update ux
nguyenhoaidanh Nov 23, 2023
bcf718f
fix build
nguyenhoaidanh Nov 23, 2023
9e5d14d
update ux
nguyenhoaidanh Nov 23, 2023
27ffffc
connect bff search
nguyenhoaidanh Nov 24, 2023
2bd69a0
format %
nguyenhoaidanh Nov 24, 2023
9b4bb80
fix msg
nguyenhoaidanh Nov 24, 2023
7283b56
fix search result mobile
nguyenhoaidanh Nov 24, 2023
90eac14
fix css
nguyenhoaidanh Nov 24, 2023
e71d4c9
aligin
nguyenhoaidanh Nov 24, 2023
86e4f0b
share data
nguyenhoaidanh Nov 24, 2023
973a354
share logo portfolio
nguyenhoaidanh Nov 24, 2023
744091d
fix display txs gas
nguyenhoaidanh Nov 27, 2023
2df389e
update usd in chart
nguyenhoaidanh Nov 27, 2023
d7a229f
sync total usd
nguyenhoaidanh Nov 27, 2023
051dede
sync loading
nguyenhoaidanh Nov 27, 2023
73f1231
update ux
nguyenhoaidanh Nov 27, 2023
3ef6363
done wallet info
nguyenhoaidanh Nov 27, 2023
591f863
fix: cancel revoke
nguyenhoaidanh Nov 27, 2023
a604ef3
done share ui
nguyenhoaidanh Nov 27, 2023
ff35f67
share
nguyenhoaidanh Nov 28, 2023
d14b30a
use proxy
nguyenhoaidanh Nov 28, 2023
18ba283
resolve todo
nguyenhoaidanh Nov 28, 2023
8c131a0
refactor
nguyenhoaidanh Nov 28, 2023
dd0dec9
refetch portfolio
nguyenhoaidanh Nov 29, 2023
c71af79
new UI NFT
nguyenhoaidanh Nov 29, 2023
7bb7c76
Merge remote-tracking branch 'origin/main' into portfolio
nguyenhoaidanh Nov 29, 2023
b05cdac
ux share
nguyenhoaidanh Nov 29, 2023
a2ed31e
fix ci
nguyenhoaidanh Nov 29, 2023
f9b3043
update share url
nguyenhoaidanh Nov 29, 2023
f590327
update url
nguyenhoaidanh Nov 29, 2023
c60b592
update time
nguyenhoaidanh Nov 29, 2023
0ae2c6e
fix navigate portfolio
nguyenhoaidanh Nov 29, 2023
cbe0896
fix infinite loading
nguyenhoaidanh Nov 29, 2023
186da19
fix: infinite loading
nguyenhoaidanh Nov 29, 2023
d0aa3fb
update ux
nguyenhoaidanh Nov 29, 2023
f1423dc
update column label
nguyenhoaidanh Nov 29, 2023
0dbdcf6
fraction digit
nguyenhoaidanh Nov 29, 2023
b9940df
cache portfolio
nguyenhoaidanh Nov 29, 2023
b991b8b
fix: wrong url
nguyenhoaidanh Nov 29, 2023
3687afc
fix lazy
nguyenhoaidanh Nov 30, 2023
64b40c4
add total usd
nguyenhoaidanh Nov 30, 2023
7f44b80
fix import
nguyenhoaidanh Nov 30, 2023
b282510
fix switch portfolio
nguyenhoaidanh Nov 30, 2023
f91de36
update logic navigate
nguyenhoaidanh Nov 30, 2023
683dfb0
send nft fn
nguyenhoaidanh Nov 30, 2023
c91d8d5
Merge remote-tracking branch 'origin/main' into portfolio
nguyenhoaidanh Nov 30, 2023
0a55c6b
cache
nguyenhoaidanh Dec 1, 2023
d9a8667
cache
nguyenhoaidanh Dec 1, 2023
e11e48a
typo
nguyenhoaidanh Dec 1, 2023
942cc39
fix ui empty
nguyenhoaidanh Dec 1, 2023
96bd476
update note
nguyenhoaidanh Dec 1, 2023
6b0b55e
add pagesize
nguyenhoaidanh Dec 1, 2023
a22debb
expand search
nguyenhoaidanh Dec 1, 2023
72a3e3c
allow add wallet
nguyenhoaidanh Dec 1, 2023
ff297ee
fix: display add portfolio
nguyenhoaidanh Dec 1, 2023
3ed04c7
fix: select portfolio ops
nguyenhoaidanh Dec 1, 2023
a1e53b2
update ux
nguyenhoaidanh Dec 1, 2023
8aaf522
update feedback
nguyenhoaidanh Dec 1, 2023
813d9e5
css
nguyenhoaidanh Dec 1, 2023
8826bd5
add back btn
nguyenhoaidanh Dec 2, 2023
b65f233
Merge remote-tracking branch 'origin/main' into portfolio
nguyenhoaidanh Dec 4, 2023
bfbab20
clearable
nguyenhoaidanh Dec 4, 2023
c1685ce
can send nft
nguyenhoaidanh Dec 4, 2023
c670b53
fix: nodata
nguyenhoaidanh Dec 4, 2023
7a1a151
fix reset search
nguyenhoaidanh Dec 4, 2023
86644d1
update position
nguyenhoaidanh Dec 4, 2023
cb4689a
hide search when nft = 1
nguyenhoaidanh Dec 4, 2023
379d3a9
css
nguyenhoaidanh Dec 4, 2023
53bb356
fix all chain
nguyenhoaidanh Dec 4, 2023
43f3aef
update error msg
nguyenhoaidanh Dec 4, 2023
e4149ea
fix can not favorite
nguyenhoaidanh Dec 4, 2023
09122fc
wip
nguyenhoaidanh Dec 4, 2023
46dc23a
polling interval
nguyenhoaidanh Dec 5, 2023
6083451
setup liquidity
nguyenhoaidanh Dec 5, 2023
2c97c2a
allow filter columns
nguyenhoaidanh Dec 5, 2023
5175d28
auto show create
nguyenhoaidanh Dec 5, 2023
8aaec42
Merge branch 'main' into portfolio
nguyenhoaidanh Dec 5, 2023
d18d962
resolve todo
nguyenhoaidanh Dec 5, 2023
f6a3b04
Merge remote-tracking branch 'origin/main' into portfolio
nguyenhoaidanh Dec 5, 2023
c026032
fix: header menu
nguyenhoaidanh Dec 6, 2023
5937a74
only show back when search
nguyenhoaidanh Dec 6, 2023
d98eb0b
fix icon arrow posiiton
nguyenhoaidanh Dec 6, 2023
952728e
allow copy img hook
nguyenhoaidanh Dec 6, 2023
b7ae146
Merge branch 'main' into portfolio
nguyenhoaidanh Dec 6, 2023
e3c37e4
fix: resize window share image
nguyenhoaidanh Dec 6, 2023
3607926
remove unused code
nguyenhoaidanh Dec 6, 2023
0de04a0
add liquidity portfolio
XiaoYhun Dec 7, 2023
1fe9c39
Merge remote-tracking branch 'origin/portfolio' into add-portfolio-li…
XiaoYhun Dec 7, 2023
53d7c75
fix warning
XiaoYhun Dec 7, 2023
677c395
redeploy
XiaoYhun Dec 7, 2023
b7cce10
update mobile
XiaoYhun Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
VITE_TAG: ${{ needs.prepare.outputs.image_tag }}
CURRENT_BRANCH: ${{ needs.prepare.outputs.current_branch }}
NODE_OPTIONS: '--max_old_space_size=4096'
run: yarn build
run: yarn build-dev

- name: Docker build and push
uses: docker/build-push-action@v2
Expand Down
Binary file added src/assets/images/default_avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/portfolio/nft_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/portfolio/portfolio1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/portfolio/portfolio2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/portfolio/portfolio3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/share/background_portfolio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/svg/nft_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/svg/portfolio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/svg/tokens_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/Announcement/Popups/TransactionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ const getTitle = (type: string, success: boolean) => {
}

const getSummary = (transaction: TransactionDetails) => {
const { type, hash, group } = transaction
const { type, hash } = transaction

const { success } = getTransactionStatus(transaction)

const shortHash = 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)
const shortHash = 'Hash: ' + getShortenAddress(hash)

const summary = group ? SUMMARY[type]?.(transaction) ?? shortHash : shortHash
const summary = SUMMARY[type]?.(transaction) ?? shortHash

let formatSummary,
title = getTitle(type, success)
Expand Down
28 changes: 28 additions & 0 deletions src/components/Badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { readableColor } from 'polished'
import { PropsWithChildren } from 'react'
import { Text } from 'rebass'
import styled, { DefaultTheme } from 'styled-components'

import { DropdownArrowIcon } from 'components/ArrowRotate'
import { Color } from 'theme/styled'
import { formatDisplayNumber } from 'utils/numbers'

export enum BadgeVariant {
DEFAULT = 'DEFAULT',
NEGATIVE = 'NEGATIVE',
POSITIVE = 'POSITIVE',
PRIMARY = 'PRIMARY',
BLUE = 'BLUE',
WHITE = 'WHITE',
WARNING = 'WARNING',

WARNING_OUTLINE = 'WARNING_OUTLINE',
Expand All @@ -26,6 +31,10 @@ function pickBackgroundColor(variant: BadgeVariant | undefined, theme: DefaultTh
return theme.green1
case BadgeVariant.PRIMARY:
return theme.primary + '33'
case BadgeVariant.BLUE:
return theme.blue + '33'
case BadgeVariant.WHITE:
return theme.white + '33'
case BadgeVariant.WARNING:
return theme.warning + '33'
case BadgeVariant.WARNING_OUTLINE:
Expand Down Expand Up @@ -54,6 +63,10 @@ function pickFontColor(variant: BadgeVariant | undefined, theme: DefaultTheme):
return theme.warning
case BadgeVariant.PRIMARY:
return theme.primary
case BadgeVariant.BLUE:
return theme.blue
case BadgeVariant.WHITE:
return theme.white
case BadgeVariant.WARNING_OUTLINE:
return theme.warning
default:
Expand All @@ -74,3 +87,18 @@ const Badge = styled.div<PropsWithChildren<BadgeProps>>`
`

export default Badge

// todo update my earning use this
export const PercentBadge = ({ percent }: { percent: number }) => {
return (
<Badge
variant={percent ? BadgeVariant.PRIMARY : BadgeVariant.NEGATIVE}
style={{ padding: '2px 10px 2px 2px', height: 'fit-content' }}
>
<DropdownArrowIcon rotate={percent > 0} />{' '}
<Text fontSize={'12px'} as="span" fontWeight={'500'}>
{formatDisplayNumber(percent, { style: 'percent', fractionDigits: 2 })}
</Text>
</Badge>
)
}
3 changes: 3 additions & 0 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ const StyledButtonAction = styled(RebassButton)<{ $color?: string }>`
background-color: ${({ theme, $color }) => ($color ? $color + '10' : theme.subText + '10')};
transform: translateY(2px);
}
:disabled {
cursor: not-allowed;
}
`

export const ButtonAction = ({
Expand Down
3 changes: 3 additions & 0 deletions src/components/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const CheckboxWrapper = styled.input`
position: relative;
transform: scale(1.35);
accent-color: ${({ theme }) => theme.primary};
&:focus-visible {
outline-width: 0;
}

:indeterminate::before {
content: '';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ModalConfirm: React.FC = () => {
</Text>
</RowBetween>

<Text as="span" fontSize="14px" color={theme.subText}>
<Text as="span" fontSize="14px" lineHeight={'20px'} color={theme.subText}>
{content}
</Text>

Expand Down
36 changes: 36 additions & 0 deletions src/components/DoubleLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Currency } from '@kyberswap/ks-sdk-core'
import { Box } from 'rebass'
import styled, { CSSProperties } from 'styled-components'

import CurrencyLogo from 'components/CurrencyLogo'
import Logo from 'components/Logo'
import { RowFit } from 'components/Row'

const Wrapper = styled.div<{ margin: boolean; sizeraw: number }>`
position: relative;
Expand Down Expand Up @@ -80,3 +82,37 @@ export function DoubleCurrencyLogoV2({
</Wrapper>
)
}

export function DoubleLogoWithChain({
logoUrl1,
logoUrl2,
chainUrl,
size = 36,
chainSize = 18,
}: {
logoUrl1: string
logoUrl2: string
chainUrl: string
size?: number
chainSize?: number
}) {
return (
<RowFit align="flex-end">
{logoUrl1 && (
<Box style={{ zIndex: 1 }}>
<Logo srcs={[logoUrl1]} style={{ width: size, height: size, borderRadius: '100%' }} />
</Box>
)}
{logoUrl2 && (
<Box style={{ zIndex: 2, marginLeft: -size / 4 + 'px' }}>
<Logo srcs={[logoUrl2]} style={{ width: size, height: size, borderRadius: '100%' }} />
</Box>
)}
{chainUrl && (
<Box style={{ zIndex: 3, marginLeft: -chainSize / 3 + 'px' }}>
<Logo srcs={[chainUrl]} style={{ width: chainSize, height: chainSize, borderRadius: '100%' }} />
</Box>
)}
</RowFit>
)
}
3 changes: 3 additions & 0 deletions src/components/DownloadWalletModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Column from 'components/Column'
import Modal from 'components/Modal'
import Row, { RowBetween } from 'components/Row'
import { connections } from 'constants/wallets'
import { useActiveWeb3React } from 'hooks'
import useTheme from 'hooks/useTheme'
import { ApplicationModal } from 'state/application/actions'
import { useCloseModal, useModalOpen } from 'state/application/hooks'
Expand Down Expand Up @@ -41,6 +42,8 @@ export default function DownloadWalletModal() {
const theme = useTheme()
const isOpen = useModalOpen(ApplicationModal.DOWNLOAD_WALLET)
const closeModal = useCloseModal(ApplicationModal.DOWNLOAD_WALLET)
const { account } = useActiveWeb3React()
if (!account) return null
return (
<Modal isOpen={isOpen} onDismiss={closeModal} maxWidth="600px">
<Column width="100%" padding="30px 24px" overflowY="scroll">
Expand Down
Loading
Loading