fix: fixed the checkbox not being clickable after select (#608)
This commit is contained in:
parent
03ce931687
commit
f38399606b
@ -6,17 +6,24 @@ import Text from 'components/Text'
|
|||||||
interface Props {
|
interface Props {
|
||||||
checked: boolean
|
checked: boolean
|
||||||
onChange: (checked: boolean) => void
|
onChange: (checked: boolean) => void
|
||||||
|
name: string
|
||||||
text?: string
|
text?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Checkbox(props: Props) {
|
export default function Checkbox(props: Props) {
|
||||||
return (
|
return (
|
||||||
<label className='flex gap-2 items-center cursor-pointer'>
|
<>
|
||||||
|
<label
|
||||||
|
className='flex items-center gap-2 border-white cursor-pointer'
|
||||||
|
htmlFor={`${props.name}-id}`}
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
onChange={() => props.onChange(props.checked)}
|
onChange={() => props.onChange(props.checked)}
|
||||||
|
id={`${props.name}-id`}
|
||||||
|
name={props.name}
|
||||||
checked={props.checked}
|
checked={props.checked}
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
className='opacity-0 absolute'
|
className='absolute w-0 h-0 opacity-0'
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
@ -35,5 +42,6 @@ export default function Checkbox(props: Props) {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ function AlertDialog(props: Props) {
|
|||||||
header={
|
header={
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
{icon && (
|
{icon && (
|
||||||
<div className='grid w-12 h-12 rounded-sm place-items-center bg-white/5 mb-4'>
|
<div className='grid w-12 h-12 mb-4 rounded-sm place-items-center bg-white/5'>
|
||||||
{icon}
|
{icon}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -74,7 +74,12 @@ function AlertDialog(props: Props) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{checkbox && (
|
{checkbox && (
|
||||||
<Checkbox checked={toggle} onChange={handleCheckboxClick} text={checkbox.text} />
|
<Checkbox
|
||||||
|
name='aleart-toggle'
|
||||||
|
checked={toggle}
|
||||||
|
onChange={handleCheckboxClick}
|
||||||
|
text={checkbox.text}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
@ -34,7 +34,11 @@ export default function useAssetTableColumns(isBorrow: boolean) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<Checkbox checked={row.getIsSelected()} onChange={row.getToggleSelectedHandler()} />
|
<Checkbox
|
||||||
|
name={`asset-${asset.id.toLowerCase()}`}
|
||||||
|
checked={row.getIsSelected()}
|
||||||
|
onChange={row.getToggleSelectedHandler()}
|
||||||
|
/>
|
||||||
<AssetImage asset={asset} size={24} className='ml-4' />
|
<AssetImage asset={asset} size={24} className='ml-4' />
|
||||||
<div className='ml-2 text-left'>
|
<div className='ml-2 text-left'>
|
||||||
<Text size='sm' className='mb-0.5 text-white'>
|
<Text size='sm' className='mb-0.5 text-white'>
|
||||||
|
Loading…
Reference in New Issue
Block a user