Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { connect } from 'react-redux'
import * as d3 from 'utils/d3'
import { withBreakpoints, translate } from 'cozy-ui/transpiled/react'
import LineChart from 'components/Chart/LineChart'
import styles from 'ducks/balance/History.styl'
import { flowRight as compose } from 'lodash'
import cx from 'classnames'
import { getCssVariableValue } from 'cozy-ui/transpiled/react/utils/color'
import { lighten } from '@material-ui/core/styles/colorManipulator'
import flag from 'cozy-flags'
import 'element-scroll-polyfill'
import { getChartDataSelector as getChartData } from 'ducks/chart/selectors'
import { withRouter } from 'react-router'
// on iOS white transparency on SVG failed so we should calculate hexa color
const gradientColor = getCssVariableValue('historyGradientColor') || '#297ef2'
const gradientStyle = {
'0%': lighten(gradientColor, 0.48),
'100%': gradientColor
}
class HistoryChart extends Component {
container = React.createRef()
getTooltipContent = item => {
const date = this.props.f(item.x, 'D MMM')
const balance = item.y.toLocaleString('fr-FR', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
})
return [
export default function ReimbursementsIcon(props) {
const { className, account, size } = props
const icon = categoryIdToIcon[account.categoryId]
return (
<span>
{icon ? (
) : (
)}
<span>
</span>
</span>
)
}
export const setTheme = theme => {
const colorName = THEME_TO_COLORS[theme] || THEME_TO_COLORS.default
const platform = cordova.platformId == 'ios' ? 'IOS' : 'Android'
const varName = colorName + platform
const colorValue = getCssVariableValue(varName)
setColor(colorValue)
}