Skip to content

Commit

Permalink
Merge pull request #4930 from cowprotocol/main
Browse files Browse the repository at this point in the history
Main -> develop
  • Loading branch information
shoom3301 authored Oct 1, 2024
2 parents 69ec27c + f1e76b9 commit 23070f8
Show file tree
Hide file tree
Showing 41 changed files with 204 additions and 57 deletions.
32 changes: 17 additions & 15 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{
"apps/cowswap-frontend": "1.83.0",
"apps/explorer": "2.34.0",
"apps/cowswap-frontend": "1.84.0",
"apps/explorer": "2.34.1",
"libs/permit-utils": "0.3.1",
"libs/widget-lib": "0.14.1",
"libs/widget-react": "0.10.2",
"apps/widget-configurator": "1.6.0",
"libs/analytics": "1.7.0",
"libs/widget-lib": "0.15.0",
"libs/widget-react": "0.11.0",
"apps/widget-configurator": "1.7.0",
"libs/analytics": "1.8.0",
"libs/assets": "1.8.0",
"libs/common-const": "1.7.0",
"libs/common-hooks": "1.3.0",
"libs/common-utils": "1.7.1",
"libs/common-hooks": "1.4.0",
"libs/common-utils": "1.7.2",
"libs/core": "1.3.0",
"libs/ens": "1.2.0",
"libs/events": "1.4.1",
"libs/events": "1.5.0",
"libs/snackbars": "1.1.0",
"libs/tokens": "1.8.1",
"libs/tokens": "1.9.0",
"libs/types": "1.2.0",
"libs/ui": "1.9.0",
"libs/wallet": "1.5.2",
"apps/cow-fi": "1.13.0",
"libs/ui": "1.10.0",
"libs/wallet": "1.6.0",
"apps/cow-fi": "1.14.0",
"libs/wallet-provider": "1.0.0",
"libs/ui-utils": "1.1.0",
"libs/abis": "1.0.0",
"libs/balances-and-allowances": "1.0.0"
"libs/abis": "1.1.0",
"libs/balances-and-allowances": "1.0.0",
"libs/iframe-transport": "1.0.0",
"libs/hook-dapp-lib": "1.0.0"
}
8 changes: 8 additions & 0 deletions apps/cow-fi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.14.0](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.13.0...cow-fi-v1.14.0) (2024-09-30)


### Features

