Skip to content

Commit

Permalink
Merge pull request #48 from imhalid/main
Browse files Browse the repository at this point in the history
fix table color selector design and refactor code
  • Loading branch information
1ilit authored Apr 15, 2024
2 parents 9efee28 + 173522e commit d95b085
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/components/ColorPalette.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}}
Expand Down

0 comments on commit d95b085

Please sign in to comment.