mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Make namespace drop down take full width
This commit is contained in:
@@ -43,6 +43,7 @@ class OverviewPageActions extends React.Component<Props> {
|
|||||||
const groupSelector = groups && (
|
const groupSelector = groups && (
|
||||||
<div className={"column is-flex"}>
|
<div className={"column is-flex"}>
|
||||||
<DropDown
|
<DropDown
|
||||||
|
className={"is-fullwidth"}
|
||||||
options={groups}
|
options={groups}
|
||||||
preselectedOption={currentGroup}
|
preselectedOption={currentGroup}
|
||||||
optionSelected={groupSelected}
|
optionSelected={groupSelected}
|
||||||
|
|||||||
@@ -912,6 +912,7 @@ exports[`Storyshots BranchSelector Default 1`] = `
|
|||||||
className="is-fullwidth select"
|
className="is-fullwidth select"
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
|
className="DropDown__FullWidthSelect-jjsyoc-0 cHVjbs"
|
||||||
disabled={false}
|
disabled={false}
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
value=""
|
value=""
|
||||||
@@ -44317,6 +44318,7 @@ exports[`Storyshots Forms|DropDown Add preselect if missing in options 1`] = `
|
|||||||
className="select"
|
className="select"
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
|
className="DropDown__FullWidthSelect-jjsyoc-0 cHVjbs"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
value="D"
|
value="D"
|
||||||
>
|
>
|
||||||
@@ -44353,6 +44355,7 @@ exports[`Storyshots Forms|DropDown Default 1`] = `
|
|||||||
className="select"
|
className="select"
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
|
className="DropDown__FullWidthSelect-jjsyoc-0 cHVjbs"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
value="de"
|
value="de"
|
||||||
>
|
>
|
||||||
@@ -44383,6 +44386,7 @@ exports[`Storyshots Forms|DropDown With Translation 1`] = `
|
|||||||
className="select"
|
className="select"
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
|
className="DropDown__FullWidthSelect-jjsyoc-0 cHVjbs"
|
||||||
onChange={[Function]}
|
onChange={[Function]}
|
||||||
value="dirk"
|
value="dirk"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
import React, { ChangeEvent } from "react";
|
import React, { ChangeEvent } from "react";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
import styled from "styled-components";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
options: string[];
|
options: string[];
|
||||||
@@ -33,6 +34,10 @@ type Props = {
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const FullWidthSelect = styled.select`
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
class DropDown extends React.Component<Props> {
|
class DropDown extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { options, optionValues, preselectedOption, className, disabled } = this.props;
|
const { options, optionValues, preselectedOption, className, disabled } = this.props;
|
||||||
@@ -43,7 +48,7 @@ class DropDown extends React.Component<Props> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(className, "select", disabled ? "disabled" : "")}>
|
<div className={classNames(className, "select", disabled ? "disabled" : "")}>
|
||||||
<select value={preselectedOption ? preselectedOption : ""} onChange={this.change} disabled={disabled}>
|
<FullWidthSelect value={preselectedOption ? preselectedOption : ""} onChange={this.change} disabled={disabled}>
|
||||||
{options.map((option, index) => {
|
{options.map((option, index) => {
|
||||||
const value = optionValues && optionValues[index] ? optionValues[index] : option;
|
const value = optionValues && optionValues[index] ? optionValues[index] : option;
|
||||||
return (
|
return (
|
||||||
@@ -52,7 +57,7 @@ class DropDown extends React.Component<Props> {
|
|||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</select>
|
</FullWidthSelect>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user