Icon button styling
This commit is contained in:
1 parent
0a489ea2ea
commit
ee44e225f5
2 files changed
+18
-2
No files matched your search
@@ -8,6 +8,7 @@
|
||||
font-size: 0.75rem;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: $motion-primary;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.container + .container {
|
||||
@@ -17,3 +18,12 @@
|
||||
.title {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.container:active {
|
||||
background-color: $motion-transparent;
|
||||
}
|
||||
@@ -5,14 +5,19 @@ import styles from './icon-button.css';
|
||||
|
||||
const IconButton = ({
|
||||
img,
|
||||
disabled,
|
||||
className,
|
||||
title,
|
||||
onClick
|
||||
}) => (
|
||||
<div
|
||||
className={classNames(styles.container, className)}
|
||||
className={classNames(
|
||||
styles.container,
|
||||
className,
|
||||
disabled ? styles.disabled : null
|
||||
)}
|
||||
role="button"
|
||||
onClick={onClick}
|
||||
onClick={disabled ? null : onClick}
|
||||
>
|
||||
<img
|
||||
className={styles.icon}
|
||||
@@ -27,6 +32,7 @@ const IconButton = ({
|
||||
|
||||
IconButton.propTypes = {
|
||||
className: PropTypes.string,
|
||||
disabled: PropTypes.bool,
|
||||
img: PropTypes.string,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
title: PropTypes.node.isRequired
|
||||
|
||||
Reference in new issue
Block a user