From 6a4ae4cc7bad90c9dc1fcb1ef71f8635415cd3cd Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Mon, 23 Dec 2024 13:30:24 +0500 Subject: [PATCH 1/2] fix(widget): do not display Christmas background --- .../src/modules/application/containers/App/styled.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/cowswap-frontend/src/modules/application/containers/App/styled.ts b/apps/cowswap-frontend/src/modules/application/containers/App/styled.ts index 8c4428ea74..3506e0c6ff 100644 --- a/apps/cowswap-frontend/src/modules/application/containers/App/styled.ts +++ b/apps/cowswap-frontend/src/modules/application/containers/App/styled.ts @@ -84,6 +84,7 @@ export const BodyWrapper = styled.div<{ customTheme?: CowSwapTheme }>` ${({ customTheme, theme }) => isChristmasTheme(customTheme) && + !theme.isInjectedWidgetMode && ` background-image: url(${theme.darkMode ? IMAGE_BACKGROUND_DARK_CHRISTMAS_MEDIUM : IMAGE_BACKGROUND_LIGHT_CHRISTMAS_MEDIUM}); `} @@ -101,6 +102,7 @@ export const BodyWrapper = styled.div<{ customTheme?: CowSwapTheme }>` ${({ customTheme, theme }) => isChristmasTheme(customTheme) && + !theme.isInjectedWidgetMode && ` background-image: url(${theme.darkMode ? IMAGE_BACKGROUND_DARK_CHRISTMAS_SMALL : IMAGE_BACKGROUND_LIGHT_CHRISTMAS_SMALL}); `} From 4582d67156364fe1866a40227f76c8101d11e1bd Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Mon, 23 Dec 2024 14:11:44 +0500 Subject: [PATCH 2/2] fix(snackbars): stick snackbars widget to header menu --- .../src/common/constants/common.ts | 2 ++ apps/cowswap-frontend/src/cow-react/index.tsx | 3 +- .../application/containers/App/index.tsx | 2 ++ .../src/containers/SnackbarsWidget/index.tsx | 21 ++++++++--- libs/snackbars/src/hooks/useAnchorPosition.ts | 36 +++++++++++++++++++ libs/ui/src/pure/MenuBar/index.tsx | 3 ++ 6 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 libs/snackbars/src/hooks/useAnchorPosition.ts diff --git a/apps/cowswap-frontend/src/common/constants/common.ts b/apps/cowswap-frontend/src/common/constants/common.ts index b0c57ea57c..4834eb4d7f 100644 --- a/apps/cowswap-frontend/src/common/constants/common.ts +++ b/apps/cowswap-frontend/src/common/constants/common.ts @@ -9,3 +9,5 @@ export const MAX_ORDER_DEADLINE = ms`1y` // https://github.com/cowprotocol/infra // Use a 150K gas as a fallback if there's issue calculating the gas estimation (fixes some issues with some nodes failing to calculate gas costs for SC wallets) export const GAS_LIMIT_DEFAULT = BigNumber.from('150000') + +export const APP_HEADER_ELEMENT_ID = 'cowswap-app-header' diff --git a/apps/cowswap-frontend/src/cow-react/index.tsx b/apps/cowswap-frontend/src/cow-react/index.tsx index 178b000b91..0074fbdef9 100644 --- a/apps/cowswap-frontend/src/cow-react/index.tsx +++ b/apps/cowswap-frontend/src/cow-react/index.tsx @@ -27,6 +27,7 @@ import { Updaters } from 'modules/application/containers/App/Updaters' import { WithLDProvider } from 'modules/application/containers/WithLDProvider' import { useInjectedWidgetParams } from 'modules/injectedWidget' +import { APP_HEADER_ELEMENT_ID } from '../common/constants/common' import { WalletUnsupportedNetworkBanner } from '../common/containers/WalletUnsupportedNetworkBanner' import { BlockNumberProvider } from '../common/hooks/useBlockNumber' @@ -85,7 +86,7 @@ function Web3ProviderInstance({ children }: { children: ReactNode }) { function Toasts() { const { disableToastMessages = false } = useInjectedWidgetParams() - return