mirror of
https://github.com/plankanban/planka.git
synced 2025-12-29 17:25:05 +03:00
Background gradients, migrate from CSS to SCSS, remove !important
This commit is contained in:
33
client/src/components/Background/Background.jsx
Normal file
33
client/src/components/Background/Background.jsx
Normal 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;
|
||||
Reference in New Issue
Block a user