feat: Have theme follow system pref
This commit is contained in:
@ -1,14 +1,22 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { CheckmarkIcon } from 'outline-icons';
|
||||
import styled from 'styled-components';
|
||||
|
||||
type Props = {
|
||||
onClick?: (SyntheticEvent<>) => void | Promise<void>,
|
||||
children?: React.Node,
|
||||
selected?: boolean,
|
||||
disabled?: boolean,
|
||||
};
|
||||
|
||||
const DropdownMenuItem = ({ onClick, children, disabled, ...rest }: Props) => {
|
||||
const DropdownMenuItem = ({
|
||||
onClick,
|
||||
children,
|
||||
selected,
|
||||
disabled,
|
||||
...rest
|
||||
}: Props) => {
|
||||
return (
|
||||
<MenuItem
|
||||
onClick={disabled ? undefined : onClick}
|
||||
@ -17,6 +25,9 @@ const DropdownMenuItem = ({ onClick, children, disabled, ...rest }: Props) => {
|
||||
tabIndex="-1"
|
||||
{...rest}
|
||||
>
|
||||
{selected !== undefined && (
|
||||
<CheckmarkIcon color={selected === false ? 'transparent' : undefined} />
|
||||
)}
|
||||
{children}
|
||||
</MenuItem>
|
||||
);
|
||||
@ -26,6 +37,7 @@ const MenuItem = styled.a`
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 6px 12px;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
|
||||
color: ${props =>
|
||||
|
Reference in New Issue
Block a user