synapsecns/sanguine

View on GitHub
packages/widget/src/hooks/useThemeVariables.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { useMemo } from 'react'

import { generateTheme } from '@/utils/generateTheme'

export const useThemeVariables = (customTheme) => {
  return useMemo(() => {
    if (customTheme) return generateTheme(customTheme)
    return generateTheme()
  }, [customTheme])
}