fix table color selector design and refactor code
This commit is contained in:
parent
9efee285c8
commit
173522edc3
@ -17,31 +17,16 @@ export default function ColorPalette({
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div className="py-3 space-y-3">
|
<div className="py-3 space-y-3">
|
||||||
<div>
|
<div className="flex flex-wrap w-72 gap-y-2">
|
||||||
{tableThemes.slice(0, Math.ceil(tableThemes.length / 2)).map((c) => (
|
{tableThemes.map((c) => (
|
||||||
<button
|
<button
|
||||||
key={c}
|
key={c}
|
||||||
style={{ backgroundColor: c }}
|
style={{ backgroundColor: c }}
|
||||||
className="p-3 rounded-full mx-1"
|
className="w-10 h-10 rounded-full mx-1"
|
||||||
onClick={() => onPickColor(c)}
|
|
||||||
>
|
|
||||||
{currentColor === c ? (
|
|
||||||
<IconCheckboxTick style={{ color: "white" }} />
|
|
||||||
) : (
|
|
||||||
<IconCheckboxTick style={{ color: c }} />
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{tableThemes.slice(Math.ceil(tableThemes.length / 2)).map((c) => (
|
|
||||||
<button
|
|
||||||
key={c}
|
|
||||||
style={{ backgroundColor: c }}
|
|
||||||
className="p-3 rounded-full mx-1"
|
|
||||||
onClick={() => onPickColor(c)}
|
onClick={() => onPickColor(c)}
|
||||||
>
|
>
|
||||||
<IconCheckboxTick
|
<IconCheckboxTick
|
||||||
|
className="pt-1"
|
||||||
style={{
|
style={{
|
||||||
color: currentColor === c ? "white" : c,
|
color: currentColor === c ? "white" : c,
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user