diff --git a/CHANGELOG.md b/CHANGELOG.md index a24c2b00a2..e49a640479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.54.2](https://github.com/cowprotocol/cowswap/compare/v1.54.1...v1.54.2) (2024-01-08) + + +### Bug Fixes + +* disable Christmas theme ([#3582](https://github.com/cowprotocol/cowswap/issues/3582)) ([94643fb](https://github.com/cowprotocol/cowswap/commit/94643fb3ca77aea37b772d823cc48665b441eeaa)) + ## [1.54.1](https://github.com/cowprotocol/cowswap/compare/v1.54.0...v1.54.1) (2023-12-28) diff --git a/apps/cowswap-frontend/src/common/hooks/useIsProviderNetworkUnsupported.ts b/apps/cowswap-frontend/src/common/hooks/useIsProviderNetworkUnsupported.ts index 0fe73bbf8b..e25ff95e90 100644 --- a/apps/cowswap-frontend/src/common/hooks/useIsProviderNetworkUnsupported.ts +++ b/apps/cowswap-frontend/src/common/hooks/useIsProviderNetworkUnsupported.ts @@ -1,3 +1,5 @@ +import { useMemo } from 'react' + import { SupportedChainId } from '@cowprotocol/cow-sdk' import { useWeb3React } from '@web3-react/core' @@ -7,9 +9,13 @@ export function useIsProviderNetworkUnsupported(): boolean { const { chainId } = useWeb3React() const { isSepoliaEnabled } = useFeatureFlags() - if (chainId === SupportedChainId.SEPOLIA && !isSepoliaEnabled) { - return true - } + return useMemo(() => { + if (!chainId) return false + + if (chainId === SupportedChainId.SEPOLIA) { + return !isSepoliaEnabled + } - return !!chainId && !(chainId in SupportedChainId) + return !(chainId in SupportedChainId) + }, [chainId, isSepoliaEnabled]) } diff --git a/apps/cowswap-frontend/src/cow-react/index.tsx b/apps/cowswap-frontend/src/cow-react/index.tsx index 542973e525..14289ed526 100644 --- a/apps/cowswap-frontend/src/cow-react/index.tsx +++ b/apps/cowswap-frontend/src/cow-react/index.tsx @@ -61,9 +61,9 @@ function Main() { - + {!isInjectedWidgetMode && ( diff --git a/apps/cowswap-frontend/src/legacy/components/Card/index.tsx b/apps/cowswap-frontend/src/legacy/components/Card/index.tsx index 72d455b5bf..248a2a350a 100644 --- a/apps/cowswap-frontend/src/legacy/components/Card/index.tsx +++ b/apps/cowswap-frontend/src/legacy/components/Card/index.tsx @@ -24,7 +24,7 @@ export const LightCard = styled(Card)` width: 100%; border-radius: 16px; height: 100%; - border: 1px solid var(${UI.COLOR_PAPER_DARKER}); + border: 2px solid var(${UI.COLOR_PAPER_DARKEST}); opacity: 0.2; user-select: none; pointer-events: none; diff --git a/apps/cowswap-frontend/src/legacy/components/Header/index.tsx b/apps/cowswap-frontend/src/legacy/components/Header/index.tsx index e3d04e6faa..55bf885e85 100644 --- a/apps/cowswap-frontend/src/legacy/components/Header/index.tsx +++ b/apps/cowswap-frontend/src/legacy/components/Header/index.tsx @@ -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' @@ -107,9 +108,11 @@ export default function Header() { {/* WINTER THEME ONLY */} - - - + {CHRISTMAS_THEME_ENABLED && ( + + + + )} {/* WINTER THEME ONLY */} diff --git a/apps/cowswap-frontend/src/legacy/theme/cowSwapAssets.ts b/apps/cowswap-frontend/src/legacy/theme/cowSwapAssets.ts index 11003a4dc8..022207adbe 100644 --- a/apps/cowswap-frontend/src/legacy/theme/cowSwapAssets.ts +++ b/apps/cowswap-frontend/src/legacy/theme/cowSwapAssets.ts @@ -1,3 +1,7 @@ +import { CHRISTMAS_THEME_ENABLED } from '@cowprotocol/common-const' + +import { defaultCover } from './themeCovers/defaultCover' + export function cowSwapLogo(darkMode: boolean): string { // Regular Dark mode logo const darkModeLogo = ` @@ -13,164 +17,11 @@ export function cowSwapLogo(darkMode: boolean): string { // Footer cows image // Winter Theme: Footer CoWs export function footerImage(darkMode: boolean): string { - const lightModeImage = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ` - - const darkModeImage = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ` - - return darkMode ? darkModeImage : lightModeImage + if (CHRISTMAS_THEME_ENABLED) { + throw new Error('Uncomment the code bellow') + // return christmasCover(darkMode) + } + return defaultCover(darkMode) } // Winter Theme diff --git a/apps/cowswap-frontend/src/legacy/theme/themeCovers/christmasCover.ts b/apps/cowswap-frontend/src/legacy/theme/themeCovers/christmasCover.ts new file mode 100644 index 0000000000..021f45da24 --- /dev/null +++ b/apps/cowswap-frontend/src/legacy/theme/themeCovers/christmasCover.ts @@ -0,0 +1,160 @@ +export function christmasCover(darkMode: boolean): string { + const lightModeImage = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ` + + const darkModeImage = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ` + + return darkMode ? darkModeImage : lightModeImage +} diff --git a/apps/cowswap-frontend/src/legacy/theme/themeCovers/defaultCover.ts b/apps/cowswap-frontend/src/legacy/theme/themeCovers/defaultCover.ts new file mode 100644 index 0000000000..04c084a670 --- /dev/null +++ b/apps/cowswap-frontend/src/legacy/theme/themeCovers/defaultCover.ts @@ -0,0 +1,98 @@ +export function defaultCover(darkMode: boolean): string { + const lightModeImage = `` + + const darkModeImage = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ` + + return darkMode ? darkModeImage : lightModeImage +} diff --git a/apps/cowswap-frontend/src/modules/application/containers/App/index.tsx b/apps/cowswap-frontend/src/modules/application/containers/App/index.tsx index 6ca3c3bc54..d4bcbc9739 100644 --- a/apps/cowswap-frontend/src/modules/application/containers/App/index.tsx +++ b/apps/cowswap-frontend/src/modules/application/containers/App/index.tsx @@ -1,3 +1,4 @@ +import { CHRISTMAS_THEME_ENABLED } from '@cowprotocol/common-const' import { isInjectedWidget } from '@cowprotocol/common-utils' import ErrorBoundary from 'legacy/components/ErrorBoundary' @@ -51,7 +52,7 @@ export function App() { ) : (