Skip to content

Commit

Permalink
chore: comment out seasonal feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Jan 8, 2025
1 parent ab50699 commit a3832a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { lazy, PropsWithChildren, Suspense, useMemo } from 'react'

import { ACTIVE_CUSTOM_THEME, CustomTheme } from '@cowprotocol/common-const'
import { useMediaQuery } from '@cowprotocol/common-hooks'
import { useFeatureFlags } from '@cowprotocol/common-hooks'
import { useFeatureFlags, useMediaQuery } from '@cowprotocol/common-hooks'
import { isInjectedWidget } from '@cowprotocol/common-utils'
import { Color, Footer, GlobalCoWDAOStyles, Media, MenuBar } from '@cowprotocol/ui'

Expand Down Expand Up @@ -55,7 +54,10 @@ export function App() {
useAnalyticsReporterCowSwap()
useInitializeUtm()

const { isYieldEnabled, isChristmasEnabled, isHalloweenEnabled } = useFeatureFlags()
const { isYieldEnabled, } = useFeatureFlags()
// TODO: load them from feature flags when we want to enable again
const isChristmasEnabled = false
const isHalloweenEnabled = false

const isInjectedWidgetMode = isInjectedWidget()
const menuItems = useMenuItems()
Expand Down
13 changes: 8 additions & 5 deletions apps/cowswap-frontend/src/modules/sounds/utils/sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { cowSwapStore } from 'legacy/state'

import { injectedWidgetParamsAtom } from 'modules/injectedWidget/state/injectedWidgetParamsAtom'

import { featureFlagsAtom } from 'common/state/featureFlagsState'

type SoundType = 'SEND' | 'SUCCESS' | 'ERROR'
type Sounds = Record<SoundType, string>
type WidgetSounds = keyof NonNullable<CowSwapWidgetAppParams['sounds']>
Expand Down Expand Up @@ -47,7 +45,12 @@ function isDarkMode(): boolean {
}

function getThemeBasedSound(type: SoundType): string {
const featureFlags = jotaiStore.get(featureFlagsAtom) as Record<string, boolean>
// TODO: load featureFlags when enabling again
// const featureFlags = jotaiStore.get(featureFlagsAtom) as Record<string, boolean>
// const { isChristmasEnabled, isHalloweenEnabled } = featureFlags
const isChristmasEnabled = false
const isHalloweenEnabled = false

const defaultSound = DEFAULT_COW_SOUNDS[type]
const themedOptions = THEMED_SOUNDS[type]

Expand All @@ -62,13 +65,13 @@ function getThemeBasedSound(type: SoundType): string {
return defaultSound
}

if (ACTIVE_CUSTOM_THEME === CustomTheme.CHRISTMAS && featureFlags.isChristmasEnabled && themedOptions.winterSound) {
if (ACTIVE_CUSTOM_THEME === CustomTheme.CHRISTMAS && isChristmasEnabled && themedOptions.winterSound) {
return themedOptions.winterSound
}

if (
ACTIVE_CUSTOM_THEME === CustomTheme.HALLOWEEN &&
featureFlags.isHalloweenEnabled &&
isHalloweenEnabled &&
themedOptions.halloweenSound &&
isDarkMode()
) {
Expand Down

0 comments on commit a3832a4

Please sign in to comment.