Merge pull request #48 from imhalid/main

fix table color selector design and refactor code
This commit is contained in:
1ilit 2024-04-15 04:29:38 +03:00 committed by GitHub
commit d95b085276
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,31 +17,16 @@ export default function ColorPalette({
</div>
<hr />
<div className="py-3 space-y-3">
<div>
{tableThemes.slice(0, Math.ceil(tableThemes.length / 2)).map((c) => (
<div className="flex flex-wrap w-72 gap-y-2">
{tableThemes.map((c) => (
<button
key={c}
style={{ backgroundColor: c }}
className="p-3 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"
className="w-10 h-10 rounded-full mx-1"
onClick={() => onPickColor(c)}
>
<IconCheckboxTick
className="pt-1"
style={{
color: currentColor === c ? "white" : c,
}}