Skip to content
Open
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
2 changes: 1 addition & 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.0",
"@tailwindcss/postcss": "4.1.7",
"@types/react-redux": "7.1.34",
"@wagmi/connectors": "7.2.1",
Expand Down
16 changes: 11 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
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const RootLayout = async (props: RootLayoutProps) => {
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
4 changes: 2 additions & 2 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text-h20 has been removed

'text-t40m': 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
22 changes: 15 additions & 7 deletions src/components/Bone/Bone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,34 @@ const Bone: React.FC<BoneProps> = (props: any) => {
}
}, [ aspect ])

const boneClassName = cx(s.bone, s[`delay-${delay}`], className, {
'relative': !/absolute/.test(className || ''),
'rounded-4': !/rounded/.test(className || ''),
const textSizeClassName = cx({
[`text-${textSize}`]: textSize,
'w-full': wFull,
})

const boneClassName = cx(s.bone, s[`delay-${delay}`], className, textSizeClassName, {
'relative': !/absolute/.test(className || ''),
'rounded-4': !/rounded/.test(className || ''),
})

if (textSize) {
return (
<div
className={boneClassName}
className={cx(className, textSizeClassName)}
style={style}
dangerouslySetInnerHTML={{ __html: Boolean(textSize) ? '&nbsp;' : '' }}
/>
>
<div
className={cx(boneClassName, 'leading-[1] inline-block')}
style={style}
dangerouslySetInnerHTML={{ __html: '&nbsp;' }}
/>
</div>
)
}

return (
<div
className={boneClassName}
className={cx(className, boneClassName)}
style={style}
>
{
Expand Down
11 changes: 5 additions & 6 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const iconSizes = {
}

const titleSizes = {
xs: 't12m',
s: 't14m',
m: 't14m',
l: 't18m',
xl: 't20b',
xs: 'xs',
s: 'sm',
m: 'sm',
l: 'lg',
xl: 'lg',
}

type ButtonSize = typeof buttonSizes[number]
Expand Down Expand Up @@ -125,7 +125,6 @@ const Button: React.FC<ButtonProps> = (props) => {
'bg-dark/15 opacity-30': disabled || loading,
[buttonPaddingClassName]: title && !withoutPadding,
}

)

return (
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button/ButtonContent/ButtonContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const ButtonContent: React.FC<ButtonContentProps> = (props) => {
{
Boolean(title && !loading) && (
<Text
className={cx({
'font-medium': titleSize !== 'lg',
'font-bold': titleSize === 'lg',
})}
message={title as string}
size={titleSize}
color={color as TextColor}
Expand Down
1 change: 0 additions & 1 deletion src/components/ButtonBase/ButtonBase.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.wrapper {
@include no-user-select;
@include keyboard-focus;

&[disabled] {
pointer-events: none;
Expand Down
9 changes: 6 additions & 3 deletions src/components/ButtonBase/ButtonBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import s from './ButtonBase.module.scss'
import intl from 'modules/intl'


type ButtonElement = HTMLAnchorElement | HTMLButtonElement

export type ButtonBaseProps = {
children?: React.ReactNode
className?: string
Expand All @@ -21,8 +23,9 @@ export type ButtonBaseProps = {
disabled?: boolean
dataTestId?: string
ariaLabel?: string | Intl.Message
ref?: React.RefObject<HTMLAnchorElement | HTMLButtonElement>
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>
ref?: React.RefObject<ButtonElement>
onKeyDown?: React.KeyboardEventHandler<ButtonElement>
onClick?: React.MouseEventHandler<ButtonElement>
}

const ButtonBase: React.FC<ButtonBaseProps> = (props) => {
Expand All @@ -45,7 +48,7 @@ const ButtonBase: React.FC<ButtonBaseProps> = (props) => {
? translations.formatMessage(ariaLabel, ariaLabel.values)
: ariaLabel

const handleClick = useCallback((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {
const handleClick = useCallback((event: React.MouseEvent<ButtonElement>) => {
if (disabled) {
return
}
Expand Down

This file was deleted.

Loading
Loading