How to use the cozy-ui/transpiled/react/CozyTheme.useCozyTheme 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 / components / Table / index.jsx View on Github external
export const Table = ({ children, className, ...rest }) => {
  const theme = useCozyTheme()
  return (
    
      {children}
    <table></table>
  )
}
github cozy / cozy.github.io / en / cozy-banks / src / ducks / categories / CategoriesChart.jsx View on Github external
const CategoriesChart = props => {
  const {
    categories,
    selectedCategory,
    width,
    height,
    total,
    currency,
    hasAccount,
    className,
    label
  } = props

  const { t } = useI18n()
  const theme = useCozyTheme()

  const sortedCategories = useMemo(() => getSortedCategories(categories), [
    categories
  ])
  const colors = useMemo(
    () => getCategoriesColors(sortedCategories, selectedCategory),
    [selectedCategory, sortedCategories]
  )

  const labels = sortedCategories.map(category =>
    t(
      `Data.${selectedCategory ? 'subcategories' : 'categories'}.${
        category.name
      }`
    )
  )
github cozy / cozy.github.io / en / cozy-banks / src / components / useTheme.jsx View on Github external
const ThemedComponent = props =&gt; {
    const theme = useCozyTheme()
    return 
  }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / categories / CategoriesHeader.jsx View on Github external
const IncomeToggle = ({ withIncome, onToggle }) =&gt; {
  const theme = useCozyTheme()
  const { t } = useI18n()

  const handleClick = useCallback(
    ev =&gt; {
      return onToggle(ev.target.checked)
    },
    [onToggle]
  )
  return (
    <div>
      </div>
github cozy / cozy.github.io / en / cozy-banks / src / components / Header / Header.spec.jsx View on Github external
const Component = () =&gt; {
      const theme = useCozyTheme()
      return &lt;&gt;{theme}
    }
    expect(
github cozy / cozy.github.io / en / cozy-banks / src / components / Figure / Figure.jsx View on Github external
withCurrencySpacing = true,
    coloredPositive,
    coloredNegative,
    coloredWarning,
    warningLimit,
    signed,
    className,
    total,
    totalClassName,
    currencyClassName,
    size,
    onClick,
    inline
  } = props

  const theme = useCozyTheme()

  let { decimalNumbers } = props
  decimalNumbers = isNaN(decimalNumbers) ? 2 : decimalNumbers

  const totalLocalized =
    typeof total === 'number'
      ? total.toLocaleString('fr-FR', {
          minimumFractionDigits: decimalNumbers,
          maximumFractionDigits: decimalNumbers
        })
      : total
  const isTotalPositive = total > 0
  const isTotalInLimit = total > warningLimit
  const isWarning = !isTotalPositive && !isTotalInLimit && coloredWarning

  return (
github cozy / cozy.github.io / en / cozy-banks / src / components / BackButton / index.jsx View on Github external
export const BackIcon = () =&gt; {
  const theme = useCozyTheme()
  return (
    
  )
}
github cozy / cozy.github.io / en / cozy-banks / src / ducks / account / AccountSwitch.jsx View on Github external
const DownArrow = () =&gt; {
  const theme = useCozyTheme()
  return (
    
  )
}
github cozy / cozy.github.io / en / cozy-banks / src / components / Title / Title.jsx View on Github external
const Title = props =&gt; {
  const theme = useCozyTheme()
  const { children, className } = props

  return (
    
      {children}
    
  )
}