mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-28 03:08:30 +00:00
Set default prop values in function parameter
This commit is contained in:
parent
6258adb007
commit
be49f6901e
@ -1,27 +1,27 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const Icon = (props) => {
|
||||
const Icon = ({ icon, size = 30, color = 'black' }) => {
|
||||
const styles = {
|
||||
svg: {
|
||||
display: 'inline-block',
|
||||
verticalAlign: 'middle',
|
||||
},
|
||||
path: {
|
||||
fill: props.color,
|
||||
fill: color,
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<svg
|
||||
style={styles.svg}
|
||||
width={`${props.size}`}
|
||||
height={`${props.size}`}
|
||||
width={`${size}`}
|
||||
height={`${size}`}
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<path
|
||||
style={styles.path}
|
||||
d={props.icon}
|
||||
d={icon}
|
||||
|
||||
/>
|
||||
</svg>
|
||||
@ -34,9 +34,5 @@ Icon.propTypes = {
|
||||
color: PropTypes.string,
|
||||
};
|
||||
|
||||
Icon.defaultProps = {
|
||||
size: 30,
|
||||
color: 'black',
|
||||
};
|
||||
|
||||
export default Icon;
|
@ -21,7 +21,7 @@ const Wrapper = styled.div`
|
||||
transition: background-color ${TRANSITION_TIME.BASE}, color ${TRANSITION_TIME.BASE};
|
||||
`;
|
||||
|
||||
const AsideRow = ({ children, column }) => (
|
||||
const AsideRow = ({ children, column = false }) => (
|
||||
<Wrapper
|
||||
column={column}
|
||||
>{children}
|
||||
@ -32,8 +32,4 @@ AsideRow.propTypes = {
|
||||
column: PropTypes.bool,
|
||||
};
|
||||
|
||||
AsideRow.defaultProps = {
|
||||
column: false,
|
||||
}
|
||||
|
||||
export default AsideRow;
|
||||
|
Loading…
Reference in New Issue
Block a user