From ba5652226fcba334890d2e060fc29b966d56db20 Mon Sep 17 00:00:00 2001 From: Eryk Mika <eryk.mika@wpdesk.eu> Date: Thu, 27 Feb 2025 14:03:15 +0100 Subject: [PATCH] fix: even rows not odd lol --- src/FlexibleTable/FlexibleTable.jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/FlexibleTable/FlexibleTable.jsx b/src/FlexibleTable/FlexibleTable.jsx index 2940e2f..4296e7a 100644 --- a/src/FlexibleTable/FlexibleTable.jsx +++ b/src/FlexibleTable/FlexibleTable.jsx @@ -43,8 +43,8 @@ export default function FlexibleTable({attributes, setAttributes, placeholders, bodyBackground, multipleBodyBackground, - bodyBackgroundOdd, - bodyTextColorOdd, + bodyBackgroundEven, + bodyTextColorEven, bodyTextColor, bodyTextAlign, bodyFontWeight, @@ -257,15 +257,15 @@ export default function FlexibleTable({attributes, setAttributes, placeholders, {multipleBodyBackground ? <> <ColorSelector - label={__('Background color (odd rows)', 'flexible-invoices-core')} - value={bodyBackgroundOdd} - onChange={(value) => setAttributes({bodyBackgroundOdd: value})} + label={__('Background color (even rows)', 'flexible-invoices-core')} + value={bodyBackgroundEven} + onChange={(value) => setAttributes({bodyBackgroundEven: value})} /> <ColorSelector - label={__('Text color (odd rows)', 'flexible-invoices-core')} - value={bodyTextColorOdd} + label={__('Text color (even rows)', 'flexible-invoices-core')} + value={bodyTextColorEven} enableAlpha={false} - onChange={(value) => setAttributes({bodyTextColorOdd: value})} + onChange={(value) => setAttributes({bodyTextColorEven: value})} /> </> : '' @@ -387,7 +387,7 @@ export default function FlexibleTable({attributes, setAttributes, placeholders, {Array.from({length: 2}).map((_, trIndex) => ( <tr className={"fitb-item-table-row"} style={{ - background: (multipleBodyBackground && trIndex === 1) ? bodyBackgroundOdd : bodyBackground, + background: (multipleBodyBackground && trIndex === 1) ? bodyBackgroundEven : bodyBackground, borderStyle: "solid", borderColor: bodyBorderRowColor, borderTopWidth: bodyBorderRowWidthTop, @@ -411,7 +411,7 @@ export default function FlexibleTable({attributes, setAttributes, placeholders, key={index} value={row} style={{ - color: (multipleBodyBackground && trIndex === 1) ? bodyTextColorOdd : bodyTextColor, + color: (multipleBodyBackground && trIndex === 1) ? bodyTextColorEven : bodyTextColor, textAlign: bodyTextAlign, fontStyle: bodyFontStyle, fontSize: bodyFontSize, -- GitLab