This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/app/components/DropdownMenu/DropdownMenuItem.js
Tom Moor d024d31f66 refactor: flow typing (#1012)
* fix: padding

* fix: Minor button alignment issues

* feat: Add icon to invite people button

* WIP
2019-08-08 23:09:09 -07:00

54 lines
959 B
JavaScript

// @flow
import * as React from 'react';
import styled from 'styled-components';
type Props = {
onClick?: (SyntheticEvent<>) => void | Promise<void>,
children?: React.Node,
disabled?: boolean,
};
const DropdownMenuItem = ({ onClick, children, ...rest }: Props) => {
return (
<MenuItem onClick={onClick} {...rest}>
{children}
</MenuItem>
);
};
const MenuItem = styled.a`
display: flex;
margin: 0;
padding: 6px 12px;
height: 32px;
color: ${props =>
props.disabled ? props.theme.textTertiary : props.theme.textSecondary};
justify-content: left;
align-items: center;
font-size: 15px;
cursor: default;
svg:not(:last-child) {
margin-right: 8px;
}
${props =>
props.disabled
? ''
: `
&:hover {
color: ${props.theme.white};
background: ${props.theme.primary};
cursor: pointer;
svg {
fill: ${props.theme.white};
}
}
`};
`;
export default DropdownMenuItem;