Commit 29a2b631 authored by Natalia Stus's avatar Natalia Stus

поменял поведение таблицы

parent 1abfc6b4
...@@ -12,9 +12,9 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => { ...@@ -12,9 +12,9 @@ const WatchListAddressItem = ({ item }: {item: TWatchlistItem}) => {
return ( return (
<HStack spacing="12px" align="top"> <HStack spacing="12px" align="top">
<Image src="/acc.png" alt="Account Image" w="50px" h="50px"/> <Image src="/acc.png" alt="Account Image" w="50px" h="50px"/>
<VStack align="stretch"> <VStack align="stretch" overflow="hidden">
<HStack spacing="8px" alignContent="center"> <HStack spacing="8px" alignContent="center">
<Link href="#" color="blue.500"> <Link href="#" color="blue.500" title={ item.address } overflow="hidden" textOverflow="ellipsis">
{ item.address } { item.address }
</Link> </Link>
<CopyToClipboard text={ item.address }/> <CopyToClipboard text={ item.address }/>
......
...@@ -34,7 +34,11 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -34,7 +34,11 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return ( return (
<Tr alignItems="top" key={ item.address }> <Tr alignItems="top" key={ item.address }>
<Td><WatchListAddressItem item={ item }/></Td> <Td><WatchListAddressItem item={ item }/></Td>
<Td><Tag>{ item.tag }</Tag></Td> <Td>
<Tag lineHeight="24px" title={ item.tag }>
{ item.tag }
</Tag>
</Td>
<Td><Switch colorScheme="green" size="md" isChecked={ item.notification }/></Td> <Td><Switch colorScheme="green" size="md" isChecked={ item.notification }/></Td>
<Td> <Td>
<HStack spacing="30px"> <HStack spacing="30px">
......
...@@ -22,13 +22,13 @@ interface Props { ...@@ -22,13 +22,13 @@ interface Props {
const WatchlistTable = ({ data, onDeleteClick, onEditClick }: Props) => { const WatchlistTable = ({ data, onDeleteClick, onEditClick }: Props) => {
return ( return (
<TableContainer width="100%"> <TableContainer width="100%">
<Table variant="simple"> <Table variant="simple" minWidth="600px">
<Thead> <Thead>
<Tr> <Tr>
<Th>Address</Th> <Th width="70%" overflow="hidden">Address</Th>
<Th>Private tag</Th> <Th width="30%" overflow="hidden">Private tag</Th>
<Th>Notification</Th> <Th width="108px" overflow="hidden">Notification</Th>
<Th></Th> <Th width="108px" overflow="hidden"></Th>
</Tr> </Tr>
</Thead> </Thead>
<Tbody> <Tbody>
......
...@@ -22,7 +22,7 @@ export const watchlist = [ ...@@ -22,7 +22,7 @@ export const watchlist = [
tokenBalance: 200.2, tokenBalance: 200.2,
tokenBalanceUSD: 202.4, tokenBalanceUSD: 202.4,
totalUSD: 3000.5, totalUSD: 3000.5,
tag: 'some_other_tag', tag: '12345678901234567890123456789012345',
notification: false, notification: false,
}, },
]; ];
......
...@@ -6,7 +6,7 @@ const firstLastStyle = { ...@@ -6,7 +6,7 @@ const firstLastStyle = {
} }
const Table: ComponentMultiStyleConfig = { const Table: ComponentMultiStyleConfig = {
parts: [ 'th', 'td' ], parts: [ 'th', 'td', 'table' ],
baseStyle: { baseStyle: {
th: { th: {
...firstLastStyle, ...firstLastStyle,
...@@ -18,6 +18,9 @@ const Table: ComponentMultiStyleConfig = { ...@@ -18,6 +18,9 @@ const Table: ComponentMultiStyleConfig = {
fontSize: 'md', fontSize: 'md',
verticalAlign: 'top', verticalAlign: 'top',
}, },
table: {
tableLayout: 'fixed',
},
}, },
} }
......
import type { ComponentStyleConfig } from '@chakra-ui/theme';
const Tag: ComponentStyleConfig = {
baseStyle: {
container: {
display: 'inline-block',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
},
}
export default Tag;
...@@ -4,6 +4,7 @@ import Modal from './Modal'; ...@@ -4,6 +4,7 @@ import Modal from './Modal';
import Table from './Table'; import Table from './Table';
import Form from './Form'; import Form from './Form';
import Input from './Input'; import Input from './Input';
import Tag from './Tag';
const components = { const components = {
Switch, Switch,
...@@ -12,6 +13,7 @@ const components = { ...@@ -12,6 +13,7 @@ const components = {
Table, Table,
Input, Input,
Form, Form,
Tag,
} }
export default components; export default components;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment