Skip to content

Commit

Permalink
fix: text inverted computation not working
Browse files Browse the repository at this point in the history
  • Loading branch information
abelflopes committed Nov 13, 2023
1 parent 17757ad commit c62dcb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/text/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Text = ({
children,
...otherProps
}: Readonly<TextProps>): React.ReactElement => {
const { inverted } = useThemeContext();
const theme = useThemeContext();

const computedVariations = Array.isArray(variation) ? variation : variation && [variation];

Expand All @@ -41,11 +41,11 @@ export const Text = ({
},
computedVariations?.filter((index) => index !== "inverted").map((index) => styles[index]),
{
[`${styles.inverted}`]: inverted && !computedVariations?.includes("inverted"),
[`${styles.inverted}`]: computedVariations?.includes("inverted") ?? theme.inverted,
},
className,
),
[className, computedVariations, inverted, margin, type],
[className, computedVariations, theme, margin, type],
);

const tag = useMemo<keyof ReactHTML>(() => {
Expand Down

0 comments on commit c62dcb6

Please sign in to comment.