Skip to content

Commit

Permalink
use useTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
kaulfield23 committed Nov 15, 2023
1 parent 4cb6d49 commit 590fad4
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from '@mui/system';
import { Typography } from '@mui/material';
import { Box, useTheme } from '@mui/system';

import { Msg } from 'core/i18n';

Expand All @@ -15,14 +15,12 @@ interface PeopleCounterProps {
status: COUNT_STATUS;
}

enum CounterColors {
created = '#4CAF50',
updated = '#03A9F4',
}
const PeopleCounter: React.FunctionComponent<PeopleCounterProps> = ({
changedNum,
status,
}) => {
const theme = useTheme();

return (
<Box
sx={{
Expand All @@ -32,7 +30,15 @@ const PeopleCounter: React.FunctionComponent<PeopleCounterProps> = ({
width: '100%',
}}
>
<Typography color={CounterColors[status]} variant="h2">
<Typography
sx={{
color:
status === COUNT_STATUS.CREATED
? theme.palette.success.main
: theme.palette.info.light,
}}
variant="h2"
>
{changedNum}
</Typography>
<Msg
Expand Down

0 comments on commit 590fad4

Please sign in to comment.