Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove xmas/halloween feature flags #5271

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: leave it like this, but here not sure you should leave a TODO. We really won't do anything here. We will just come back when we have another seasonal theme, but this TODO is something we don't want to act right now

// 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
Loading