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: ActionInfo component #642

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

OnlyJousting
Copy link
Contributor

@OnlyJousting OnlyJousting commented Jan 27, 2025

  • Added ActionInfo component
  • Need to integrate into theme/storybook

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
curve-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 11:02am
curve-dapp-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 11:02am


const { Spacing } = SizesAndSpaces

type ComponentSize = 'S' | 'M' | 'L'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type ComponentSize = 'S' | 'M' | 'L'
type ComponentSize = 'small' | 'medium' | 'large'

packages/curve-ui-kit/src/shared/ui/ActionInfo.tsx Outdated Show resolved Hide resolved
{shortenTokenAddress(address)}
</Typography>
<IconButton size="small" onClick={copyValue} sx={{ svg: { color: Button.Primary.Default.Fill } }}>
<Icon name="Copy" size={24} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Check out SizesAndSpaces.IconSize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it returns values in 'rem' and the Icon component requires number 🤔

packages/curve-ui-kit/src/shared/ui/ActionInfo.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@0xAlunara 0xAlunara left a comment

Choose a reason for hiding this comment

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

Preliminary review, eagerly awaiting a storybook entry

size?: ComponentSize
}

const labelSize: Record<ComponentSize, 'bodyXsRegular' | 'bodyMRegular'> = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could just use TypographyVariantKey in the future if you ever want to keep your options open, but this works regardless.

import Link from '@mui/material/Link'
import { Duration } from '../../themes/design/0_primitives'
import { shortenTokenAddress } from 'ui/src/utils/'
import { t } from 'i18next'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait what's this, aren't we using import { t } from '@lingui/macro'?

import Icon from 'ui/src/Icon'
import Typography from '@mui/material/Typography'
import Link from '@mui/material/Link'
import { Duration } from '../../themes/design/0_primitives'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can use @ui-kit if you want to instead of relative files.

import Typography from '@mui/material/Typography'
import Link from '@mui/material/Link'
import { Duration } from '../../themes/design/0_primitives'
import { shortenTokenAddress } from 'ui/src/utils/'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh shit didn't know this existed, now we have a somewhat duplicate implementation with curve-ui-kit\src\utils\address.ts. Should probably consolidate that some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants