How to use the cozy-ui/transpiled/react/utils/color.getCssVariableValue function in cozy-ui

To help you get started, we’ve selected a few cozy-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / ducks / balance / HistoryChart.jsx View on Github external
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 [
github cozy / cozy.github.io / en / cozy-banks / src / ducks / balance / ReimbursementsIcon.jsx View on Github external
export default function ReimbursementsIcon(props) {
  const { className, account, size } = props
  const icon = categoryIdToIcon[account.categoryId]

  return (
    <span>
      {icon ? (
        
      ) : (
        
      )}
      <span>
        
      </span>
    </span>
  )
}
github cozy / cozy.github.io / en / cozy-banks / src / ducks / bar / statusBar.js View on Github external
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)
}