updating ui components to removing props => props.style. HTML inline style is valid, but should be avoided.

This commit is contained in:
Alex Windett 2017-02-13 12:09:29 +00:00
parent f7b9ea20d0
commit 730b8d27be
10 changed files with 13 additions and 42 deletions

View File

@ -37,8 +37,6 @@ const Avatar = styled.div`
overflow: hidden;
position: relative;
text-align: center;
${props => props.styles}
`;
module.exports = ({
@ -79,7 +77,7 @@ module.exports = ({
);
return (
<Avatar className={className} styles={_style}>
<Avatar className={className} style={_style}>
{av}
</Avatar>
);

View File

@ -26,8 +26,6 @@ const StyledInput = styled.input`
&:disabled + label::after {
opacity: 0.3;
}
${props => props.styles}
`;
const StyledLabel = styled.label`
@ -94,7 +92,7 @@ const Checkbox = ({
onChange={onChange}
readOnly={readOnly}
required={required}
styles={style}
style={style}
tabIndex={tabIndex}
type='checkbox'
/>

View File

@ -17,8 +17,6 @@ const StyledButton = styled.button`
position: absolute;
top: ${remcalc(16)};
right: ${remcalc(16)};
${props => props.styles}
`;
const Close = ({
@ -28,7 +26,7 @@ const Close = ({
return (
<StyledButton
onClick={onClick}
styles={style}
style={style}
>
<img
alt="Close"

View File

@ -2,21 +2,12 @@
const React = require('react');
const ReactRouter = require('react-router-dom');
const Styled = require('styled-components');
const {
default: styled
} = Styled;
const {
Link,
Route
} = ReactRouter;
const StyledLink = styled(Link)`
${props => props.styles}
`;
const NavLink = ({
activeClassName,
activeStyle,
@ -48,7 +39,7 @@ const NavLink = ({
: className;
return (
<StyledLink
<Link
className={clssnm}
// eslint-disable-next-line object-curly-newline
style={isActive ? { ...style, ...activeStyle } : style}
@ -56,7 +47,7 @@ const NavLink = ({
{...rest}
>
{newChildren}
</StyledLink>
</Link>
);
};

View File

@ -31,7 +31,6 @@ const StyledNotification = styled.div`
width: 100%;
${baseBox(0)}
${props => props.styles}
&::before {
background-color: ${props => colors[props.type] || colors.brandPrimary}
@ -61,7 +60,7 @@ const Notificaton = ({
return (
<StyledNotification
className={className}
styles={style}
style={style}
type={type}
>
{ renderClose }

View File

@ -31,10 +31,7 @@ const StyledInput = styled.input`
}
`;
const StyledLabel = styled.label`
${props => props.styles}
`;
const StyledLabel = styled.label``;
const StyledContent = styled.div`
margin-left: ${remcalc(45)};
@ -84,7 +81,7 @@ const Radio = ({
}) => {
return (
<StyledLabel styles={style}>
<StyledLabel style={style}>
<StyledInput
checked={checked}
defaultChecked={defaultChecked}

View File

@ -127,8 +127,6 @@ const StyledRange = styled.input`
&:focus::-ms-fill-upper {
${rangeUpper}
}
${props => props.styles}
`;
const RangeSlider = ({
@ -140,7 +138,7 @@ const RangeSlider = ({
<StyledRange
className={className}
onChange={onChange}
styles={style}
style={style}
type='range'
/>
);

View File

@ -14,8 +14,6 @@ const StyledTitle = styled.h3`
const StyledTableWrapper = styled.section`
font-family: 'LibreFranklin', sans-serif;
font-style: normal;
${props => props.styles}
`;
const Table = ({
@ -28,7 +26,7 @@ const Table = ({
return (
<StyledTableWrapper styles={style}>
<StyledTableWrapper style={style}>
<StyledTitle>{title}</StyledTitle>
<TableContent

View File

@ -15,8 +15,6 @@ const StyledTableWrapper = styled.section`
border: solid 1px ${colors.base.greyDark}
font-family: 'LibreFranklin', sans-serif;
font-style: normal;
${props => props.styles}
`;
const Table = ({
@ -24,7 +22,7 @@ const Table = ({
style,
title,
}) => (
<StyledTableWrapper styles={style}>
<StyledTableWrapper style={style}>
{children}
</StyledTableWrapper>
);

View File

@ -22,10 +22,6 @@ const {
default: styled
} = Styled;
const StyledDiv = styled.div`
${props => props.styles}
`;
const Label = styled.label`
color: ${props => props.error ? colors.alert : colors.fonts.regular}
`;
@ -85,7 +81,7 @@ const Textarea = ({
const _error = error ? (<Error>{error}</Error>) : null;
return (
<StyledDiv styles={style}>
<div style={style}>
<Label
error={error}
htmlFor={id}
@ -116,7 +112,7 @@ const Textarea = ({
value={value}
/>
{_children}
</StyledDiv>
</div>
);
};