Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
feat(Dropdown): add flex prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthomp committed Jun 2, 2018
1 parent 7d30448 commit 6ed15ff
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/Dropdown/Dropdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type DefaultProps = {|
* Is this Dropdown a Card option?
*/
+isOption?: boolean,
/**
* Add flex classes to the Dropdown
*/
+flex?: boolean | "xs" | "sm" | "md" | "lg" | "xl",
|};

type WithAnyTriggerProps = {|
Expand Down Expand Up @@ -159,13 +163,22 @@ class Dropdown extends React.Component<Props, State> {
};

render(): React.Node {
const { className, children, desktopOnly, isOption, ...props } = this.props;
const {
className,
children,
desktopOnly,
isOption,
flex = false,
...props
} = this.props;

const classes = cn(
{
dropdown: true,
"d-none": desktopOnly,
"d-md-flex": desktopOnly,
"d-md-flex": desktopOnly || flex === "md",
[`d-{flex}-flex`]: ["xs", "sm", "lg", "xl"].includes(flex),
"d-flex": typeof flex === "boolean",
"card-options-dropdown": isOption,
show: this.state.isOpen,
},
Expand Down

0 comments on commit 6ed15ff

Please sign in to comment.