try updating button-select
This commit is contained in:
parent
786e3855e9
commit
1a01b1ddc8
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/pashto-inflector",
|
||||
"version": "1.6.8",
|
||||
"version": "1.6.9",
|
||||
"author": "lingdocs.com",
|
||||
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
||||
"homepage": "https://verbs.lingdocs.com",
|
||||
|
|
|
@ -17,33 +17,29 @@ type PickerProps<T extends string> = {
|
|||
}
|
||||
|
||||
function ButtonSelect<L extends string>(props: PickerProps<L>) {
|
||||
return (
|
||||
<div className="d-inline-flex flex-row justify-content-center">
|
||||
<div className="btn-group">
|
||||
{props.options.map((option) => (
|
||||
<button
|
||||
key={option.value}
|
||||
type="button"
|
||||
className={classNames(
|
||||
"btn",
|
||||
"btn-outline-secondary",
|
||||
{ active: props.value === option.value },
|
||||
{ "btn-sm": props.small || props.xSmall }
|
||||
)}
|
||||
onClick={() => props.handleChange(option.value)}
|
||||
style={{
|
||||
...props.xSmall ?
|
||||
{ fontSize: "small" }: {},
|
||||
...(option.color && (props.value === option.value)) ?
|
||||
{ backgroundColor: option.color } : {},
|
||||
}}
|
||||
>
|
||||
{option.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return <div className="btn-group">
|
||||
{props.options.map((option) => (
|
||||
<button
|
||||
key={option.value}
|
||||
type="button"
|
||||
className={classNames(
|
||||
"btn",
|
||||
"btn-outline-secondary",
|
||||
{ active: props.value === option.value },
|
||||
{ "btn-sm": props.small || props.xSmall }
|
||||
)}
|
||||
onClick={() => props.handleChange(option.value)}
|
||||
style={{
|
||||
...props.xSmall ?
|
||||
{ fontSize: "small" }: {},
|
||||
...(option.color && (props.value === option.value)) ?
|
||||
{ backgroundColor: option.color } : {},
|
||||
}}
|
||||
>
|
||||
{option.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default ButtonSelect;
|
||||
|
|
Loading…
Reference in New Issue