Skip to content

Commit

Permalink
fix: revert halloween theme (#3306)
Browse files Browse the repository at this point in the history
* chore: revert og images

* chore: revert layer3 banner

* chore: revert halloween theme
  • Loading branch information
shoom3301 authored Nov 1, 2023
1 parent 70ed2a8 commit 0c839bc
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 56 deletions.
10 changes: 5 additions & 5 deletions apps/cowswap-frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
property="og:description"
content="CoW Swap finds the lowest prices from all decentralized exchanges and DEX aggregators & saves you more with p2p trading and protection from MEV"
/>
<!-- TODO: change after halloween-->
<!-- <meta property="og:image" content="https://swap.cow.fi/images/og-meta-cowswap.png?v=2" />-->
<meta property="og:image" content="https://swap.cow.fi/images/og-meta-halloween.png?v=1" />

<meta property="og:image" content="https://swap.cow.fi/images/og-meta-cowswap.png?v=2" />
<!-- <meta property="og:image" content="https://swap.cow.fi/images/og-meta-halloween.png?v=1" />-->
<meta property="og:url" content="https://swap.cow.fi" />

<!-- Twitter media tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@CoWSwap" />
<meta name="twitter:title" content="CoW Swap | The smartest way to trade cryptocurrencies" />
<!-- <meta name="twitter:image" content="https://swap.cow.fi/images/og-meta-cowswap.png?v=2" /> -->
<meta name="twitter:image" content="https://swap.cow.fi/images/og-meta-halloween.png?v=1" />
<meta name="twitter:image" content="https://swap.cow.fi/images/og-meta-cowswap.png?v=2" />
<!-- <meta name="twitter:image" content="https://swap.cow.fi/images/og-meta-halloween.png?v=1" />-->

<!-- Other tags -->
<meta name="fortmatic-site-verification" content="%REACT_APP_FORTMATIC_SITE_VERIFICATION%" />
Expand Down
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/src/common/constants/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fortuneCookieRegular from 'assets/images/fortune-cookie.png'
import fortuneCookieHalloween from 'assets/images/fortuneCookieHalloween.svg'

// Enable to activate halloween theme elements for dark mode
export const HALLOWEEN_MODE = true
export const HALLOWEEN_MODE = false

export enum UI {
// Colors
Expand Down
5 changes: 2 additions & 3 deletions apps/cowswap-frontend/src/legacy/state/cowToken/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ export const cowTokenMiddleware: Middleware<Record<string, unknown>, AppState> =
const { chainId, hash } = action.payload
const transaction = store.getState().transactions[chainId][hash]

// const { userDarkMode, matchesDarkMode } = store.getState().user
// const isDarkMode = userDarkMode === null ? matchesDarkMode : userDarkMode
const isDarkMode = true // TODO: revert after halloween
const { userDarkMode, matchesDarkMode } = store.getState().user
const isDarkMode = userDarkMode === null ? matchesDarkMode : userDarkMode

if (transaction.swapVCow || transaction.swapLockedGNOvCow) {
const status = transaction.receipt?.status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ export const soundMiddleware: Middleware<Record<string, unknown>, AppState> = (s
}
}

// const { userDarkMode, matchesDarkMode } = store.getState().user
// const isDarkMode = userDarkMode === null ? matchesDarkMode : userDarkMode
const isDarkMode = true // TODO: revert after halloween
const { userDarkMode, matchesDarkMode } = store.getState().user
const isDarkMode = userDarkMode === null ? matchesDarkMode : userDarkMode

let cowSound
let showLighningEffect = false
Expand Down
20 changes: 10 additions & 10 deletions apps/cowswap-frontend/src/legacy/state/user/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useWalletInfo } from '@cowprotocol/wallet'
import { Currency, Percent, Token } from '@uniswap/sdk-core'

import JSBI from 'jsbi'
import { shallowEqual } from 'react-redux'

import {
addSerializedToken,
Expand Down Expand Up @@ -37,16 +38,15 @@ export function deserializeToken(serializedToken: SerializedToken): Token {
}

export function useIsDarkMode(): boolean {
return true
// const { userDarkMode, matchesDarkMode } = useAppSelector(
// ({ user: { matchesDarkMode, userDarkMode } }) => ({
// userDarkMode,
// matchesDarkMode,
// }),
// shallowEqual
// )

// return userDarkMode === null ? matchesDarkMode : userDarkMode
const { userDarkMode, matchesDarkMode } = useAppSelector(
({ user: { matchesDarkMode, userDarkMode } }) => ({
userDarkMode,
matchesDarkMode,
}),
shallowEqual
)

return userDarkMode === null ? matchesDarkMode : userDarkMode
}

export function useDarkModeManager(): [boolean, () => void] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useAtom, useAtomValue, useSetAtom } from 'jotai'
import React, { useMemo } from 'react'

import { OrderKind } from '@cowprotocol/cow-sdk'
import { Layer3Banner } from '@cowprotocol/ui'

import { Field } from 'legacy/state/types'

Expand All @@ -16,7 +15,6 @@ import { BulletListItem, UnlockWidgetScreen } from 'modules/trade/pure/UnlockWid
import { TradeFormValidation, useGetTradeFormValidation } from 'modules/tradeFormValidation'
import { useSetTradeQuoteParams, useTradeQuote } from 'modules/tradeQuote'

import { FeatureGuard } from 'common/containers/FeatureGuard'
import { useRateInfoParams } from 'common/hooks/useRateInfoParams'
import { CurrencyInfo } from 'common/pure/CurrencyInputPanel/types'

Expand Down Expand Up @@ -258,9 +256,6 @@ const LimitOrders = React.memo((props: LimitOrdersProps) => {
inputCurrencyInfo={inputCurrencyInfo}
outputCurrencyInfo={outputCurrencyInfo}
/>
<FeatureGuard featureFlag="layer3BannerEnabled">
<Layer3Banner />
</FeatureGuard>
{tradeContext && (
<LimitOrdersConfirmModal
tradeContext={tradeContext}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const MAIN_MENU: MenuTreeItem[] = [
{
sectionTitle: 'Other',
links: [
// { kind: MenuItemKind.DARK_MODE_BUTTON },
{ kind: MenuItemKind.DARK_MODE_BUTTON },
{ id: MainMenuItemId.OTHER_COW_RUNNER, title: 'CoW Runner', url: Routes.PLAY_COWRUNNER, icon: IMAGE_GAME },
{ id: MainMenuItemId.OTHER_MEV_SLICER, title: 'MEV Slicer', url: Routes.PLAY_MEVSLICER, icon: IMAGE_SLICER },
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useMemo, useState } from 'react'

import { isFractionFalsy } from '@cowprotocol/common-utils'
import { Layer3Banner } from '@cowprotocol/ui'
import { useIsSafeViaWc, useWalletDetails, useWalletInfo } from '@cowprotocol/wallet'

import { NetworkAlert } from 'legacy/components/NetworkAlert/NetworkAlert'
Expand Down Expand Up @@ -37,7 +36,6 @@ import { useTradeRouteContext } from 'modules/trade/hooks/useTradeRouteContext'
import { useWrappedToken } from 'modules/trade/hooks/useWrappedToken'
import { useTradeUsdAmounts } from 'modules/usdAmount'

import { FeatureGuard } from 'common/containers/FeatureGuard'
import { useRateInfoParams } from 'common/hooks/useRateInfoParams'
import { useShouldZeroApprove } from 'common/hooks/useShouldZeroApprove'
import { CurrencyInfo } from 'common/pure/CurrencyInputPanel/types'
Expand Down Expand Up @@ -274,10 +272,6 @@ export function SwapWidget() {
inputCurrencyInfo={inputCurrencyInfo}
outputCurrencyInfo={outputCurrencyInfo}
/>
<FeatureGuard featureFlag="layer3BannerEnabled">
<Layer3Banner addMargin={true} />
</FeatureGuard>

<NetworkAlert />
</TradeWidgetContainer>
</>
Expand Down
1 change: 0 additions & 1 deletion libs/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export * from './pure/SelectDropdown'
export * from './pure/Tooltip'
export * from './pure/Popover'
export * from './pure/ExternalLink'
export * from './pure/Layer3Banner'
export * from './enum'
21 changes: 0 additions & 21 deletions libs/ui/src/pure/Layer3Banner/index.tsx

This file was deleted.

0 comments on commit 0c839bc

Please sign in to comment.