Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dropdown custom className and style #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions src/Dropdown.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
/* @flow */

import React from 'react';
import type {Node as ReactNode} from 'react';
import PropTypes from 'prop-types';
import React from "react";
import type { Node as ReactNode } from "react";
import PropTypes from "prop-types";

type Props = {
children?: ReactNode;
children?: ReactNode,
className?: string,
style?: Object,
};

export default class Dropdown extends React.Component<Props> {
static propTypes = {
children: PropTypes.node
children: PropTypes.node,
className: PropTypes.string,
style: PropTypes.object,
};

render() {
var style = {
background: "white",
border: "1px solid rgba(0,0,0,.2)",
boxShadow: "0 2px 4px rgba(0,0,0,0.2)",
padding: "6px 0",
...(this.props.style || {}),
};

return (
<div style={{
background: 'white',
border: '1px solid rgba(0,0,0,.2)',
boxShadow: '0 2px 4px rgba(0,0,0,0.2)',
padding: '6px 0'
}}>
<div className={this.props.className} style={style}>
{this.props.children}
</div>
);
Expand Down