Skip to content

Commit

Permalink
Migrate 'Note' component away from makeStyles + cleanup (#630)
Browse files Browse the repository at this point in the history
Migrate 'Note' component away from makeStyles + cleanup (#630)
  • Loading branch information
jantolg authored Apr 11, 2023
1 parent 04d99b9 commit f8196c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 1 addition & 12 deletions packages/react-ui/src/widgets/legend/Note.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
import { Box } from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import React from 'react';
import Typography from '../../components/atoms/Typography';

const useNoteStyles = makeStyles(() => ({
note: {
fontWeight: 'normal'
}
}));

export default function Note({ children }) {
const classes = useNoteStyles();

if (!children) {
return null;
}

return (
<Box mt={1} data-testid='note-legend'>
<Typography variant='caption'>Note:</Typography>{' '}
<Typography className={classes.note} variant='caption'>
{children}
</Typography>
<Typography variant='caption'>{children}</Typography>
</Box>
);
}

0 comments on commit f8196c4

Please sign in to comment.