chore(v2): fix code style

This commit is contained in:
Alexey Pyltsyn 2020-04-05 17:27:03 +03:00
parent b07507c9cc
commit 6965a668cd
143 changed files with 458 additions and 457 deletions

View file

@ -65,11 +65,11 @@ function ColorGenerator({children, minHeight, url}) {
const [shades, setShades] = useState(COLOR_SHADES);
const color = Color('#' + baseColor);
const adjustedColors = Object.keys(shades)
.map((shade) => ({
.map(shade => ({
...shades[shade],
variableName: shade,
}))
.map((value) => ({
.map(value => ({
...value,
hex: color.darken(value.adjustment).hex(),
}));
@ -84,7 +84,7 @@ function ColorGenerator({children, minHeight, url}) {
id="primary_color"
className={styles.input}
defaultValue={baseColor}
onChange={(event) => {
onChange={event => {
const colorValue = event.target.value;
try {
Color('#' + colorValue);
@ -107,7 +107,7 @@ function ColorGenerator({children, minHeight, url}) {
<tbody>
{adjustedColors
.sort((a, b) => a.displayOrder - b.displayOrder)
.map((value) => {
.map(value => {
const {variableName, adjustment, adjustmentInput, hex} = value;
return (
<tr key={variableName}>
@ -134,7 +134,7 @@ function ColorGenerator({children, minHeight, url}) {
className={styles.input}
type="number"
value={adjustmentInput}
onChange={(event) => {
onChange={event => {
const newValue = parseFloat(event.target.value);
setShades({
...shades,
@ -163,7 +163,7 @@ function ColorGenerator({children, minHeight, url}) {
<CodeBlock className="css">
{adjustedColors
.sort((a, b) => a.codeOrder - b.codeOrder)
.map((value) => `${value.variableName}: ${value.hex.toLowerCase()};`)
.map(value => `${value.variableName}: ${value.hex.toLowerCase()};`)
.join('\n')}
</CodeBlock>
</div>