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

Feat/v3 main #443

Merged
merged 111 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
02d4409
feat: wip v3
Oct 23, 2023
b259021
feat: v3 design
Oct 23, 2023
a54d2b7
fix: some ui mistakes
Oct 23, 2023
a305e03
feat: v3 design
Oct 24, 2023
f7011cb
fix: UI
Oct 24, 2023
9c271ce
fix: padding
Majorfi Oct 24, 2023
9bff395
fix: wip
Majorfi Oct 25, 2023
d612ab2
fix: some UI fix
Oct 25, 2023
d9c4b65
feat: design
Oct 25, 2023
20904ab
fix: adapt paddings
Oct 25, 2023
3ae2c51
fix: spacing
Oct 25, 2023
ba9f88b
fix: design
Oct 25, 2023
3f8b143
fix: search
Oct 25, 2023
0b83ad4
fix: some clearning
Oct 25, 2023
245525b
fix: remove withdrawal fee
Oct 25, 2023
d67acd4
fix: staking
Oct 25, 2023
ebd6c21
wip
Oct 25, 2023
d28ee9d
feat: deposit/redeem
Oct 25, 2023
866ace8
fix: 1
Oct 25, 2023
d6ee433
fix: responsiveness
Oct 25, 2023
4f26419
fix: animate spin bg
Oct 26, 2023
30adecc
fix: improve entrance animation
Oct 26, 2023
bd42225
fix: remove bolt
Oct 26, 2023
bf854cf
fix: only v3
Oct 26, 2023
738851a
feat: wip
Oct 26, 2023
e190e35
fix: toast
Oct 26, 2023
8d9f02a
fix: pre-tests
Oct 26, 2023
e87e2f7
fix: remove dead code
Oct 26, 2023
4a84d9d
fix: registry with kind
Oct 27, 2023
4bfdfa0
feat: new registry
Oct 27, 2023
fd6287e
feat: icon
Oct 27, 2023
10b0111
fix: deposit
Oct 27, 2023
4b0ff8b
feat: add maxLoss popover & hide vaults tab when no subvault
Oct 30, 2023
bcb29d3
feat: yieldOnTime
Oct 30, 2023
6492caa
fix: remove retired/migrated from v3
Oct 30, 2023
7719725
fix: deposited amountv3
Oct 30, 2023
b6ceba8
fix: linting
Oct 30, 2023
9733b40
fix: chain
Oct 30, 2023
936c3ee
feat: add link to explorer
Oct 31, 2023
a906f45
feat: add message
Nov 1, 2023
379c79d
style: upd header
Nov 1, 2023
4b20ae3
copy: change copy of instant yield
Nov 1, 2023
cbdfa42
style: update spacing on desktop
Nov 1, 2023
d347637
style: change banner warning text color
Nov 1, 2023
f3b2b31
copy: change copy for headline
Nov 1, 2023
9474883
fix: veYFI refresh and stop-color
Nov 4, 2023
d11af55
perf: hook optimization and pagination
Nov 7, 2023
6f5d325
fix: pagination
Nov 7, 2023
9f58f3f
fix: prefetch & img
Majorfi Nov 7, 2023
615b3ce
perf: improve global performances
Majorfi Nov 7, 2023
7a8f835
fix: adjust size
Majorfi Nov 7, 2023
01e249f
fix: not use 137
Majorfi Nov 8, 2023
e7fa80a
fix: use filteredChains
Majorfi Nov 8, 2023
a75afd0
chores: code splitting
Majorfi Nov 8, 2023
76845e5
fix: upd hook refres dependencies
Nov 9, 2023
db46c6d
perf: change token icons size for 32px
Nov 9, 2023
96a3bdb
fix: imports
Nov 9, 2023
ed17ae3
fix: staking data feat
Nov 9, 2023
0a7e815
feat: reenable prefetching
Nov 9, 2023
f791008
feat: add yprisma
Nov 9, 2023
e913562
fix: remove opt reward file as data automated from yDaemon (#415)
Majorfi Nov 10, 2023
73ad5ad
deps: remove use-query-params, not working properly with framer motio…
Majorfi Nov 10, 2023
d181376
fix: change yPrisma asset url
Majorfi Nov 10, 2023
4f7050b
fix: upd assets
Nov 15, 2023
ca2fe60
fix: use base_yearn_assets_uri
Nov 15, 2023
0668571
refactor: v3 Vaults About Section (#422)
karelianpie Nov 15, 2023
5c1a4d2
refactor: Fewer clicks to select a single network (#423)
karelianpie Nov 15, 2023
bb8f332
fix: disable eth for non wETH vault & fix zapWith
Nov 17, 2023
f8870fb
feat: Tooltip for earnings [PRO-119] (#425)
karelianpie Nov 20, 2023
800a9a6
Fix flashing sign (#428)
Majorfi Nov 21, 2023
f2b0d59
feat: display staked
Nov 22, 2023
abc79c2
feat: enable polygon fetching for v3 | rename table labels | add depo…
Nov 22, 2023
9e352bb
feat: display NEW when APR type includes new
Nov 22, 2023
854f433
fix: link to explorer sometime out
Nov 22, 2023
51bf2ae
fix: invalid perf fee on v3
Nov 24, 2023
e85285c
fix: asset quality by using 128 instead of 32
Nov 24, 2023
81a55c6
chores: update asset URL + sizes
Nov 24, 2023
ffc3f99
fix: balance endpoint
Nov 27, 2023
34de354
fix: description should use vault description as primary souce
Nov 28, 2023
96077cc
fix: minor UI update
Nov 28, 2023
39729fb
fix: size of input
Nov 28, 2023
73691d0
fix: improve portals error message
Nov 28, 2023
2169305
fix: hide low tvl removal
Majorfi Nov 28, 2023
d38c4dd
fix: error message and vault list order
Majorfi Nov 28, 2023
6bef916
fix: search
Majorfi Nov 28, 2023
d7cc342
fix: some mobile issues
Majorfi Nov 28, 2023
7c6838d
feat: display new when APR is new
Majorfi Nov 28, 2023
be6bff1
fix: search system
Majorfi Nov 28, 2023
d4bc7a2
feat: remove support for Wido solver (#435)
Majorfi Nov 29, 2023
fd3c8ec
Feat/upgrade portals to v2 (#441)
Majorfi Nov 29, 2023
9c1969b
fix: error message missing margin top
Nov 29, 2023
1b5a367
feat: add Changelog commit hook
Nov 29, 2023
36428a1
chore: bump some packages
Nov 29, 2023
508baf5
fix: searchbar uncontrolled
Nov 29, 2023
f2faca2
fix: vault list no results
Nov 29, 2023
b71afbc
fix: reset for queryArgs
Nov 29, 2023
f65162b
chore: set APR as new when it's new
Nov 29, 2023
28ff2d1
chore: set polygon only in vault display for V3
Nov 29, 2023
0d519fc
chore: re-add card on the index page
Nov 29, 2023
315a7f6
style: extra padding on top of TVL
Nov 29, 2023
259e946
style: update some colors and fix v3 bg
Nov 29, 2023
2cbc79a
style: update some colors and fix v3 bg
Nov 29, 2023
da25062
chore: move vault-v3 to plain v3. Update popover
Nov 29, 2023
7817f60
fix: add back icon
Nov 29, 2023
afedf93
fix: extra zap slippage /100 on portals
Nov 29, 2023
a688cd5
style: update popover header colors
Nov 29, 2023
10db320
fix: searchbar display
Nov 29, 2023
3187c37
feat: enable properly portals for zap with native token
Nov 30, 2023
18fdbd6
fix: display outputValue
Nov 30, 2023
f1ffd57
fix: pricing system
Nov 30, 2023
9904eaf
fix: avoid scientific notation in OPBoost page
Nov 30, 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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
indent: 'off',
'no-multi-spaces': ['error', {ignoreEOLComments: false}],
'@typescript-eslint/indent': 0,
'@typescript-eslint/consistent-type-assertions': 0,
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
'object-curly-newline': [
'error',
Expand Down
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
if git status -s | grep -q "CHANGELOG"; then
npx lint-staged
exit 0
else
echo
echo "❌ CHANGELOG Not Updated."
echo
exit 1
fi
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.ts|*.tsx": ["yarn prettier-format", "eslint"],
"*.ts|*.tsx": ["yarn prettier-format", "yarn eslint --quiet --fix", "bash -c tsc --noEmit"],
"*.scss|*.css": "yarn prettier-format"
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# 0.3.0 (x/12/2023)

- Build: Release the V3 vaults.
- Build: Release the multichain config.
- Fix: The zap balances fetching to use the multichain endpoint rather than the currently connected one.
- Fix: On some 404 pages, the error message was positioned incorrectly (top) and needed to be centered.
- Chore: Add the Changelog commit hook to enforce the changelog update on commit.
- Deps: Deprecate Wido due to project end-of-life.
- Deps: Bump Portals solver to V2 version.
- Deps: Bump various packages.
- Nit: SearchBar using uncontrolled input.
- Fix: When searching for vaults in a aggregator vault and the search input give no match, the component was moving to "this vault is a strategy" instead of staying in the "no match" state.
- Fix: Add an `onReset` function in the `useQueryArguments` hook to be able to reset the query arguments to their default values.
- Chore: Use `New` for APR when it's tagged as new.
- Fix: On V3, we only display Polygon for now, as the V3 vaults are polygon only.
- Fix: Add Card for V3 on the index page.
- Nit: Minor CSS fixes on TVL display on Mobile for V3.
- Fix: Add the V3 line in the popover menu & fix some hook issue around the V3 color scheme. Adapt the color scheme to the Dark, Light and V3.
- Rename path `vault-v3` to simple `v3`.
- Fix: Portals zap slippage too low.
- Fix: Searchbar on the vault details page was removed if the search was not giving any result.
- Feat: Accept native coin for Portals Zap.
- Fix: Balance refresh not refreshing properly.
- Fix: Update the zap schema from yDaemon
- Fix: For portals, uses `OutputValue` instead of `MinOutputValue` for display.
- Fix: The price system was mixed-chain, not multi-chain
- Fix: Avoid decimal notations in the OP boost page

# 0.1.25 (28/08/2023)

- Gauge voting for veYFI under the `gauge-voting` feature flag
Expand Down
193 changes: 108 additions & 85 deletions apps/common/components/AppHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import {cloneElement, Fragment, useMemo, useState} from 'react';
import {cloneElement, useMemo, useState} from 'react';
import Link from 'next/link';
import {useRouter} from 'next/router';
import {AnimatePresence} from 'framer-motion';
import {Popover, Transition} from '@headlessui/react';
import {useIsMounted} from '@react-hookz/web';
import {VaultsHeader} from '@vaults/components/header/VaultsHeader';
import {VaultsV3Header} from '@vaults-v3/components/header/VaultsHeader';
import {V3Logo} from '@vaults-v3/Mark';
import {VeYfiHeader} from '@veYFI/components/header/VeYfiHeader';
import {Header} from '@yearn-finance/web-lib/components/Header';
import {Renderable} from '@yearn-finance/web-lib/components/Renderable';
import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3';
import {BalanceReminderPopover} from '@common/components/BalanceReminderPopover';
import {ImageWithFallback} from '@common/components/ImageWithFallback';
import {cl} from '@yearn-finance/web-lib/utils/cl';
import {useMenu} from '@common/contexts/useMenu';
import {useCurrentApp} from '@common/hooks/useCurrentApp';
import {LogoYearn} from '@common/icons/LogoYearn';
import {YBalHeader} from '@yBal/components/header/YBalHeader';
import {YBribeHeader} from '@yBribe/components/header/YBribeHeader';
Expand All @@ -33,6 +32,7 @@ function Logo(): ReactElement {
<VaultsHeader pathname={pathname} />
<VeYfiHeader pathname={pathname} />
<YBribeHeader pathname={pathname} />
<VaultsV3Header pathname={pathname} />
<MotionDiv
name={'yearn'}
animate={pathname === '/' ? 'enter' : 'exit'}>
Expand All @@ -48,82 +48,118 @@ function Logo(): ReactElement {

function LogoPopover(): ReactElement {
const [isShowing, set_isShowing] = useState(false);

const YETH = {
name: 'yETH',
href: 'https://yeth.yearn.fi',
isDisabled: false,
icon: (
<ImageWithFallback
alt={'yETH'}
className={'h-8 w-8'}
width={100}
height={100}
src={`${process.env.BASE_YEARN_ASSETS_URI}/1/0x1BED97CBC3c24A4fb5C069C6E311a967386131f7/logo-128.png`}
loading={'eager'}
priority
/>
)
};
const router = useRouter();
const {name: currentAppName} = useCurrentApp(router);

return (
<Popover
onMouseEnter={(): void => set_isShowing(true)}
onMouseLeave={(): void => set_isShowing(false)}
className={'relative'}>
<Popover.Button className={'flex items-center'}>
<Link href={'/'}>
<span className={'sr-only'}>{'Back to home'}</span>
<Logo />
</Link>
</Popover.Button>
<Transition
as={Fragment}
show={isShowing}
enter={'transition ease-out duration-200'}
enterFrom={'opacity-0 translate-y-1'}
enterTo={'opacity-100 translate-y-0'}
leave={'transition ease-in duration-150'}
leaveFrom={'opacity-100 translate-y-0'}
leaveTo={'opacity-0 translate-y-1'}>
<Popover.Panel
className={'absolute left-1/2 z-10 mt-6 w-80 -translate-x-1/2 px-4 pt-4 sm:px-0 md:w-96'}>
<div className={'overflow-hidden border border-neutral-200 shadow-lg'}>
<div className={'relative grid grid-cols-2 bg-neutral-0 md:grid-cols-3'}>
{[...Object.values(APPS), YETH]
.filter(({isDisabled}): boolean => !isDisabled)
.map(({name, href, icon}): ReactElement => {
return (
<>
<Popover
onMouseEnter={(): void => set_isShowing(true)}
onMouseLeave={(): void => set_isShowing(false)}>
<div
onClick={(): void => set_isShowing(false)}
onMouseEnter={(): void => set_isShowing(false)}
className={cl(
'fixed inset-0 bg-neutral-900 backdrop-blur-sm transition-opacity',
!isShowing ? 'opacity-0 pointer-events-none' : 'opacity-50 pointer-events-auto'
)}
/>
<Popover.Button className={'z-20 flex items-center'}>
<Link href={'/'}>
<span className={'sr-only'}>{'Back to home'}</span>
<Logo />
</Link>
</Popover.Button>

<Transition.Root show={isShowing}>
<Transition.Child
as={'div'}
enter={'transition ease-out duration-200'}
enterFrom={'opacity-0 translate-y-1'}
enterTo={'opacity-100 translate-y-0'}
leave={'transition ease-in duration-150'}
leaveFrom={'opacity-100 translate-y-0'}
leaveTo={'opacity-0 translate-y-1'}
className={'relative z-[9999999]'}>
<Popover.Panel
className={'absolute left-1/2 z-20 w-80 -translate-x-1/2 px-4 pt-6 sm:px-0 md:w-[560px]'}>
<div className={'overflow-hidden pt-4 shadow-xl'}>
<div
className={cl(
'relative grid grid-cols-2 gap-2 border p-6 md:grid-cols-5',
currentAppName === 'V3'
? 'bg-[#000520] border-neutral-200/60 rounded-sm'
: 'bg-[#F4F4F4] dark:bg-[#282828] border-transparent'
)}>
<div className={'col-span-3 grid grid-cols-2 gap-2 md:grid-cols-3'}>
{[...Object.values(APPS)]
.filter(({isDisabled}): boolean => !isDisabled)
.filter(({name}): boolean => name !== 'V3')
.map(({name, href, icon}): ReactElement => {
return (
<Link
prefetch={false}
key={name}
href={href}
onClick={(): void => set_isShowing(false)}>
<div
onClick={(): void => set_isShowing(false)}
className={cl(
'flex cursor-pointer border flex-col items-center justify-center transition-colors p-4',
currentAppName !== 'V3'
? 'bg-[#EBEBEB] border-transparent hover:bg-[#c3c3c380] dark:bg-[#0C0C0C] hover:dark:bg-[#3d3d3d80]'
: 'bg-[#000520] hover:bg-[#33374d80] border-[#151C40]'
)}>
<div>{cloneElement(icon, {className: 'w-8 h-8'})}</div>
<div className={'pt-2 text-center'}>
<b className={'text-base'}>{name}</b>
</div>
</div>
</Link>
);
})}
</div>
<div className={'col-span-2 grid grid-cols-2 gap-2 md:grid-cols-3'}>
<Link
prefetch={false}
key={name}
href={href}
key={currentAppName}
href={'/v3'}
className={'col-span-3 row-span-2'}
onClick={(): void => set_isShowing(false)}>
<div
onClick={(): void => set_isShowing(false)}
className={
'flex cursor-pointer flex-col items-center p-4 transition-colors hover:bg-neutral-200'
}>
<div>{cloneElement(icon)}</div>
<div className={'pt-2 text-center'}>
<b className={'text-base'}>{name}</b>
className={cl(
'relative flex h-full w-full cursor-pointer flex-col items-center justify-center transition-all rounded-sm p-4',
currentAppName !== 'V3'
? 'bg-[#EBEBEB] hover:bg-[#c3c3c380] dark:bg-[#0C0C0C] hover:dark:bg-[#3d3d3d80]'
: 'bg-[#010A3B] hover:brightness-125'
)}>
<div className={'z-10 flex w-full flex-col items-center'}>
<V3Logo className={'h-20'} />
<div className={'-mb-2 pt-4 text-center'}>
<p
className={cl(
'font-bold text-black dark:text-white text-sm',
'whitespace-break-spaces'
)}>
{`Discover\nBrand New Vaults`}
</p>
</div>
</div>
</div>
</Link>
);
})}
</div>
</div>
</Popover.Panel>
</Transition>
</Popover>
</div>
</div>
</div>
</Popover.Panel>
</Transition.Child>
</Transition.Root>
</Popover>
</>
);
}

export function AppHeader(): ReactElement {
const isMounted = useIsMounted();
const {pathname} = useRouter();
const {isActive} = useWeb3();
const {onOpenMenu} = useMenu();
const menu = useMemo((): TMenu[] => {
const HOME_MENU = {path: '/', label: 'Home'};
Expand All @@ -136,6 +172,10 @@ export function AppHeader(): ReactElement {
return [HOME_MENU, ...APPS[AppName.YBAL].menu];
}

if (pathname.startsWith('/v3')) {
return [HOME_MENU, ...APPS[AppName.VAULTSV3].menu];
}

if (pathname.startsWith('/vaults')) {
return [HOME_MENU, ...APPS[AppName.VAULTS].menu];
}
Expand All @@ -159,35 +199,18 @@ export function AppHeader(): ReactElement {
];
}, [pathname]);

const supportedNetworks = useMemo((): number[] => {
const ethereumOnlyPaths = ['/ycrv', '/ybal', '/veyfi', '/ybribe'];
if (ethereumOnlyPaths.some((path): boolean => pathname.startsWith(path))) {
return [1];
}

return [1, 10, 250, 42161];
}, [pathname]);

return (
<Header
showNetworkSelector={false}
linkComponent={<Link href={''} />}
currentPathName={pathname}
onOpenMenuMobile={onOpenMenu}
nav={menu}
supportedNetworks={supportedNetworks}
logo={
<AnimatePresence mode={'wait'}>
<LogoPopover />
</AnimatePresence>
}
extra={
<Renderable shouldRender={isActive && isMounted()}>
<div className={'ml-4'}>
<BalanceReminderPopover />
</div>
</Renderable>
}
/>
);
}
Loading
Loading