Skip to content

Commit

Permalink
fix: added text component for table
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac Godinez committed Nov 12, 2023
1 parent 06fe1c7 commit 5051199
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'

import { Box } from 'ui/src/components/box'
import { Text } from 'ui/src/components/typography'

import * as styles from './styles.css'

interface IProps {
value?: string
}

export const AssetTextCell: React.FC<IProps> = props => {
const { value } = props

return (
<Box className={styles.assetTextCellWrapper}>
<Text capitalizeFirstLetter size="small" truncate weight="medium">
{value}
</Text>
</Box>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { style } from '@vanilla-extract/css'

import { sprinkles } from 'ui/src/components/system/sprinkles.css'

export const assetTextCellWrapper = style([
sprinkles({
position: 'relative',
zIndex: 1,
}),
{},
])
2 changes: 2 additions & 0 deletions packages/ui/src/pages/accounts/nfts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { TableWithEmptyState } from 'ui/src/components/table'
import { useNonFungibleIds, useNonFungiblesData } from 'ui/src/hooks/dapp/use-entity-nft'
import { useSelectedAccounts } from 'ui/src/hooks/use-accounts'
import { AssetNameCell } from 'ui/src/pages/accounts/components/table/asset-name-cell'
import { AssetTextCell } from 'ui/src/pages/accounts/components/table/asset-text-cell'

import { NftDataCell } from '../components/table/nft-data-cell'
import * as styles from '../components/table/styles.css'
Expand Down Expand Up @@ -88,6 +89,7 @@ const NFTs: React.FC = () => {
Header: intl.formatMessage(messages.non_fungible_id),
accessor: 'non_fungible_id',
width: 'auto',
Cell: AssetTextCell,
},
{
Header: intl.formatMessage(messages.nft),
Expand Down

0 comments on commit 5051199

Please sign in to comment.