= {
alert2: `var(${UI.COLOR_ALERT2_TEXT})`,
success: `var(${UI.COLOR_SUCCESS_TEXT})`,
default: `var(${UI.COLOR_TEXT1_INACTIVE})`, // text only
-};
+}
export const Badge = styled.div<{ type?: BadgeType }>`
background: ${({ type }) => badgeBackgrounds[type || 'default']};
@@ -42,8 +42,8 @@ export const Badge = styled.div<{ type?: BadgeType }>`
`
Badge.defaultProps = {
- type: 'default'
-};
+ type: 'default',
+}
export const Link = styled(NavLink)`
display: flex;
@@ -86,36 +86,44 @@ export const Wrapper = styled.div`
export const MenuItem = styled.div<{ isActive?: boolean; isDropdownVisible: boolean }>`
display: flex;
align-items: center;
- font-size: ${({ theme }) => theme.isInjectedWidgetMode ? '16px' : '14px'};
- font-weight: ${({ theme }) => theme.isInjectedWidgetMode ? '600' : '500'};
- border-radius: var(${UI.BORDER_RADIUS_NORMAL});
- padding: ${({ theme }) => theme.isInjectedWidgetMode ? '7px 0' : '5px 10px'};
- background: transparent;
- transition: background 0.2s ease-in-out;
-
- &:hover {
- background: var(${UI.COLOR_GREY});
- }
- ${({ isActive }) =>
- isActive &&
- css`
+ > a {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ text-align: left;
+ font-size: ${({ theme }) => (theme.isInjectedWidgetMode ? '16px' : '14px')};
+ font-weight: ${({ theme }) => (theme.isInjectedWidgetMode ? '600' : '500')};
+ border-radius: var(${UI.BORDER_RADIUS_NORMAL});
+ padding: ${({ theme }) => (theme.isInjectedWidgetMode ? '7px' : '5px 10px')};
+ background: transparent;
+ transition: background 0.2s ease-in-out;
+
+ &:hover {
background: var(${UI.COLOR_GREY});
+ }
- ${Link} {
- color: var(${UI.COLOR_TEXT1});
- }
-
- ${Link} > ${Badge} {
- display: none;
- }
- `}
-
- ${({ isDropdownVisible }) =>
- isDropdownVisible &&
- css`
- padding: 7px 10px;
- `}
+ ${({ isActive }) =>
+ isActive &&
+ css`
+ background: var(${UI.COLOR_GREY});
+
+ ${Link} {
+ color: var(${UI.COLOR_TEXT1});
+ }
+
+ ${Link} > ${Badge} {
+ display: none;
+ }
+ `}
+
+ ${({ isDropdownVisible }) =>
+ isDropdownVisible &&
+ css`
+ padding: 16px;
+ width: 100%;
+ `}
+ }
`
export const SelectMenu = styled.div`
@@ -128,7 +136,7 @@ export const SelectMenu = styled.div`
left: 0;
top: 0;
padding: 16px;
- gap: ${({ theme }) => theme.isInjectedWidgetMode ? '16px' : '24px'};
+ gap: ${({ theme }) => (theme.isInjectedWidgetMode ? '16px' : '24px')};
background: var(${UI.COLOR_CONTAINER_BG_01});
border-radius: var(${UI.BORDER_RADIUS_NORMAL});
`
diff --git a/apps/cowswap-frontend/src/modules/fortune/containers/FortuneWidget/index.tsx b/apps/cowswap-frontend/src/modules/fortune/containers/FortuneWidget/index.tsx
index 2ec8e3ab9f..0210d10a47 100644
--- a/apps/cowswap-frontend/src/modules/fortune/containers/FortuneWidget/index.tsx
+++ b/apps/cowswap-frontend/src/modules/fortune/containers/FortuneWidget/index.tsx
@@ -249,7 +249,7 @@ const FortuneContent = styled.div`
const StyledExternalLink = styled(ExternalLink)`
background: var(${UI.COLOR_GREY});
- border-radius: 24px;
+ border-radius: var(${UI.BORDER_RADIUS_NORMAL});
`
const HeaderElement = styled.div`
diff --git a/apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTableContainer/index.tsx b/apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTableContainer/index.tsx
index 6b0ff20bc3..3c041f54d7 100644
--- a/apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTableContainer/index.tsx
+++ b/apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTableContainer/index.tsx
@@ -12,15 +12,20 @@ import styled from 'styled-components/macro'
import { Web3Status } from 'modules/wallet/containers/Web3Status'
+import { UI } from 'common/constants/theme'
import { CowSwapSafeAppLink } from 'common/pure/CowSwapSafeAppLink'
import { OrdersTable, OrdersTableProps } from './OrdersTable'
import { OrdersTabs, OrdersTabsProps } from './OrdersTabs'
const OrdersBox = styled.div`
- background: transparent;
- border-radius: 16px;
- padding: 0;
+ background: ${({ theme }) => (theme.isInjectedWidgetMode ? `var(${UI.COLOR_CONTAINER_BG_01})` : 'transparent')};
+ border: none;
+ border-radius: var(${UI.BORDER_RADIUS_NORMAL});
+ box-shadow: none;
+ position: relative;
+ padding: ${({ theme }) => (theme.isInjectedWidgetMode ? '16px' : '0')};
+ padding: ${({ theme }) => (theme.isInjectedWidgetMode ? '16px' : '0')};
min-height: 200px;
width: 100%;
`
@@ -180,7 +185,7 @@ export function OrdersTableContainer({
Connect a wallet
- {!isInjectedWidget() && (
+ {!isInjectedWidget && (
<>
diff --git a/apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenModal/styled.ts b/apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenModal/styled.ts
index dc00bb5fb7..7fcd7c78a4 100644
--- a/apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenModal/styled.ts
+++ b/apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenModal/styled.ts
@@ -36,7 +36,7 @@ export const SearchInput = styled.input`
color: var(${UI.COLOR_TEXT1});
padding: 16px;
border: 1px solid var(${UI.COLOR_GREY});
- -webkit-appearance: none;
+ appearance: none;
transition: border 100ms;
background: transparent;
diff --git a/apps/cowswap-frontend/src/modules/tokensList/pure/ModalHeader/index.tsx b/apps/cowswap-frontend/src/modules/tokensList/pure/ModalHeader/index.tsx
index 10ef4f5d85..11aa65725a 100644
--- a/apps/cowswap-frontend/src/modules/tokensList/pure/ModalHeader/index.tsx
+++ b/apps/cowswap-frontend/src/modules/tokensList/pure/ModalHeader/index.tsx
@@ -11,31 +11,45 @@ const Header = styled.div`
justify-content: space-between;
font-weight: 500;
font-size: 20px;
- padding: 20px;
- border-bottom: 1px solid var(${UI.COLOR_BORDER});
+ padding: 10px 0;
+`
+
+const StyledIconButton = styled(IconButton)`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+`
+
+const Title = styled.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-grow: 1;
+ font-size: 18px;
+ font-weight: 600;
+ font-weight: var(${UI.FONT_WEIGHT_BOLD});
`
export interface ModalHeaderProps {
children: string
onBack(): void
- onClose(): void
+ onClose?(): void
className?: string
}
export function ModalHeader({ children, className, onBack, onClose }: ModalHeaderProps) {
return (
-
- {children}
-
-
+ {children}
+ { onClose &&
+
-
+
+ }
)
}
diff --git a/apps/cowswap-frontend/src/modules/tokensList/pure/commonElements.ts b/apps/cowswap-frontend/src/modules/tokensList/pure/commonElements.ts
index b8edf20eec..84c3712c44 100644
--- a/apps/cowswap-frontend/src/modules/tokensList/pure/commonElements.ts
+++ b/apps/cowswap-frontend/src/modules/tokensList/pure/commonElements.ts
@@ -63,7 +63,7 @@ export const ImportButton = styled.button`
font-size: 16px;
font-weight: 600;
padding: 6px 15px;
- border-radius: 24px;
+ border-radius: var(${UI.BORDER_RADIUS_NORMAL});
cursor: pointer;
transition: background-color 0.2s ease-in-out;
diff --git a/apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/index.tsx b/apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/index.tsx
index 59bc94d6ae..f32e5f0b3f 100644
--- a/apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/index.tsx
+++ b/apps/cowswap-frontend/src/modules/trade/containers/TradeWidget/index.tsx
@@ -22,6 +22,7 @@ import { useThrottleFn } from 'common/hooks/useThrottleFn'
import { CurrencyArrowSeparator } from 'common/pure/CurrencyArrowSeparator'
import { CurrencyInputPanel, CurrencyInputPanelProps } from 'common/pure/CurrencyInputPanel'
import { CurrencyInfo } from 'common/pure/CurrencyInputPanel/types'
+import { PoweredFooter } from 'common/pure/PoweredFooter'
import * as styledEl from './styled'
import { TradeWidgetModals } from './TradeWidgetModals'
@@ -201,6 +202,8 @@ export function TradeWidget(props: TradeWidgetProps) {
{isWrapOrUnwrap ? : bottomContent}
>
)}
+
+ {isInjectedWidgetMode && }
diff --git a/apps/cowswap-frontend/src/pages/Claim/styled.ts b/apps/cowswap-frontend/src/pages/Claim/styled.ts
index 78e2615587..917aaebdcb 100644
--- a/apps/cowswap-frontend/src/pages/Claim/styled.ts
+++ b/apps/cowswap-frontend/src/pages/Claim/styled.ts
@@ -1650,7 +1650,7 @@ export const SuccessBanner = styled.div<{ type: string }>`
width: 100%;
height: 86px;
padding: 0 24px;
- border-radius: 24px;
+ border-radius: var(${UI.BORDER_RADIUS_NORMAL});
margin: 0 0 12px;
font-weight: bold;
font-size: 21px;
diff --git a/apps/cowswap-frontend/src/utils/iframeResizer.ts b/apps/cowswap-frontend/src/utils/iframeResizer.ts
new file mode 100644
index 0000000000..94e2820b3e
--- /dev/null
+++ b/apps/cowswap-frontend/src/utils/iframeResizer.ts
@@ -0,0 +1,27 @@
+import { useEffect } from 'react'
+
+export function IframeResizer() {
+ useEffect(() => {
+ // Initial height calculation and message
+ const sendHeightUpdate = () => {
+ const contentHeight = document.body.scrollHeight
+ window.parent.postMessage({ type: 'iframeHeight', height: contentHeight }, '*')
+ }
+ sendHeightUpdate()
+
+ // Set up a MutationObserver to watch for changes in the DOM
+ const observer = new MutationObserver(() => {
+ sendHeightUpdate()
+ })
+
+ // Start observing the entire body and its descendants for changes to the structure of the DOM
+ observer.observe(document.body, { attributes: true, childList: true, subtree: true })
+
+ // Cleanup: Disconnect the observer when the component is unmounted
+ return () => {
+ observer.disconnect()
+ }
+ }, [])
+
+ return null
+}
diff --git a/apps/widget-configurator/src/app/configurator/index.tsx b/apps/widget-configurator/src/app/configurator/index.tsx
index 76c5083a83..8506ec13bc 100644
--- a/apps/widget-configurator/src/app/configurator/index.tsx
+++ b/apps/widget-configurator/src/app/configurator/index.tsx
@@ -81,7 +81,7 @@ export function Configurator({ title }: { title: string }) {
const constructIframeURL = React.useCallback(() => {
if (network) {
- return `https://swap-dev-git-widget-ui-6-cowswap.vercel.app/#/${network.chainID}/widget/swap/${sellToken}/${buyToken}?sellAmount=${sellTokenAmount}&buyAmount=${buyTokenAmount}&theme=${mode}`
+ return `http://localhost:3000/#/${network.chainID}/widget/swap/${sellToken}/${buyToken}?sellAmount=${sellTokenAmount}&buyAmount=${buyTokenAmount}&theme=${mode}`
}
return ''
}, [sellToken, buyToken, sellTokenAmount, buyTokenAmount, mode, network])
diff --git a/libs/common-const/src/chainInfo.ts b/libs/common-const/src/chainInfo.ts
index f43a04c165..bcebee3aa2 100644
--- a/libs/common-const/src/chainInfo.ts
+++ b/libs/common-const/src/chainInfo.ts
@@ -1,4 +1,5 @@
import { SupportedChainId } from '@cowprotocol/cow-sdk'
+import { COW_PROTOCOL_LINK } from './common'
import GnosisChainLogo from '@cowprotocol/assets/cow-swap/network-gnosis-chain-logo.svg'
import GoerliLogo from '@cowprotocol/assets/cow-swap/network-goerli-logo.svg'
@@ -40,7 +41,7 @@ export const CHAIN_INFO: ChainInfoMap = {
networkType: NetworkType.L1,
docs: 'https://docs.cow.fi/',
explorer: 'https://etherscan.io/',
- infoLink: 'https://cow.fi/',
+ infoLink: COW_PROTOCOL_LINK,
label: 'Ethereum',
name: 'mainnet',
explorerTitle: 'Etherscan',
@@ -51,7 +52,7 @@ export const CHAIN_INFO: ChainInfoMap = {
networkType: NetworkType.L1,
docs: 'https://docs.cow.fi/',
explorer: 'https://goerli.etherscan.io/',
- infoLink: 'https://cow.fi/',
+ infoLink: COW_PROTOCOL_LINK,
label: 'Görli',
name: 'goerli',
explorerTitle: 'Etherscan',
diff --git a/libs/common-const/src/common.ts b/libs/common-const/src/common.ts
index 75d5e2e78f..f071b03016 100644
--- a/libs/common-const/src/common.ts
+++ b/libs/common-const/src/common.ts
@@ -117,6 +117,7 @@ const GITHUB_REPOSITORY = 'cowprotocol/cowswap'
export const CODE_LINK = 'https://github.com/' + GITHUB_REPOSITORY
export const RAW_CODE_LINK = 'https://raw.githubusercontent.com/' + GITHUB_REPOSITORY
+export const COW_PROTOCOL_LINK = 'https://cow.fi/'
export const DOCS_LINK = 'https://docs.cow.fi'
export const CONTRACTS_CODE_LINK = 'https://github.com/cowprotocol/contracts'
export const DISCORD_LINK = 'https://discord.com/invite/cowprotocol'