-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add less padding in reusable chips by adding size='small' prop (#2122)
* add less padding in reusable chips by adding size='small' prop * remove unecessary styles
- Loading branch information
1 parent
cad0c10
commit 04dbaf4
Showing
2 changed files
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { Chip, styled } from "@mui/material"; | ||
import { Chip, ChipProps, styled } from "@mui/material"; | ||
import { Palette } from "../../../styles/theme"; | ||
|
||
const ActiveChip = styled(Chip)({ | ||
background: "#C2EACA", | ||
color: "#236430", | ||
const chipStyles = { | ||
fontWeight: "bold", | ||
borderRadius: "4px", | ||
padding: "4px 8px", | ||
gap: "8px", | ||
width: "100px", | ||
minWidth: "80px", | ||
}; | ||
|
||
const ActiveChip = styled(({ size = "small", ...other }: ChipProps) => ( | ||
<Chip size={size} {...other} /> | ||
))({ | ||
background: Palette.success.bg.light, | ||
color: Palette.success.dark, | ||
...chipStyles, | ||
}); | ||
|
||
const InactiveChip = styled(Chip)({ | ||
const InactiveChip = styled(({ size = "small", ...other }: ChipProps) => ( | ||
<Chip size={size} {...other} /> | ||
))({ | ||
background: "#F2F2F2", | ||
color: "#6D7274", | ||
fontWeight: "bold", | ||
borderRadius: "4px", | ||
padding: "4px 8px", | ||
gap: "8px", | ||
width: "100px", | ||
...chipStyles, | ||
}); | ||
|
||
const HighPriorityChip = styled(Chip)({ | ||
const HighPriorityChip = styled(({ size = "small", ...other }: ChipProps) => ( | ||
<Chip size={size} {...other} /> | ||
))({ | ||
background: `${Palette.secondary.bg.light}`, | ||
color: `${Palette.secondary.dark}`, | ||
fontWeight: "bold", | ||
borderRadius: "4px", | ||
padding: "4px 8px", | ||
gap: "8px", | ||
...chipStyles, | ||
}); | ||
|
||
const ErrorChip = styled(Chip)({ | ||
const ErrorChip = styled(({ size = "small", ...other }: ChipProps) => ( | ||
<Chip size={size} {...other} /> | ||
))({ | ||
background: `${Palette.error.bg.light}`, | ||
color: `${Palette.error.dark}`, | ||
fontWeight: "bold", | ||
borderRadius: "4px", | ||
padding: "4px 8px", | ||
gap: "8px", | ||
...chipStyles, | ||
}); | ||
|
||
export { ActiveChip, InactiveChip, HighPriorityChip, ErrorChip }; |