Skip to content

Commit

Permalink
refactor(theme): remove widget mode flags from ThemeProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
fairlighteth committed Feb 7, 2025
1 parent 1cec3c2 commit f06410f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions apps/explorer/src/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { PropsWithChildren, useMemo } from 'react'

import { isIframe, isInjectedWidget } from '@cowprotocol/common-utils'
import { baseTheme } from '@cowprotocol/ui'

// eslint-disable-next-line no-restricted-imports
Expand All @@ -11,16 +10,6 @@ import { getFonts, getThemePalette } from './styles'

import { useThemeMode } from '../hooks/useThemeManager'

// These values are static and don't change during runtime
const isWidget = isInjectedWidget()
const widgetMode = {
isWidget,
isIframe: isIframe(),
// TODO: isInjectedWidgetMode is deprecated, use isWidget instead
// This alias is kept for backward compatibility with styled components
isInjectedWidgetMode: isWidget,
}

export const ThemeProvider = ({ children }: PropsWithChildren) => {
const mode = useThemeMode()

Expand All @@ -33,8 +22,6 @@ export const ThemeProvider = ({ children }: PropsWithChildren) => {
// Compute the app colour pallette using the passed in themeMode
...themePalette,
...fontPalette,
// Add widget mode flags
...widgetMode,
}

return computedTheme
Expand Down

0 comments on commit f06410f

Please sign in to comment.