Skip to content

Commit

Permalink
fix: disable Christmas theme (#3582)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoom3301 authored Jan 8, 2024
1 parent 48ac835 commit 94643fb
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 164 deletions.
9 changes: 6 additions & 3 deletions apps/cowswap-frontend/src/legacy/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useCallback, useMemo, useState } from 'react'

import { toggleDarkModeAnalytics } from '@cowprotocol/analytics'
import { CHRISTMAS_THEME_ENABLED } from '@cowprotocol/common-const'
import { SupportedChainId } from '@cowprotocol/cow-sdk'
import { useWalletInfo } from '@cowprotocol/wallet'

Expand Down Expand Up @@ -107,9 +108,11 @@ export default function Header() {
</LogoImage>

{/* WINTER THEME ONLY */}
<WinterHat>
<SVG src={winterThemeHat(darkMode)} />
</WinterHat>
{CHRISTMAS_THEME_ENABLED && (
<WinterHat>
<SVG src={winterThemeHat(darkMode)} />
</WinterHat>
)}
{/* WINTER THEME ONLY */}
</UniIcon>
</Title>
Expand Down
167 changes: 9 additions & 158 deletions apps/cowswap-frontend/src/legacy/theme/cowSwapAssets.ts

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions apps/cowswap-frontend/src/legacy/theme/themeCovers/christmasCover.ts

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions apps/cowswap-frontend/src/legacy/theme/themeCovers/defaultCover.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CHRISTMAS_THEME_ENABLED } from '@cowprotocol/common-const'
import { isInjectedWidget } from '@cowprotocol/common-utils'

import ErrorBoundary from 'legacy/components/ErrorBoundary'
Expand Down Expand Up @@ -51,7 +52,7 @@ export function App() {
) : (
<styledEl.FooterWrapper>
<Footer />
<WinterFooter /> {/* Winter Themed Footer */}
{CHRISTMAS_THEME_ENABLED && <WinterFooter />} {/* Winter Themed Footer */}
</styledEl.FooterWrapper>
)}
</styledEl.AppWrapper>
Expand Down
1 change: 1 addition & 0 deletions libs/common-const/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export * from './ipfs'
export * from './gnosis_chain/hack'
export * from './cowprotocolTokenLogoUrl'
export * from './nativeAndWrappedTokens'
export * from './theme'
1 change: 1 addition & 0 deletions libs/common-const/src/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CHRISTMAS_THEME_ENABLED = false
5 changes: 3 additions & 2 deletions libs/common-utils/src/sound.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { CHRISTMAS_THEME_ENABLED } from '@cowprotocol/common-const'

type SoundType = 'SEND' | 'SUCCESS' | 'SUCCESS_CLAIM' | 'ERROR'
type Sounds = Record<SoundType, string>

const COW_SOUNDS: Sounds = {
// SEND: '/audio/send.mp3',
SEND: '/audio/send-winterTheme.mp3',
SEND: CHRISTMAS_THEME_ENABLED ? '/audio/send-winterTheme.mp3' : '/audio/send.mp3',
SUCCESS: '/audio/success.mp3',
SUCCESS_CLAIM: '/audio/success-claim.mp3',
ERROR: '/audio/error.mp3',
Expand Down

2 comments on commit 94643fb

@vercel
Copy link

@vercel vercel bot commented on 94643fb Jan 8, 2024

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 94643fb Jan 8, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

cosmos – ./

cowswap-seven.vercel.app
cosmos-git-main-cowswap.vercel.app
cosmos-cowswap.vercel.app
cosmos.cow.fi

Please sign in to comment.