Skip to content

Commit 173522e

Browse files
committed
fix table color selector design and refactor code
1 parent 9efee28 commit 173522e

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

src/components/ColorPalette.jsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,16 @@ export default function ColorPalette({
1717
</div>
1818
<hr />
1919
<div className="py-3 space-y-3">
20-
<div>
21-
{tableThemes.slice(0, Math.ceil(tableThemes.length / 2)).map((c) => (
20+
<div className="flex flex-wrap w-72 gap-y-2">
21+
{tableThemes.map((c) => (
2222
<button
2323
key={c}
2424
style={{ backgroundColor: c }}
25-
className="p-3 rounded-full mx-1"
26-
onClick={() => onPickColor(c)}
27-
>
28-
{currentColor === c ? (
29-
<IconCheckboxTick style={{ color: "white" }} />
30-
) : (
31-
<IconCheckboxTick style={{ color: c }} />
32-
)}
33-
</button>
34-
))}
35-
</div>
36-
<div>
37-
{tableThemes.slice(Math.ceil(tableThemes.length / 2)).map((c) => (
38-
<button
39-
key={c}
40-
style={{ backgroundColor: c }}
41-
className="p-3 rounded-full mx-1"
25+
className="w-10 h-10 rounded-full mx-1"
4226
onClick={() => onPickColor(c)}
4327
>
4428
<IconCheckboxTick
29+
className="pt-1"
4530
style={{
4631
color: currentColor === c ? "white" : c,
4732
}}

0 commit comments

Comments
 (0)