* **cow-fi:** lazy load cms images /learn/ pages ([#4906](https://github.com/cowprotocol/cowswap/issues/4906)) ([897ce91](https://github.com/cowprotocol/cowswap/commit/897ce91ca60a6b2d3823e6a002c3bf64c5384afe))
* **hooks-store:** support iframe hook-dapps ([#4885](https://github.com/cowprotocol/cowswap/issues/4885)) ([5116f29](https://github.com/cowprotocol/cowswap/commit/5116f296a0e4866d0a51a806b7abe55e809d26e9))

## [1.13.0](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.12.0...cow-fi-v1.13.0) (2024-09-12)


Expand Down
2 changes: 1 addition & 1 deletion apps/cow-fi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cow-fi",
"version": "1.13.0",
"version": "1.14.0",
"description": "CoW DAO website",
"main": "index.js",
"author": "",
Expand Down
16 changes: 16 additions & 0 deletions apps/cowswap-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [1.84.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.83.0...cowswap-v1.84.0) (2024-09-30)


### Features

* **cow-fi:** lazy load cms images /learn/ pages ([#4906](https://github.com/cowprotocol/cowswap/issues/4906)) ([897ce91](https://github.com/cowprotocol/cowswap/commit/897ce91ca60a6b2d3823e6a002c3bf64c5384afe))
* **cow-hooks:** add claim airdrop hook app ([#4897](https://github.com/cowprotocol/cowswap/issues/4897)) ([cab2407](https://github.com/cowprotocol/cowswap/commit/cab240778128dfbdd29f0873062a39b23695d577))
* **hooks-store:** import custom hook-dapps ([#4910](https://github.com/cowprotocol/cowswap/issues/4910)) ([5847017](https://github.com/cowprotocol/cowswap/commit/584701715500525365475660732edb6bbf7ba396))
* **hooks-store:** style hook store ([#4905](https://github.com/cowprotocol/cowswap/issues/4905)) ([9fca0d9](https://github.com/cowprotocol/cowswap/commit/9fca0d9e9fac5715d3d05eb1c1fe234083af03fc))
* **hooks-store:** support iframe hook-dapps ([#4885](https://github.com/cowprotocol/cowswap/issues/4885)) ([5116f29](https://github.com/cowprotocol/cowswap/commit/5116f296a0e4866d0a51a806b7abe55e809d26e9))


### Bug Fixes

* fix import list warning styles ([#4917](https://github.com/cowprotocol/cowswap/issues/4917)) ([fa3c4cb](https://github.com/cowprotocol/cowswap/commit/fa3c4cb09fb0728233de92c81c1e0a410143f65a))

## [1.83.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.82.0...cowswap-v1.83.0) (2024-09-18)


Expand Down
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cowswap",
"version": "1.83.0",
"version": "1.84.0",
"description": "CoW Swap",
"main": "index.js",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ interface ExternalSourceAlertProps {
children: ReactElement
title: ReactElement | string
onChange: Command
className?: string
}
export function ExternalSourceAlert({ onChange, title, children }: ExternalSourceAlertProps) {
export function ExternalSourceAlert({ className, onChange, title, children }: ExternalSourceAlertProps) {
return (
<styledEl.Contents>
<styledEl.Contents className={className}>
<AlertTriangle size={48} strokeWidth={1} />
<h3>{title}</h3>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ export const Contents = styled.div`
h3 {
font-size: 24px;
text-align: center;
margin: 18px 0;
margin: 16px 0;
font-weight: bold;
}
p {
margin: 6px 0;
}
> svg > path,
> svg > line {
stroke: var(${UI.COLOR_DANGER_TEXT});
Expand All @@ -34,7 +38,7 @@ export const AcceptanceBox = styled.label`
align-items: center;
justify-content: center;
cursor: pointer;
margin: 24px auto 0;
margin: 16px auto 0;
padding: 24px 0;
border-top: 1px solid var(${UI.COLOR_DANGER_TEXT});
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { useState } from 'react'
import { TokenLogo, getTokenListViewLink, ListState } from '@cowprotocol/tokens'
import { ButtonPrimary } from '@cowprotocol/ui'

import { ExternalSourceAlert } from 'common/pure/ExternalSourceAlert'

import * as styledEl from './styled'

import { ModalHeader } from '../ModalHeader'
Expand Down Expand Up @@ -39,7 +37,10 @@ export function ImportListModal(props: ImportListModalProps) {
</styledEl.ListLink>
</div>
</styledEl.ListInfo>
<ExternalSourceAlert title="Import at your own risk" onChange={() => setIsAccepted((state) => !state)}>
<styledEl.ExternalSourceAlertStyled
title="Import at your own risk"
onChange={() => setIsAccepted((state) => !state)}
>
<>
<p>
By adding this list you are implicitly trusting that the data is correct. Anyone can create a list,
Expand All @@ -50,7 +51,7 @@ export function ImportListModal(props: ImportListModalProps) {
<strong>If you purchase a token from this list, you may not be able to sell it back.</strong>
</p>
</>
</ExternalSourceAlert>
</styledEl.ExternalSourceAlertStyled>
<styledEl.ActionButtonWrapper>
<ButtonPrimary disabled={!isAccepted} onClick={() => onImport(list)}>
Import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { UI } from '@cowprotocol/ui'

import styled from 'styled-components/macro'

import { ExternalSourceAlert } from 'common/pure/ExternalSourceAlert'

export const Wrapper = styled.div`
display: block;
width: 100%;
Expand Down Expand Up @@ -30,3 +32,7 @@ export const ListTitle = styled.div`
export const ListLink = styled.a`
font-size: 14px;
`

export const ExternalSourceAlertStyled = styled(ExternalSourceAlert)`
margin: 0 20px 20px 20px;
`
7 changes: 7 additions & 0 deletions apps/explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.34.1](https://github.com/cowprotocol/cowswap/compare/explorer-v2.34.0...explorer-v2.34.1) (2024-09-30)


### Bug Fixes

* **explorer:** get token logo url from known token lists ([#4922](https://github.com/cowprotocol/cowswap/issues/4922)) ([2f2f572](https://github.com/cowprotocol/cowswap/commit/2f2f572c1e05e65fc41e89361d28b267054a8428))

## [2.34.0](https://github.com/cowprotocol/cowswap/compare/explorer-v2.33.1...explorer-v2.34.0) (2024-09-17)


Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/explorer",
"version": "2.34.0",
"version": "2.34.1",
"description": "CoW Swap Explorer",
"main": "src/main.tsx",
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/src/components/common/TokenDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function TokenDisplay(props: Readonly<Props>): React.ReactNode {

return (
<Wrapper>
<StyledImg address={imageAddress} />
<StyledImg address={imageAddress} network={network} />
{isNativeToken(erc20.address) ? (
// There's nowhere to link when it's a native token, so, only display the symbol
<NativeWrapper>{erc20.symbol}</NativeWrapper>
Expand Down
16 changes: 9 additions & 7 deletions apps/explorer/src/components/common/TokenImg.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import React from 'react'

import { SupportedChainId } from '@cowprotocol/cow-sdk'

import unknownTokenImg from 'assets/img/unknown-token.png'
import styled from 'styled-components/macro'
import { getImageUrl, RequireContextMock, safeTokenName } from 'utils'

import { useTokenList } from '../../hooks/useTokenList'

const Wrapper = styled.img<WrapperProps>`
width: 2.8rem;
height: 2.8rem;
Expand All @@ -19,6 +23,7 @@ function _loadFallbackTokenImage(event: React.SyntheticEvent<HTMLImageElement>):
}

export interface Props {
network: SupportedChainId
symbol?: string
name?: string
address: string
Expand All @@ -41,7 +46,7 @@ const tokensIconsFilesByAddress: Record<string, string> = Object.keys(tokensIcon
const address = TOKEN_ICON_FILENAME_REGEX.exec(file)?.[0]
if (!address) {
throw new Error(
"Error initializing 'assets/img/tokens' images. The image doesn't have the expected format: " + file
"Error initializing 'assets/img/tokens' images. The image doesn't have the expected format: " + file,
)
}
acc[address.toLowerCase()] = file
Expand All @@ -50,7 +55,8 @@ const tokensIconsFilesByAddress: Record<string, string> = Object.keys(tokensIcon
}, {})

export const TokenImg: React.FC<Props> = (props) => {
const { address, addressMainnet, symbol, name } = props
const { address, addressMainnet, symbol, name, network } = props
const { data: tokenListTokens } = useTokenList(network)

let iconFile = tokensIconsFilesByAddress[address.toLowerCase()]
if (!iconFile && addressMainnet) {
Expand All @@ -59,7 +65,7 @@ export const TokenImg: React.FC<Props> = (props) => {

const iconFileUrl: string | undefined = iconFile
? tokensIconsRequire[iconFile].default
: getImageUrl(addressMainnet || address)
: tokenListTokens[address.toLowerCase()]?.logoURI || getImageUrl(addressMainnet || address)

// TODO: Simplify safeTokenName signature, it doesn't need the addressMainnet or id!
// https://github.com/gnosis/gp-v1-ui/issues/1442
Expand All @@ -68,8 +74,4 @@ export const TokenImg: React.FC<Props> = (props) => {
return <Wrapper alt={safeName} src={iconFileUrl} onError={_loadFallbackTokenImage} {...props} />
}

export const TokenImgWrapper = styled(TokenImg)`
margin: 0 1rem 0 0;
`

export default TokenImg
7 changes: 7 additions & 0 deletions apps/widget-configurator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.7.0](https://github.com/cowprotocol/cowswap/compare/widget-configurator-v1.6.0...widget-configurator-v1.7.0) (2024-09-30)


### Features

* **hooks-store:** support iframe hook-dapps ([#4885](https://github.com/cowprotocol/cowswap/issues/4885)) ([5116f29](https://github.com/cowprotocol/cowswap/commit/5116f296a0e4866d0a51a806b7abe55e809d26e9))

## [1.6.0](https://github.com/cowprotocol/cowswap/compare/widget-configurator-v1.5.1...widget-configurator-v1.6.0) (2024-08-27)


Expand Down
2 changes: 1 addition & 1 deletion apps/widget-configurator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/widget-configurator",
"version": "1.6.0",
"version": "1.7.0",
"description": "CoW Swap widget configurator",
"main": "src/main.tsx",
"author": "",
Expand Down
7 changes: 7 additions & 0 deletions libs/abis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.1.0](https://github.com/cowprotocol/cowswap/compare/cowswap-abis-v1.0.0...cowswap-abis-v1.1.0) (2024-09-30)


### Features

* **cow-hooks:** add claim airdrop hook app ([#4897](https://github.com/cowprotocol/cowswap/issues/4897)) ([cab2407](https://github.com/cowprotocol/cowswap/commit/cab240778128dfbdd29f0873062a39b23695d577))

## 1.0.0 (2024-07-12)


Expand Down
2 changes: 1 addition & 1 deletion libs/abis/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cowprotocol/cowswap-abis",
"version": "1.0.0",
"version": "1.1.0",
"type": "commonjs"
}
7 changes: 7 additions & 0 deletions libs/analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.8.0](https://github.com/cowprotocol/cowswap/compare/analytics-v1.7.0...analytics-v1.8.0) (2024-09-30)


### Features

* **cow-fi:** lazy load cms images /learn/ pages ([#4906](https://github.com/cowprotocol/cowswap/issues/4906)) ([897ce91](https://github.com/cowprotocol/cowswap/commit/897ce91ca60a6b2d3823e6a002c3bf64c5384afe))

## [1.7.0](https://github.com/cowprotocol/cowswap/compare/analytics-v1.6.0...analytics-v1.7.0) (2024-09-17)


Expand Down
2 changes: 1 addition & 1 deletion libs/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/analytics",
"version": "1.7.0",
"version": "1.8.0",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions libs/common-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.4.0](https://github.com/cowprotocol/cowswap/compare/common-hooks-v1.3.0...common-hooks-v1.4.0) (2024-09-30)


### Features

* **cow-hooks:** add claim airdrop hook app ([#4897](https://github.com/cowprotocol/cowswap/issues/4897)) ([cab2407](https://github.com/cowprotocol/cowswap/commit/cab240778128dfbdd29f0873062a39b23695d577))

## [1.3.0](https://github.com/cowprotocol/cowswap/compare/common-hooks-v1.2.0...common-hooks-v1.3.0) (2024-06-24)


Expand Down
2 changes: 1 addition & 1 deletion libs/common-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/common-hooks",
"version": "1.3.0",
"version": "1.4.0",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions libs/common-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.7.2](https://github.com/cowprotocol/cowswap/compare/common-utils-v1.7.1...common-utils-v1.7.2) (2024-09-30)


### Bug Fixes

* **amounts-display:** increase precision for small amounts ([#4793](https://github.com/cowprotocol/cowswap/issues/4793)) ([4195c68](https://github.com/cowprotocol/cowswap/commit/4195c68272eb1e7857458ef3f3b34b3a3864ed6b))

## [1.7.1](https://github.com/cowprotocol/cowswap/compare/common-utils-v1.7.0...common-utils-v1.7.1) (2024-09-05)


Expand Down
2 changes: 1 addition & 1 deletion libs/common-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/common-utils",
"version": "1.7.1",
"version": "1.7.2",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions libs/events/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.5.0](https://github.com/cowprotocol/cowswap/compare/events-v1.4.1...events-v1.5.0) (2024-09-30)


### Features

* **hooks-store:** support iframe hook-dapps ([#4885](https://github.com/cowprotocol/cowswap/issues/4885)) ([5116f29](https://github.com/cowprotocol/cowswap/commit/5116f296a0e4866d0a51a806b7abe55e809d26e9))

## [1.4.1](https://github.com/cowprotocol/cowswap/compare/events-v1.4.0...events-v1.4.1) (2024-09-17)


Expand Down
2 changes: 1 addition & 1 deletion libs/events/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/events",
"version": "1.4.1",
"version": "1.5.0",
"type": "commonjs",
"description": "CoW Swap events",
"main": "index.js",
Expand Down
Loading

0 comments on commit 23070f8

Please sign in to comment.