Add label picker

This commit is contained in:
2022-03-12 16:33:46 +08:00
parent c84c0b903b
commit f832a5af00
12 changed files with 128 additions and 16 deletions
@@ -0,0 +1,31 @@
@import "../Theme/Theme.scss";
$line-min-height: 26px;
div.label-picker-root {
width: 100%;
display: flex;
flex-wrap: wrap;
min-height: $line-min-height;
padding: 5px 0;
div.input-intro {
width: 50%;
height: 100%;
max-width: 220px;
display: flex;
align-items: center;
padding-right: 5px;
box-sizing: border-box;
}
div.root-content {
width: 50%;
height: 100%;
max-width: 180px;
min-height: $line-min-height;
border-radius: 3px;
overflow: hidden;
display: flex;
}
}
@@ -0,0 +1,38 @@
import { AllI18nKeys, Localization } from "@Component/Localization/Localization";
import { Label } from "@Model/Label";
import { Component, ReactNode } from "react";
import { LabelList } from "../LabelList/LabelList";
import "./LabelPicker.scss"
interface ILabelPickerProps {
keyI18n: AllI18nKeys;
infoI18n?: AllI18nKeys;
labels: Label[];
}
class LabelPicker extends Component<ILabelPickerProps> {
public render(): ReactNode {
return <div
className="label-picker-root"
>
<div className="input-intro">
<Localization i18nKey={this.props.keyI18n}/>
</div>
<div className="root-content">
<LabelList
labels={this.props.labels}
minHeight={26}
deleteLabel={() => {
}}
addLabel={() => {
}}
/>
</div>
</div>
}
}
export { LabelPicker }