ToggleSwitch

Summary: _typescript_

Reviewed By: priteshrnandgaonkar

Differential Revision: D16830056

fbshipit-source-id: 8bc1e93d781691a6f20f842422b06ec281cf688f
This commit is contained in:
Daniel Büchele
2019-08-20 03:18:32 -07:00
committed by Facebook Github Bot
parent 13ed952c09
commit ea82d7d673
3 changed files with 10 additions and 10 deletions

View File

@@ -6,11 +6,11 @@
*/ */
import React from 'react'; import React from 'react';
import styled from '../styled/index.js'; import styled from 'react-emotion';
import {colors} from './colors.tsx'; import {colors} from './colors';
import Text from './Text.tsx'; import Text from './Text';
export const StyledButton = styled('div')(props => ({ export const StyledButton = styled('div')((props: {toggled: boolean}) => ({
cursor: 'pointer', cursor: 'pointer',
width: '30px', width: '30px',
height: '16px', height: '16px',
@@ -41,13 +41,13 @@ type Props = {
/** /**
* onClick handler. * onClick handler.
*/ */
onClick?: (event: SyntheticMouseEvent<>) => void, onClick?: (event: React.MouseEvent) => void;
/** /**
* whether the button is toggled * whether the button is toggled
*/ */
toggled?: boolean, toggled?: boolean;
className?: string, className?: string;
label?: string, label?: string;
}; };
/** /**

View File

@@ -18,7 +18,7 @@ import Glyph from '../Glyph.js';
import FilterToken from './FilterToken.js'; import FilterToken from './FilterToken.js';
import styled from '../../styled/index.js'; import styled from '../../styled/index.js';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
import ToggleSwitch from '../ToggleSwitch'; import ToggleSwitch from '../ToggleSwitch.tsx';
const SearchBar = styled(Toolbar)({ const SearchBar = styled(Toolbar)({
height: 42, height: 42,

View File

@@ -7,7 +7,7 @@
export {default as styled} from 'react-emotion'; export {default as styled} from 'react-emotion';
export {default as Button} from './components/Button.js'; export {default as Button} from './components/Button.js';
export {default as ToggleButton} from './components/ToggleSwitch.js'; export {default as ToggleButton} from './components/ToggleSwitch.tsx';
export { export {
default as ButtonNavigationGroup, default as ButtonNavigationGroup,
} from './components/ButtonNavigationGroup.js'; } from './components/ButtonNavigationGroup.js';