How to use the cozy-ui/transpiled/react/Figure.defaultProps 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 / utils / flag.js View on Github external
const slug = splitted[0]
  const domain = splitted.slice(1).join('.')
  const rx = new RegExp(slug + '.*' + domain.replace('.', '\\.'))
  return rx.exec(location)
}

const isDemoCozy = () => {
  const location = window.location.href
  return some(demoFqdns.map(fqdn => locationMatchesFqdn(location, fqdn)))
}

if (isDemoCozy()) {
  flag('demo', true)
}

Figure.defaultProps = Object.assign({}, Figure.defaultProps, {
  blurred: flag('amount_blur') ? true : false
})

flag.store.on('change', function(flagName) {
  if (flagName == 'amount_blur') {
    Figure.defaultProps.blurred = flag('amount_blur')
  }
})

window.flag = flag
github cozy / cozy.github.io / en / cozy-banks / src / utils / flag.js View on Github external
flag.store.on('change', function(flagName) {
  if (flagName == 'amount_blur') {
    Figure.defaultProps.blurred = flag('amount_blur')
  }
})