Background gradients, migrate from CSS to SCSS, remove !important

This commit is contained in:
Maksim Eltyshev
2020-05-29 19:31:19 +05:00
parent 8534ed292c
commit 5bfff3865f
312 changed files with 4295 additions and 2989 deletions

View File

@@ -0,0 +1,33 @@
import upperFirst from 'lodash/upperFirst';
import camelCase from 'lodash/camelCase';
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import styles from './Background.module.scss';
import globalStyles from '../../styles.module.scss';
const Background = ({ type, name, imageUrl }) => (
<div
className={classNames(
styles.wrapper,
type === 'gradient' && globalStyles[`background${upperFirst(camelCase(name))}`],
)}
style={{
background: type === 'image' && `url("${imageUrl}") center / cover`,
}}
/>
);
Background.propTypes = {
type: PropTypes.string.isRequired,
name: PropTypes.string,
imageUrl: PropTypes.string,
};
Background.defaultProps = {
name: undefined,
imageUrl: undefined,
};
export default Background;

View File

@@ -0,0 +1,8 @@
:global(#app) {
.wrapper {
height: 100%;
position: fixed;
width: 100%;
z-index: -1;
}
}

View File

@@ -0,0 +1,3 @@
import Background from './Background';
export default Background;