From 61bfccafa8384f8a2e85d699c5f4d46b6bdd7dfa Mon Sep 17 00:00:00 2001 From: Janto Date: Mon, 10 Apr 2023 13:31:42 +0200 Subject: [PATCH 1/4] feat: change makestyles to styled component Note component --- packages/react-ui/src/widgets/legend/Note.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/react-ui/src/widgets/legend/Note.js b/packages/react-ui/src/widgets/legend/Note.js index 57b9e1fce..fa4a85980 100644 --- a/packages/react-ui/src/widgets/legend/Note.js +++ b/packages/react-ui/src/widgets/legend/Note.js @@ -1,16 +1,13 @@ import { Box } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; +import { styled } from '@mui/material/styles'; import React from 'react'; import Typography from '../../components/atoms/Typography'; -const useNoteStyles = makeStyles(() => ({ - note: { - fontWeight: 'normal' - } +const LighterTypography = styled(Typography)(({ theme }) => ({ + fontWeight: 'normal' })); export default function Note({ children }) { - const classes = useNoteStyles(); if (!children) { return null; @@ -19,9 +16,9 @@ export default function Note({ children }) { return ( Note:{' '} - + {children} - + ); } From 386694512d8f00bb9d01953dfef832f73ebca3dd Mon Sep 17 00:00:00 2001 From: Janto Date: Mon, 10 Apr 2023 13:33:03 +0200 Subject: [PATCH 2/4] feat: change makestyles to styled component Note component --- packages/react-ui/src/widgets/legend/Note.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-ui/src/widgets/legend/Note.js b/packages/react-ui/src/widgets/legend/Note.js index fa4a85980..42ac7ad64 100644 --- a/packages/react-ui/src/widgets/legend/Note.js +++ b/packages/react-ui/src/widgets/legend/Note.js @@ -3,7 +3,7 @@ import { styled } from '@mui/material/styles'; import React from 'react'; import Typography from '../../components/atoms/Typography'; -const LighterTypography = styled(Typography)(({ theme }) => ({ +const FontWeightNormalTypography = styled(Typography)(({ theme }) => ({ fontWeight: 'normal' })); @@ -16,9 +16,9 @@ export default function Note({ children }) { return ( Note:{' '} - + {children} - + ); } From c3191c8956397639faefb9cb580c6dfd924e2df8 Mon Sep 17 00:00:00 2001 From: Janto Date: Mon, 10 Apr 2023 16:05:50 +0200 Subject: [PATCH 3/4] fix: remove unnecesary customization --- packages/react-ui/src/widgets/legend/Note.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/react-ui/src/widgets/legend/Note.js b/packages/react-ui/src/widgets/legend/Note.js index 42ac7ad64..b2e44d74e 100644 --- a/packages/react-ui/src/widgets/legend/Note.js +++ b/packages/react-ui/src/widgets/legend/Note.js @@ -1,14 +1,8 @@ import { Box } from '@mui/material'; -import { styled } from '@mui/material/styles'; import React from 'react'; import Typography from '../../components/atoms/Typography'; -const FontWeightNormalTypography = styled(Typography)(({ theme }) => ({ - fontWeight: 'normal' -})); - export default function Note({ children }) { - if (!children) { return null; } @@ -16,9 +10,7 @@ export default function Note({ children }) { return ( Note:{' '} - - {children} - + {children} ); } From ade4ef98f1c06aa439b504803415017f51bcf24a Mon Sep 17 00:00:00 2001 From: Janto Date: Tue, 11 Apr 2023 08:33:27 +0200 Subject: [PATCH 4/4] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7f3d285..5f7817dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Not released - Storybook documentation and fixes [#629](https://github.com/CartoDB/carto-react/pull/629) +- Note component cleaned styles from makeStyles [#630](https://github.com/CartoDB/carto-react/pull/630) ## 2.0