37 lines
544 B
JavaScript
37 lines
544 B
JavaScript
const transition = 'ease-in-out all 0.5s';
|
|
|
|
const types = {
|
|
button: ({
|
|
type,
|
|
color,
|
|
hover
|
|
}) => {
|
|
return {
|
|
backgroundColor: color,
|
|
transition,
|
|
':hover': {
|
|
backgroundColor: hover,
|
|
transition
|
|
}
|
|
};
|
|
},
|
|
text: ({
|
|
type,
|
|
color,
|
|
hover
|
|
}) => {
|
|
return {
|
|
color,
|
|
transition,
|
|
':hover': {
|
|
color: hover,
|
|
transition,
|
|
textDecoration: 'underline'
|
|
}
|
|
};
|
|
}
|
|
};
|
|
|
|
export default (props) => {
|
|
return types[props.type](props);
|
|
}; |