Invalid CSS after "...lor: #dddddd; }": expected 1 selector or at-rule, was "padding: {}"
on line 2 of app/sass/main.sass
font-size: ${rem('14px')};
function filterEmptyProps(obj) {
const result = {};
Object.entries(obj).forEach(([ key, val ]) => {
if (val || val === 0) {
result[key] = val;
}
});
return result;
}
import React from 'react';
import styled from 'styled-components';
const SVG = styled.svg`
display: inline-block;
vertical-align: middle;
`;
const Icon = ({ name, ...props }) {
if (!name) {
throw new Error('Unknown icon name!');
}
return (
<SVG {...props}>
<use xlinkHref={`#icon-${name}`} />
</SVG>
);
}
export default Icon;
import React from 'react';
import styled from 'styled-components';
import { Icon } from './components';
const StyledIcon = styled(Icon)`
fill: ${props => props.state.fill};
`;
const Example = ({ iconState }) => <StyledSVG name="profile" state={iconState} />;
export default Example;
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
class Example extends Component {
handler = () => {
this.props.history.push('/cources');
};
render() { /* ... */ }
}
export default withRouter(Example);
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
class Example extends Component {
render() {
return <Link to="/cources" />;
}
}
export default Example;
var TIME_FROM = 0;
var TIME_TO = 9;
var date = new Date();
var clientLocalHour = date.getHours();
if (clientLocalHour >= TIME_FROM && clientLocalHour < TIME_TO) {
$('.ageWindow').fadeIn(100);
}
function addAge() {
$('.ageWindow').fadeOut(500);
}
var SERVICE_TIMEZONE = 3;
var TIME_FROM = 0;
var TIME_TO = 9;
var date = new Date();
var clientLocalHour = date.getHours();
var timezoneOffset = date.getTimezoneOffset() / 60;
var serviceComputedHour = clientLocalHour + timezoneOffset + SERVICE_TIMEZONE;
if (serviceComputedHour >= TIME_FROM && serviceComputedHour < TIME_TO) {
$('.ageWindow').fadeIn(100);
}
function addAge() {
$('.ageWindow').fadeOut(500);
}
const foo = (arg: number) => { /* do something with number type */ };
var sorted_fruits_2016 = fruits_2016.sort(sortById);
var sorted_fruits_2017 = fruits_2017.sort(sortById);
var sorted_fruits_2018 = fruits_2018.sort(sortById);
var result_2016_2017 = compare(sorted_fruits_2016, sorted_fruits_2017);
var result_2017_2018 = compare(sorted_fruits_2017, sorted_fruits_2018);
function compare(oldArr, newArr) {
var deleted = [], added = [], notChanged = [];
var innerIndex = 0;
if (!newArr.length) {
return {
added: added,
deleted: oldArr,
notChanged: notChanged
};
}
for (var i = 0; i < newArr.length; i++) {
if (innerIndex >= oldArr.length - 1) {
added.push(newArr[i]);
continue;
}
for (var j = innerIndex; j < oldArr.length; j++) {
var newElId = newArr[i][0];
var oldElId = oldArr[j][0];
if (newElId > oldElId) {
deleted.push(oldArr[j]);
} else if (newElId < oldElId) {
added.push(newArr[i]);
innerIndex = j;
break;
} else {
notChanged.push(newArr[i]);
innerIndex = j + 1;
break;
}
}
}
return {
deleted: deleted,
added: added,
notChanged: notChanged
};
}
function sortById(a, b) {
return a[0] - b[0];
}
var result = compare(fruits_2016, fruits_2017);
console.log('result', result);
function compare(oldArr, newArr) {
var sortedOldArr = oldArr.sort(sortById);
var sortedNewArr = newArr.sort(sortById);
return compareSorted(sortedOldArr, sortedNewArr);
}
function compareSorted(oldArr, newArr) {
var deleted = [], added = [], notChanged = [];
var innerIndex = 0;
if (!newArr.length) {
return {
added: added,
deleted: oldArr,
notChanged: notChanged
};
}
for (var i = 0; i < newArr.length; i++) {
if (innerIndex >= oldArr.length - 1) {
added.push(newArr[i]);
continue;
}
for (var j = innerIndex; j < oldArr.length; j++) {
var newElId = newArr[i][0];
var oldElId = oldArr[j][0];
if (newElId > oldElId) {
deleted.push(oldArr[j]);
} else if (newElId < oldElId) {
added.push(newArr[i]);
innerIndex = j;
break;
} else {
notChanged.push(newArr[i]);
innerIndex = j + 1;
break;
}
}
}
return {
deleted: deleted,
added: added,
notChanged: notChanged
};
}
function sortById(a, b) {
return a[0] - b[0];
}
<a href="http://mail.ru" class="item-link item-link_first">item</a>
<a href="http://mail.ru" class="top-menu__item-link item-link_first">item</a>
<a href="http://mail.ru" class="top-menu__item-link_first">item</a>