Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions e2e/fixtures/user/setUserRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const createSetUserRewards: Wrapper = ({ page }) => (
dailyRewardsJpy: 2.8604074786261133,
dailyRewardsKrw: 2.8604074786261133,
dailyRewardsAud: 2.8604074786261133,
dailyStakeRewards: 2.8604074786261133,
dailyBoostRewards: 2.8604074786261133,
}))

await page.evaluate((payload) => {
Expand Down
12 changes: 10 additions & 2 deletions e2e/fixtures/vault/setVaultData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ export const createSetVaultData: Wrapper = ({ page, wallet }) => (
const result: Output = {
feePercent,
vaultAddress,
subVaultsCount: 0,
exitingAssets: '0',
exitingTickets: '0',
subVaultsCurator: '',
isSmoothingPool: false,
canHarvest: false,
avgQueueDays: 0,
ejectingSubVault: '',
subVaultsRegistry: '',
pendingMetaSubVault: '',
protocolFeePercent: '0',
imageUrl: data?.imageUrl || '',
isErc20: data?.isErc20 ?? false,
vaultAdmin: getAddress(address),
Expand Down Expand Up @@ -66,8 +76,6 @@ export const createSetVaultData: Wrapper = ({ page, wallet }) => (
isMoreV2: true,
},
isPostPectra: true,
protocolFeePercent: String(feePercent / 100),
avgQueueDays: 1,
}

await page.addInitScript((payload) => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@reduxjs/toolkit": "2.8.2",
"@safe-global/safe-apps-provider": "0.18.6",
"@safe-global/safe-apps-sdk": "9.1.0",
"@stakewise/v3-sdk": "4.2.5",
"@stakewise/v3-sdk": "4.3.1",
"@tailwindcss/postcss": "4.1.7",
"@types/react-redux": "7.1.34",
"@wagmi/connectors": "7.2.1",
Expand All @@ -115,6 +115,7 @@
"react": "19.2.3",
"react-dom": "19.2.3",
"react-redux": "9.2.0",
"superjson": "2.2.6",
"swiper": "11.2.8",
"ua-parser-js": "2.0.3",
"viem": "2.44.1",
Expand Down
41 changes: 36 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ const GlobalError = ({ error, reset }: GlobalErrorViewProps) => {
className="text-center"
message={messages.error.title}
color="dark"
size="h32"
size="h4"
/>
<Text
className="mt-16 text-center"
message={messages.error.text}
color="dark"
size="t14"
size="sm"
/>
<Button
className="mt-32"
Expand Down
13 changes: 6 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { commonMessages } from 'helpers'
import { getLocale } from 'modules/intl/_SSR'
import { ThemeColor } from 'modules/theme/enum'
import { getServerTheme } from 'modules/theme/_SSR'
import { getVaultBase } from 'helpers/requests/_SSR'
import { getServerDevice } from 'modules/device/_SSR'
import { getNetworkId } from 'config/core/config/_SSR'
import { fetchStoreWithVaultData, fetchVault } from 'helpers/requests/_SSR'
import GlobalLayout from 'layouts/GlobalLayout/GlobalLayout'

import 'focus-visible'
Expand All @@ -31,8 +31,7 @@ export const generateMetadata: GenerateMetadata = async () => {
const url = `https://${domain}/`

try {
const vaultBase = await getVaultBase()
const vaultData = vaultBase?.data
const vaultData = await fetchVault()

if (vaultData?.displayName) {
title = envTitle ? `${vaultData.displayName} | ${envTitle}` : vaultData.displayName
Expand Down Expand Up @@ -130,18 +129,18 @@ const font = Inter({
const RootLayout = async (props: RootLayoutProps) => {
const { children } = props

const [ locale, networkId, vaultBase, serverTheme, device ] = await Promise.all([
const [ locale, networkId, serverTheme, device, serializedStore ] = await Promise.all([
getLocale(),
getNetworkId(),
getVaultBase(),
getServerTheme(),
getServerDevice(),
fetchStoreWithVaultData(),
])

return (
<html lang={locale}>
<body
className={cx(font.className, 'text-t14', {
className={cx(font.className, {
'body-dark-theme': serverTheme.value === ThemeColor.Dark,
'body-light-theme': serverTheme.value === ThemeColor.Light,
})}
Expand Down Expand Up @@ -172,9 +171,9 @@ const RootLayout = async (props: RootLayoutProps) => {
<GlobalLayout
locale={locale}
networkId={networkId}
vaultBase={vaultBase}
serverDevice={device}
serverTheme={serverTheme}
serializedStore={serializedStore}
>
{children}
</GlobalLayout>
Expand Down
6 changes: 3 additions & 3 deletions src/components/AmountInput/AmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const AmountInput: React.FC<AmountInputProps> = (props) => {

return (
<input
className={cx(s.input, className, 'w-full', {
className={cx(s.input, className, 'w-full font-medium', {
'text-dark': !error,
'text-error': error,
'text-h20': !isDesktop,
'text-t40m': isDesktop,
'text-lg': !isDesktop,
'text-h3': isDesktop,
})}
ref={inputRef}
placeholder="0"
Expand Down
12 changes: 7 additions & 5 deletions src/components/ApyBreakdown/Details/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ const Details: React.FC<DetailsProps> = (props) => {
/>
<div className="flex flex-col">
<Text
className="font-medium"
message={tokenList[token]}
size="t14m"
size="sm"
color="dark"
/>
{
Expand All @@ -98,15 +99,16 @@ const Details: React.FC<DetailsProps> = (props) => {
},
}}
color="dark"
size="t12"
size="xs"
/>
</div>
)
}
</div>
</div>
<Text
size="t18m"
className="font-medium"
size="md"
color="dark"
message={methods.formatApy(Number(apy))}
/>
Expand All @@ -117,10 +119,10 @@ const Details: React.FC<DetailsProps> = (props) => {
{
withText && (
<Text
className={cx('border-dark/20 text-center opacity-70', {
className={cx('border-dark/20 text-center opacity-70 font-medium', {
'pt-12 mt-12 border-top': data.length,
})}
size="t14m"
size="sm"
color="dark"
message={{
...messages.tooltip,
Expand Down
34 changes: 17 additions & 17 deletions src/components/AutoHeightToggle/AutoHeightToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef } from 'react'
import { useIsomorphicLayoutEffect } from 'hooks'
import React, { useCallback, useRef } from 'react'
import { useEventListener, useIsomorphicLayoutEffect } from 'hooks'
import cx from 'classnames'

import s from './AutoHeightToggle.module.scss'
Expand All @@ -22,31 +22,31 @@ const AutoHeightToggle: React.FC<AutoHeightToggleProps> = (props) => {
const childrenRef = useRef<HTMLDivElement>(null)
const containerRef = useRef<HTMLDivElement>(null)

useIsomorphicLayoutEffect(() => {
const isInit = containerRef.current && contentRef.current && childrenRef.current

if (!isInit) {
const updateHeight = useCallback(() => {
if (!containerRef.current || !childrenRef.current) {
return
}

if (isOpen) {
const contentHeight = contentRef.current?.clientHeight as number
const containerHeight = childrenRef.current?.clientHeight as number
const marginTop = parseFloat(getComputedStyle(contentRef.current as HTMLDivElement).marginTop)
if (isOpen && contentRef.current) {
const contentHeight = contentRef.current.clientHeight
const childrenHeight = childrenRef.current.clientHeight
const marginTop = parseFloat(getComputedStyle(contentRef.current).marginTop)

if (containerRef.current) {
containerRef.current.style.height = `calc(${padding * 2}px + ${contentHeight + containerHeight + marginTop}px)`
}
containerRef.current.style.height = `calc(${padding * 2}px + ${contentHeight + childrenHeight + marginTop}px)`
}
else {
const height = childrenRef.current?.clientHeight
const height = childrenRef.current.clientHeight

if (containerRef.current) {
containerRef.current.style.height = `calc(${padding * 2}px + ${height}px)`
}
containerRef.current.style.height = `calc(${padding * 2}px + ${height}px)`
}
}, [ isOpen, padding ])

useIsomorphicLayoutEffect(() => {
updateHeight()
}, [ isOpen, toggleContent ])

useEventListener('resize', updateHeight)

const containerClassName = cx(className, s.container, `p-${padding} relative`)

const toggleContentClassName = cx(contentClassName, s.content, {
Expand Down
Loading
Loading