Skip to content

Commit

Permalink
Merge branch 'release/1.49.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Nov 7, 2023
2 parents 0ded27d + edc7de3 commit 312b50a
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [opened, synchronize]

env:
NODE_VERSION: lts/gallium
NODE_VERSION: lts/hydrogen
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
REACT_APP_PINATA_API_KEY: ${{ secrets.REACT_APP_PINATA_API_KEY }}
REACT_APP_PINATA_SECRET_API_KEY: ${{ secrets.REACT_APP_PINATA_SECRET_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
# Duplicated keys as these are required by `ipfs-deploy`
IPFS_DEPLOY_PINATA__API_KEY: ${{ secrets.REACT_APP_PINATA_API_KEY }}
IPFS_DEPLOY_PINATA__SECRET_API_KEY: ${{ secrets.REACT_APP_PINATA_SECRET_API_KEY }}
NODE_VERSION: lts/gallium
NODE_VERSION: lts/hydrogen

jobs:
ipfs:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ on:
- next
default: latest


env:
NODE_VERSION: lts/gallium
NODE_VERSION: lts/hydrogen
DESTINATION_PATH: dist/libs/${{ inputs.lib }}


jobs:
publish-npm:
name: Publish NPM package
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/gallium
lts/hydrogen
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/src/common/pure/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Wrapper = styled.div<Omit<IconProps, 'image'>>`

export function Icon({
image,
size = 16,
size = 24,
bgColor,
color,
description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export enum BannerOrientation {

export function BundleTxApprovalBanner() {
return (
<InlineBanner bannerType="information">
<InlineBanner bannerType="information" iconSize={32}>
<strong>Token approval bundling</strong>
<p>
For your convenience, token approval and order placement will be bundled into a single transaction, streamlining
Expand All @@ -32,7 +32,7 @@ export type BundleTxWrapBannerProps = {

export function BundleTxWrapBanner({ nativeCurrencySymbol, wrappedCurrencySymbol }: BundleTxWrapBannerProps) {
return (
<InlineBanner bannerType="information">
<InlineBanner bannerType="information" iconSize={32}>
<strong>Token wrapping bundling</strong>
<p>
For your convenience, CoW Swap will bundle all the necessary actions for this trade into a single transaction.
Expand All @@ -54,7 +54,7 @@ export function BundleTxSafeWcBanner({ nativeCurrencySymbol, supportsWrapping }:
const supportsWrappingText = supportsWrapping ? `${nativeCurrencySymbol} wrapping, ` : ''

return (
<InlineBanner bannerType="information">
<InlineBanner bannerType="information" iconSize={32}>
<strong>Use Safe web app</strong>
<p>
Use the Safe web app for streamlined trading: {supportsWrappingText}token approval and orders bundled in one go!
Expand All @@ -71,7 +71,7 @@ export type SmallVolumeWarningBannerProps = {

export function SmallVolumeWarningBanner({ feePercentage, feeAmount }: SmallVolumeWarningBannerProps) {
return (
<InlineBanner>
<InlineBanner iconSize={32}>
<strong>Small orders are unlikely to be executed</strong>
<p>
For this order, network fees would be{' '}
Expand Down
17 changes: 9 additions & 8 deletions apps/cowswap-frontend/src/common/pure/InlineBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ interface ColorEnums {
const colorEnumsMap: Record<BannerType, ColorEnums> = {
alert: {
icon: IconType.ALERT,
color: UI.COLOR_ALERT,
color: UI.COLOR_ALERT_TEXT,
bg: UI.COLOR_ALERT_BG,
text: UI.COLOR_ALERT_TEXT,
},
information: {
icon: IconType.INFORMATION,
color: UI.COLOR_INFORMATION,
color: UI.COLOR_INFORMATION_TEXT,
bg: UI.COLOR_INFORMATION_BG,
text: UI.COLOR_INFORMATION_TEXT,
},
success: {
icon: IconType.SUCCESS,
color: UI.COLOR_SUCCESS,
color: UI.COLOR_SUCCESS_TEXT,
bg: UI.COLOR_SUCCESS_BG,
text: UI.COLOR_SUCCESS_TEXT,
},
danger: {
icon: IconType.DANGER,
color: UI.COLOR_DANGER,
color: UI.COLOR_DANGER_TEXT,
bg: UI.COLOR_DANGER_BG,
text: UI.COLOR_DANGER_TEXT,
},
savings: {
iconText: '💸',
color: UI.COLOR_SUCCESS,
color: UI.COLOR_SUCCESS_TEXT,
bg: UI.COLOR_SUCCESS_BG,
text: UI.COLOR_SUCCESS_TEXT,
},
Expand Down Expand Up @@ -128,14 +128,15 @@ export function InlineBanner({
children,
className,
hideIcon,
bannerType = 'alert',
bannerType,
borderRadius,
orientation,
iconSize,
iconPadding,
padding,
}: InlineBannerProps) {
const colorEnums = getColorEnums(bannerType)
const effectiveBannerType = bannerType || 'alert'
const colorEnums = getColorEnums(effectiveBannerType)

return (
<Wrapper
Expand All @@ -148,7 +149,7 @@ export function InlineBanner({
<span>
{!hideIcon && colorEnums.icon && (
<Icon
image={IconType.ALERT}
image={colorEnums.icon}
size={iconSize}
color={colorEnums.color}
description={bannerType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const MenuItem = ({
<styledEl.MenuItem isActive={isActive} onClick={onClick} isDropdownVisible={isDropdownVisible}>
<styledEl.Link to={routePath}>
<Trans>{item.label}</Trans>
{badgeText && (
{!isActive && badgeText && (
<styledEl.Badge type={badgeType}>
<Trans>{badgeText}</Trans>
</styledEl.Badge>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Badge = styled.div<{ type?: BadgeType }>`
letter-spacing: 0.2px;
font-weight: 600;
transition: color 0.15s ease-in-out;
margin: -8px 0 0 0;
margin: 0;
a & {
color: ${({ type }) => badgeColors[type || 'default']};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function TwapSuggestionBanner({
parameterizeTradeRoute(tradeUrlParams, Routes.ADVANCED_ORDERS) + `?${TRADE_URL_SELL_AMOUNT_KEY}=${sellAmount}`

return (
<InlineBanner bannerType="alert">
<InlineBanner bannerType="alert" iconSize={32}>
<strong>Minimize price impact with TWAP</strong>
<p>
The price impact is <b>{+priceImpact.toFixed(2)}%</b>. Consider breaking up your order using a{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function UnsupportedWalletWarning({ isSafeViaWc }: { isSafeViaWc: boolean
}

return (
<InlineBanner bannerType="alert">
<InlineBanner bannerType="alert" iconSize={32}>
<strong>Unsupported wallet detected</strong>
<p>
TWAP orders currently require a Safe with a special fallback handler. Have one? Switch to it! Need setup?{' '}
Expand Down
14 changes: 9 additions & 5 deletions libs/tokens/src/pure/TokenLogo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ import { getTokenLogoUrls } from '../../utils/getTokenLogoUrls'

const invalidUrlsAtom = atom<{ [url: string]: boolean }>({})

const TokenLogoWrapper = styled.div`
const TokenLogoWrapper = styled.div<{ size?: number }>`
display: inline-block;
background: var(--cow-container-bg-01);
border-radius: 50%;
border-radius: ${({ size }) => size}px;
width: ${({ size }) => size}px;
height: ${({ size }) => size}px;
overflow: hidden;
img {
width: 100%;
height: 100%;
width: ${({ size }) => size}px;
height: ${({ size }) => size}px;
border-radius: ${({ size }) => size}px;
object-fit: contain;
}
`

Expand Down Expand Up @@ -57,7 +61,7 @@ export function TokenLogo({ logoURI, token, className, size = 36 }: TokenLogoPro
}

return (
<TokenLogoWrapper className={className} style={{ width: size, height: size }}>
<TokenLogoWrapper className={className} size={size}>
{!currentUrl ? <Slash size={size} /> : <img alt="" src={currentUrl} onError={onError} />}
</TokenLogoWrapper>
)
Expand Down

0 comments on commit 312b50a

Please sign in to comment.