diff options
author | Sascha <GlancingMind@outlook.com> | 2021-04-08 18:02:33 +0200 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-04-08 19:03:08 +0200 |
commit | c37d3d771806f9709c0c9fc77b5bbf8806a2ec23 (patch) | |
tree | 191f7a5f10d267a883afe53b3490e22a9c978d71 /webui/src/components | |
parent | 116e0533b651a19523d69af79ac618b6cd986289 (diff) | |
download | git-bug-c37d3d771806f9709c0c9fc77b5bbf8806a2ec23.tar.gz |
Fix label alignment to title on bug list page
Also add className support for custom label component.
This allows to set the margin of an label where the label is used instead of
defining a fixed margin in the label component.
Diffstat (limited to 'webui/src/components')
-rw-r--r-- | webui/src/components/Label.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webui/src/components/Label.tsx b/webui/src/components/Label.tsx index e719eee0..a1d3c6f9 100644 --- a/webui/src/components/Label.tsx +++ b/webui/src/components/Label.tsx @@ -26,21 +26,22 @@ const createStyle = (color: Color, maxWidth?: string) => ({ backgroundColor: _rgb(color), color: getTextColor(_rgb(color)), borderBottomColor: darken(_rgb(color), 0.2), - margin: '3px', maxWidth: maxWidth, }); type Props = { label: LabelFragment; maxWidth?: string; + className?: string; }; -function Label({ label, maxWidth }: Props) { +function Label({ label, maxWidth, className }: Props) { return ( <Chip size={'small'} label={label.name} + className={className} style={createStyle(label.color, maxWidth)} - ></Chip> + /> ); } export default Label; |