Large update for all components
reorganization, linting, updating file imports, consolidation warning: there will be errors in this commit todo: update webpack, add missing styles, scss files, consolidate the rest of components within features/*
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import './floating_action_button.scss';
|
||||
|
||||
export default class FloatingActionButton extends Component {
|
||||
static propTypes = {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
message: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if (nextProps.message !== this.props.message) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { onClick, message } = this.props;
|
||||
|
||||
return (
|
||||
<button onClick={onClick} className='floating-action-button' aria-label={message} />
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
.floating-action-button {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
||||
@include size(61px, 52px);
|
||||
@include abs-position(auto, 14px, 14px, auto, false);
|
||||
@include background-image('/assets/images/sprite-main-navigation.png', 161px 152px, -100px 0);
|
||||
|
||||
@media screen and (max-width: $nav-breakpoint-3) {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
background-position: -100px -100px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './floating_action_button';
|
||||
Reference in New Issue
Block a user