chore: add missing react prop types (#1651)

This commit is contained in:
Caleb
2018-08-27 10:23:21 -06:00
committed by Shawn Erquhart
parent e215f6889c
commit 922b1846cb
39 changed files with 245 additions and 8 deletions

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'react-emotion';
import Icon from './Icon';
import { buttons, shadows } from './styles';
@ -50,4 +51,12 @@ const AuthenticationPage = ({
);
};
AuthenticationPage.propTypes = {
onLogin: PropTypes.func,
loginDisabled: PropTypes.bool,
loginErrorMessage: PropTypes.node,
renderButtonContent: PropTypes.func,
renderPageContent: PropTypes.func,
};
export default AuthenticationPage;

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css } from 'react-emotion';
import { Wrapper, Button as DropdownButton, Menu, MenuItem } from 'react-aria-menubutton';
import { buttons, components } from './styles';
@ -76,6 +77,15 @@ const Dropdown = ({
);
};
Dropdown.propTypes = {
renderButton: PropTypes.func.isRequired,
dropdownWidth: PropTypes.string,
dropdownPosition: PropTypes.string,
dropdownTopOverlap: PropTypes.string,
className: PropTypes.string,
children: PropTypes.node,
};
const DropdownItem = ({ label, icon, iconDirection, onClick, className }) => (
<StyledMenuItem value={onClick} className={className}>
<span>{label}</span>
@ -87,4 +97,12 @@ const DropdownItem = ({ label, icon, iconDirection, onClick, className }) => (
</StyledMenuItem>
);
DropdownItem.propTypes = {
label: PropTypes.string,
icon: PropTypes.string,
iconDirection: PropTypes.string,
onClick: PropTypes.func,
className: PropTypes.string,
};
export { Dropdown as default, DropdownItem, DropdownButton, StyledDropdownButton };

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'react-emotion';
import icons from './Icon/icons';
@ -59,4 +60,11 @@ const Icon = ({ type, direction, size = 'medium', className }) => (
/>
);
Icon.propTypes = {
type: PropTypes.string.isRequired,
direction: PropTypes.oneOf(['right', 'down', 'left', 'up']),
size: PropTypes.string,
className: PropTypes.string,
};
export default styled(Icon)``;

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'react-emotion';
import Icon from './Icon';
import { colors, lengths, buttons } from './styles';
@ -58,6 +59,13 @@ const ListItemTopBar = ({ className, collapsed, onCollapseToggle, onRemove, drag
</TopBar>
);
ListItemTopBar.propTypes = {
className: PropTypes.string,
collapsed: PropTypes.bool,
onCollapseToggle: PropTypes.func,
onRemove: PropTypes.func,
};
const StyledListItemTopBar = styled(ListItemTopBar)`
display: flex;
justify-content: space-between;

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css, keyframes } from 'react-emotion';
import CSSTransition from 'react-transition-group/CSSTransition';
import { colors } from './styles';
@ -54,6 +55,11 @@ const LoaderItem = styled.div`
`;
export class Loader extends React.Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
};
state = {
currentItem: 0,
};

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css } from 'react-emotion';
import Icon from './Icon';
import { colors, buttons } from './styles';
@ -73,4 +74,13 @@ const ObjectWidgetTopBar = ({
</TopBarContainer>
);
ObjectWidgetTopBar.propTypes = {
allowAdd: PropTypes.bool,
onAdd: PropTypes.func,
onCollapseToggle: PropTypes.func,
collapsed: PropTypes.bool,
heading: PropTypes.node,
label: PropTypes.string,
};
export default ObjectWidgetTopBar;

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css } from 'react-emotion';
import ReactToggled from 'react-toggled';
import { colors, colorsRaw, shadows, transitions } from './styles';
@ -65,6 +66,17 @@ const Toggle = ({
</ReactToggled>
);
Toggle.propTypes = {
active: PropTypes.bool,
onChange: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
className: PropTypes.string,
Container: PropTypes.func,
Background: PropTypes.func,
Handle: PropTypes.func,
};
const StyledToggle = styled(Toggle)``;
export { StyledToggle as default, ToggleContainer, ToggleBackground, ToggleHandle };