fix: rework wallet screen
This commit is contained in:
parent
1f7ae74b42
commit
1f6d272aa0
103 changed files with 2094 additions and 3892 deletions
|
|
@ -1,14 +1,21 @@
|
|||
import React from 'react'
|
||||
import React, { useContext } from 'react'
|
||||
|
||||
import { Td, THead } from 'src/components/fake-table/Table'
|
||||
import { startCase } from 'src/utils/string'
|
||||
|
||||
import { ACTION_COL_SIZE, DEFAULT_COL_SIZE } from './consts'
|
||||
|
||||
const Header = ({ elements, enableEdit, enableDelete }) => {
|
||||
const actionColSize =
|
||||
enableDelete && enableEdit ? ACTION_COL_SIZE / 2 : ACTION_COL_SIZE
|
||||
import TableCtx from './Context'
|
||||
|
||||
const Header = () => {
|
||||
const {
|
||||
elements,
|
||||
enableEdit,
|
||||
editWidth,
|
||||
enableDelete,
|
||||
deleteWidth,
|
||||
enableToggle,
|
||||
toggleWidth,
|
||||
DEFAULT_COL_SIZE
|
||||
} = useContext(TableCtx)
|
||||
return (
|
||||
<THead>
|
||||
{elements.map(
|
||||
|
|
@ -19,15 +26,20 @@ const Header = ({ elements, enableEdit, enableDelete }) => {
|
|||
)
|
||||
)}
|
||||
{enableEdit && (
|
||||
<Td header width={actionColSize} textAlign="right">
|
||||
<Td header width={editWidth} textAlign="center">
|
||||
Edit
|
||||
</Td>
|
||||
)}
|
||||
{enableDelete && (
|
||||
<Td header width={actionColSize} textAlign="right">
|
||||
<Td header width={deleteWidth} textAlign="center">
|
||||
Delete
|
||||
</Td>
|
||||
)}
|
||||
{enableToggle && (
|
||||
<Td header width={toggleWidth} textAlign="center">
|
||||
Enable
|
||||
</Td>
|
||||
)}
|
||||
</THead>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue