Skip to content

Commit

Permalink
chore: merge main into explore (#4260)
Browse files Browse the repository at this point in the history
* refactor: remove hideRouteDiagram prop (#3763)

* fix: Revert "refactor: remove coinbase wallet resetState" (#4081)

Revert "refactor: remove coinbase wallet resetState (#4024)"

This reverts commit e36722c.

* feat: add support for Celo (#3915)

* feat: Support for Celo

* fix: wrong condition

* combine celo and alfajores lists

* use celo erc20 representation

* fix: refactor infura.ts to networks.ts & add celo to rpc urls

* feature: add celo contract addresses
fix: remove celo from supported gas estimate chains until feature is available

* refactor: useUSDCPrice to useStablecoinPrice
fix: add celo to supported gas estimate chains

* fix: use unique factory address for getting pool address

* fix: darkmode background graident

* fix: removing a comment left behind

* fix: remove bad import

* fix: remove dead link until the Celo is live on info.uniswap.org

* fix: add asset to common bases & minor refactoring

* fix: celo info links point to root info.uniswap.org

* fix: change celo token bridge to portal

* fix: update redux-multicall to latest version

* refactor: for code readability

* fix: celo banner colors & remove unused alternative logo

* fix: change celo token list to hosted version

* fix: update celo banner colors

* fix: move celo to the bottom of the network selector list

* fix: dedup dependencies @uniswap/router-sdk @uniswap/v3-sdk

* fix: refactoring + move Celo above L2s

* fix: update celo contract addresses

* fix: update celo subgraph

* fix: update v3-sdk and smart-order-router versions

* fix: move Celo to the bottom of the network selector list

* fix: downgrade smart-order-router and add casting fix

* fix: downgrade smart-order-router and add casting fix

* fix: resolve Pool dependency

* fix: bridge chain id types

* fix: explorer link test

* fix: use quoter v2 ABI in useClientSideV3Trade fro Celo

* fix: update connection "infura_rpc" to networks

* fix: revert yarn.lock and force install

* fix: dedup router and v3 sdk

* refactor: mv quoter v2 to client side v3 trade

* build: dedup lockfile

* feature: add portal ether to common bases

* fix: add comment for chains that use QuoterV2

* fix: use token as native asset

* fix: supply correct factory address to getPoolAddress call & refactor nativeOnChain method

* feature: adjust celo tokens presetned

* fix: update celo explorer to celoscan

* fix: celo token casting

* fix: celo celo explorer it

* fix: celo chain info should be consistent with block explorer used.

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* fix: revert "fix button jump on currency panel" (#4083)

fix padding

* fix: unsupported chain displays message instead of crash (#4054)

* made initial changes for pools page displaying w/ unsupported chains
* condensed styling
* added chain validation to CTACards and wrote tests for both CTAcards and Pools page
* linted changes
* switched from snapshot to text matching tests
* switched test to use check for text instead of testid

* fix: add crossplatform `prei18n-extract` script (#3728)

* fix: 🐛 add crossplatform `prei18n-extract` script

* fix: 🚨 add newline

* Revert "fix: 🐛 add crossplatform `prei18n-extract` script"

This reverts commit 201bd23.

* build: 📦 add `shx` as dev dep, use it in `prei18n:extract` script

* fix: 🐛 use platform-specific commands for prei18n-extract

* chore(i18n): new Crowdin translations (#4084)

chore(i18n): synchronize translations from crowdin [skip ci]

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* feat: implement trace framework for analytics (#4060)

* init commit

* add amplitude ts sdk to package.json

* add more comments and documentation

* respond to vm comments

* respond to cmcewen comments

* fix: remove unused constants

* init commit

* adapt to web

* add optional event properties to trace

* correct telemetry to analytics

* change telemetry to analytics in doc

* fix: respond to cmcewen comments + initialize analytics in app.tsx + add missing return statement

* respond to zzmp comments

* fixes

* eliminate unnecessary state

* respond to part of zzmp comments

* respond to zzmp comments round 2

* fixes

* respond to zzmp comments

* refactor: wallet specific Option components (#4065)

* refactor: wallet specific Option components

* fix

* fix

* fix coinbase wallet logic

* injected logic

* remove wallet.ts

* install metamask

* move all into InjectedOption

* fix mobile metamask

* wip

* more mocking

* more test fixes

* refactor

* more special casing

* isMetaMask

* simplify components

* fix imports

* fix coinbase wallet

* test fix

* fix connectors changing

* Revert "fix connectors changing"

This reverts commit 2acfe64.

* more to typescript logic instead of jsx

* chore(i18n): new Crowdin translations (#4090)

* build: upgrade @typescript-eslint (#4095)

build: update @typescript-eslint

* build: update caniuse-lite (#4093)

* test: enforce deps deduplication (#4097)

* build: use fewer babel versions

* build: dedup

* test: test deps dedups

* fix: test.yml

* fix: typo

* test: failing

* fix: dedup

* fix: dedup

* test: comment dedup tests

* chore: whitespace

* feat: implement token selector events (#4067)

* init commit

* add amplitude ts sdk to package.json

* add more comments and documentation

* respond to vm comments

* respond to cmcewen comments

* fix: remove unused constants

* init commit

* adapt to web

* add optional event properties to trace

* correct telemetry to analytics

* change telemetry to analytics in doc

* fix: respond to cmcewen comments + initialize analytics in app.tsx + add missing return statement

* init commit

* respond to zzmp comments

* add token selected event

* fixes

* eliminate unnecessary state

* respond to part of zzmp comments

* respond to zzmp comments round 2

* fixes

* respond to zzmp comments

* add imported token event and other fixes

* also log onKeyPress for suggested tokens

* respond to cmcewen comments

* chore: updates web3-react, adds key for changing connector order (#4085)

* fix connectors changing

* update package

* add connection name

* rename file

* de-dupe

* cb wallet fix

* fix

* yarn change

* log the key

* re-order connections

* memoize the key

* some updates

* rm console

* prevent memory leak

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>

* feat: implement-page-viewed-event-for-all-main-pages-of-app (#4089)

* init commit: initial constants for pages, implement vote page viewed

* implement swap

* implement pool

* remove charts

* simplify shouldLogImpression

* chore: upgrade to react 18 (#3992)

* chore: upgrade to react 18

* fix: update tests

* fix: fix lint issues and remove unnecessary react hooks testing library

* fix: add types for stricter typescript checks

* fix: fix additional typescript check issues

* fix: revert to prev commmit

* rebase

* rebase

* fix: fix lint issues and remove unnecessary react hooks testing library

* fix: add types for stricter typescript checks

* fix: fix additional typescript check issues

* rebase

* fix: rebase

* fix

* eslint fix

* fix: package.json changes

* fix: package.json changes

* fix yarn lock

* fix version package.json

* fix: downgrade react-router-dom to original

* fix: undo modification of .github/workflows/release.yaml

* fix: revert cypress testing version update

* rebase

* rebase

* fix: fix lint issues and remove unnecessary react hooks testing library

* fix: add types for stricter typescript checks

* fix: fix additional typescript check issues

* rebase

* chore: upgrade to react 18

* fix: update tests

* fix: fix lint issues and remove unnecessary react hooks testing library

* fix: add types for stricter typescript checks

* fix: fix additional typescript check issues

* fix

* eslint fix

* fix: package.json changes

* fix: package.json changes

* fix yarn lock

* fix version package.json

* fix: downgrade react-router-dom to original

* fix: undo modification of .github/workflows/release.yaml

* fix: revert cypress testing version update

* fix

* fix: error boundary change

* yarn.lock change

* fix: cypress tests finally passing due to zzmp redux multicall fix HOORAY

* undo service worker changes

* build: dedup lockfile

* yarn.lock + lint

* update snapshot tests

* checkpoint

* yarn.lock

* fix: fix type errors during build

* fixes

* fix yarn.lock

* dedup yarn

* fix: import react components explicitly instead of all of react

* dedup

* yarn.lock

* yarn.lock

* dedup

* yarn

* dedup

* dedupe use-sync-external-store

* fix build issues

* dedup use-sync-external-store

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>

* chore(web3-react): fix connectEagerly for MetaMask mobile (#4101)

* chore(web3-react): fix connectEagerly for MetaMask mobile

* fix

* build: pause deploy (#4102)

* fix: update styled-components in package.json to latest to remove react invalid hook call warnings (#4103)

* fix warning vig found by updating styled-components

* revert unnecessary yarn.lock changes

* reduce unnecessary changes

* dedup

* manual fix and dedup of yarn.lock

* manually dedup @emotion/is-prop-valid

* update snapshot tests

* build: upgrade prettier to v2.7.1 (#4109)

* style: prettier based on v2.2

* 2.7.1 instead?

* npx

* ^

* refactor: adding safe getter for ChainInfo (#4110)

* replaced CHAIN_INFO access with a function call
* updated CTACard tests to work with getChainInfo
* updated typechecking, removed console.log

* build: Revert "build: pause deploy" (#4107)

* Revert "build: pause deploy (#4102)"

This reverts commit 3a1ea3d.

* prettier

* refactor: remaining changes from the large celo merge (#4088)

* refactor: useUSDCValue -> useStablecoinValue

* refactor: use the isCelo() helper

* refactor: remove unneeded white space

* chore: upgrades react-router-dom, fixes dev-mode linking (#4115)

* fix: stale route

* fix: add e2e test

* fix: update e2e test

* fix: fixes Popover arrow positioning (#4119)

fix: fix arrow position

* build: don't fail cypress on unhandled exception (#4122)

* fix: catch vibrant failure (#4123)

fix: catch CORS error

* feat: enable 1bp optimism fee tier (#4124)

enable new optimism fee tier

* chore: move prettier, jest-styled-components to devDependencies (#4128)

* change package

* yarn.lock

* feat: implement connect wallet category events (#4111)

* init commit

* wallet connected event init commit

* add received_swap_quote event property

* add page context, connect wallet event log

* add received_swap_quote property

* fix typo

* respond to cmcewen comments

* respond to vm comments

* move trace to app.tsx from header

* respond to vm comments

* build: change project name to @uniswap/interface (#4125)

* fix: increase celo blocksPerFetch to 5 to improve interface performance (#4130)

* init commit

* revert yarn.lock changes

* update test snapshots

* build: lock jest-styled-components@7.0.7 (#4132)

* fix: don't toggle desktop NetworkSelector on click (#4134)

fix: don't NetworkSelector onClick on desktop

* chore: access router data with hooks (#4121)

* chore: access router data with hooks

* chore: clean RouteComponentProps

* chore: use children instead of render

* add import

* test: fix swap test flake (#4135)

* remove all the funky logic

* clear stuff

* uncomment some tests

* remove expert mode tests

* skip these tests again, smh

* fix: sync chain query parameter (#4019)

* replaceURLChain

* reorder stuff

* don't use usePrevious for previousChainId

* remove the replace param call in promise

* variable names

* comment

* confirm isActive

* wrong place for isActive

* change ret type

* add comments

* check if not previous chain id

* fix: unused onClickOutside reference (#4140)

* refactor: clean floating Route (#4144)

* fix: increase Polygon gas limit (#3882)

* Update graph link

* Add Gas over ride temp for Polygon

* removal of personal tweaks

* Update index.tsx

* reset to original file

* missing EOL

* Update useClientSideV3Trade.ts

* remove space

* fix: add celo gas override (#4147)

fix: add celo gas override to circumvent 'out of gas' error from multicall

* build: add global jest-styled-components config (#4148)

* add test.config.ts

* don't need per file

* comment

* ts -> js

* rm test.config.js?

* update snapshots

* update jest-styled-components

* style: Adds "deprecated_" prefix to all non-theme colors (#4146)

* Add deprecated_ label to white and black

* Add deprecated_ label to text1 through text5

* Add deprecated_ label for bg0 through bg6

* Add deprecated_ prefix to remaining colors

* Add deprecated_ prefix to direct style references

* Add deprecated_ prefix to all remaining colors

* Update link color

* Fix 'deprecated_white' -> theme.deprecated_white

* Update snapshots

* style: updating ui on unsupported network (#4138)

* initial changes

* disabled all swap ui buttons when on unsupported chain

* implementing Cal's requests to change sizing and copy on pools

* updated snapshots

* reverted changed snapshots

* updated unsupported network test

* fixing deprecated colors missing

* build: only test for highest yarn-deduplicate strategy (#4154)

* build: only test for highest yarn-deduplicate strategy

* remove exclusions

* fix: fix swap details expanded not working on local build (#4156)

fix swap details expanded not working

* refactor: remove unused SwapPoolTabs (#4159)

* chore: clean useless code

* clean unused code

* chore(i18n): new Crowdin translations (#4155)

chore(i18n): synchronize translations from crowdin [skip ci]

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* feat: implement other swap events part 1 (#4151)

* init commit

* fix prettier errors

* check node env in vercel

* add shouldLogImpression to TraceEvent

* chore: upgrade cypress (#4161)

* chore: upgrade cypress

* 10.3.1

* feat: add updated theme colors (#4141)

* add colors

* Update settings.json

* Update settings.json

* remove comments

* rename

* feat: Web 214 implement the main submit swap event (#4061)

* init commit

* add amplitude ts sdk to package.json

* add more comments and documentation

* respond to vm comments

* respond to cmcewen comments

* fix: remove unused constants

* init commit

* adapt to web

* add optional event properties to trace

* correct telemetry to analytics

* init commit

* change telemetry to analytics in doc

* init commit

* fix: respond to cmcewen comments + initialize analytics in app.tsx + add missing return statement

* add element name constant

* init commit

* correct price_impact calculation

* resolve vm comments

* fixes in response to comments

* respond to vm

* use ALL significant digits for token amounts

* create helper function getPriceImpactPercentageNumber

* 4 decimal points for percentages

* change percentage to basis points units

* feat: implement swap quote received event (#4165)

* init commit

* add amplitude ts sdk to package.json

* add more comments and documentation

* respond to vm comments

* respond to cmcewen comments

* fix: remove unused constants

* init commit

* adapt to web

* add optional event properties to trace

* correct telemetry to analytics

* init commit

* change telemetry to analytics in doc

* init commit

* fix: respond to cmcewen comments + initialize analytics in app.tsx + add missing return statement

* add element name constant

* init commit

* correct price_impact calculation

* resolve vm comments

* fixes in response to comments

* respond to vm

* use ALL significant digits for token amounts

* init commit

* logged all properties

* create helper function getPriceImpactPercentageNumber

* 4 decimal points for percentages

* price percentage fn

* only log event on FIRST price fetch

* respond to cmcewen comments

* fix: scroll to top only when pathname changes (#4180)

* fix: Update V2 Pool Document link (#4188)

Update V2 Pool Document link

Current link line 163 point to old documents, and gives error page
changed to

https://docs.uniswap.org/protocol/V2/concepts/core-concepts/pools

current version of pool documents for V2

* fix: updated external docs link for Propose (#4186)

FIxed Propose External Docs Link

* chore: upgrade react-router-dom to v6 (#4143)

* chore: upgrade react-router-dom to v6

* migrate Redirect to Navigate

* use Routes instead of Switch

* migrate useHistory to useNavigate

* use To type

* use element

* work around activeClassName

* fix typing for useParams

* deduplicate

* fix Navigate

* add e2e tests

* visit /swap directly

Co-authored-by: Vignesh Mohankumar <me@vig.xyz>

* style: Add Deprecated prefix to ThemedText components (#4192)

* Add Deprecated prefix to ThemedText components

* Fix lint errors

* fix: update critical red HEX (#4191)

change red

* feat: Web 262 user model custom properties first PR (#4190)

* init commit

* abstract amplitude stuff away to separate function

* feat: remaining swap events (#4169)

* init commit

* add amplitude ts sdk to package.json

* add more comments and documentation

* respond to vm comments

* respond to cmcewen comments

* fix: remove unused constants

* init commit

* adapt to web

* add optional event properties to trace

* correct telemetry to analytics

* init commit

* change telemetry to analytics in doc

* init commit

* fix: respond to cmcewen comments + initialize analytics in app.tsx + add missing return statement

* add element name constant

* init commit

* correct price_impact calculation

* resolve vm comments

* fixes in response to comments

* respond to vm

* use ALL significant digits for token amounts

* init commit

* logged all properties

* create helper function getPriceImpactPercentageNumber

* 4 decimal points for percentages

* price percentage fn

* only log event on FIRST price fetch

* init commit

* add swap transaction completed event

* respond to cmcewen comments

* add two events

* remove console.logs

* move transaction completed logging to reducer

* simplify and remove unnecessary logic and constants

* respond to cmcewen comments

* respond to cmcewen comments

* respond to vm comment

* feat: add time / duration based event properties to swap events (#4193)

* init commit

* remove absolute value in date calc

* all the events are now logged properly plus changed native token address to NATIVE

* add documentation line

* remove unnecessary prop

* respond to vm comments

* merge and rename util method

* respond to vm comments again

* feat: fetch stablecoin price with SOR, PI warning (#4217)

* feat: fetch stablecoins price with SOR, PI warning

* calculate realized price impact

* remove unrelated changes

* dupe import

* pr feedback

* use the same calculation function for PI

* use proper var

* feat: update unsupported token list (#4219)

* feat: new swap events and properties in taxonomy  (#4204)

* init commit

* remove absolute value in date calc

* all the events are now logged properly plus changed native token address to NATIVE

* add documentation line

* remove unnecessary prop

* init

* add approve token event

* fix build

* add route event properties

* fix build

* respond to vm comments

* respond to vm comments

* remove routes properties

* feat(risk): tune down cache (#4208)

* tune down cache from 7 days to 12 hours

* minimal cache time

* fix: hide text cursor on network selector hover (#4249)

Dont' show text cursor when hovering over network dropdown text

* feat: initial FeatureFlagProvider (#4248)

* initial

* add to index

* show more logic

* split up

* nvm combine

* combine more

* loading state for the app

* no conditional

* rm var

* comment

* move comment

* add control specifically

* feat: amplitude logs is_reconnect (#4214)

* modified redux state to track wallet connections to properly log reconnects

* linted and removed console.log

* fixes for lynn's comments + documenting

* fix: update SOR to refundETH on high price impact ETH trades (#4251)

fix lock

* feat: theme color updates under feature flag (#4252)

* toggle

* fixed position

* im bad at spelling

* rm button

* fix

* add feature flag

* naming

* rm blue5

* uppercase

* rm file

* attempting to resolve some theme/unused var issues

Co-authored-by: Anas Yousef <anas.y0807@gmail.com>
Co-authored-by: Vignesh Mohankumar <vignesh@vigneshmohankumar.com>
Co-authored-by: Jesse <31524583+Jesse-Sawa@users.noreply.github.com>
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
Co-authored-by: Kaylee George <62825936+kayleegeorge@users.noreply.github.com>
Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
Co-authored-by: Bruno Crosier <bruno.crosier@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: lynn <41491154+lynnshaoyu@users.noreply.github.com>
Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
Co-authored-by: Sam Chen <chenxsan@gmail.com>
Co-authored-by: Rachel-Eichenberger <60412342+Rachel-Eichenberger@users.noreply.github.com>
Co-authored-by: Daniel James <danielcolinjames@gmail.com>
Co-authored-by: Akshit Choudhary <akshitchoudhary007@gmail.com>
Co-authored-by: Vignesh Mohankumar <me@vig.xyz>
Co-authored-by: Connor McEwen <connor.mcewen@gmail.com>
Co-authored-by: matteenm <105068213+matteenm@users.noreply.github.com>
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
Co-authored-by: Emily Williams <emag3m@gmail.com>
  • Loading branch information
1 parent cd0e864 commit 13aadb7
Show file tree
Hide file tree
Showing 118 changed files with 3,648 additions and 2,412 deletions.
10 changes: 10 additions & 0 deletions cypress/e2e/redirects.test.ts
@@ -0,0 +1,10 @@
describe('Redirect', () => {
it('should redirect to /vote/create-proposal when visiting /create-proposal', () => {
cy.visit('/create-proposal')
cy.url().should('match', /\/vote\/create-proposal/)
})
it('should redirect to /swap when visiting nonexist url', () => {
cy.visit('/none-exist-url')
cy.url().should('match', /\/swap/)
})
})
2 changes: 1 addition & 1 deletion cypress/e2e/wallet.test.ts
Expand Up @@ -2,7 +2,7 @@ import { TEST_ADDRESS_NEVER_USE_SHORTENED } from '../support/ethereum'

describe('Wallet', () => {
before(() => {
cy.visit('/')
cy.visit('/swap')
})

it('displays account details', () => {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -108,6 +108,7 @@
},
"dependencies": {
"@amplitude/analytics-browser": "^0.5.1",
"@amplitude/experiment-js-client": "^1.5.4",
"@coinbase/wallet-sdk": "^3.3.0",
"@craco/craco": "^6.4.5",
"@fontsource/ibm-plex-mono": "^4.5.1",
Expand All @@ -127,7 +128,7 @@
"@uniswap/redux-multicall": "^1.1.5",
"@uniswap/router-sdk": "^1.0.6",
"@uniswap/sdk-core": "^3.0.1",
"@uniswap/smart-order-router": "^2.5.26",
"@uniswap/smart-order-router": "^2.8.2",
"@uniswap/token-lists": "^1.0.0-beta.30",
"@uniswap/v2-core": "1.0.0",
"@uniswap/v2-periphery": "^1.1.0-beta.0",
Expand Down Expand Up @@ -191,7 +192,7 @@
"react-markdown": "^4.3.1",
"react-popper": "^2.2.3",
"react-redux": "^8.0.2",
"react-router-dom": "^5.3.3",
"react-router-dom": "^6.3.0",
"react-spring": "^8.0.27",
"react-use-gesture": "^6.0.14",
"react-virtualized-auto-sizer": "^1.0.2",
Expand All @@ -212,4 +213,4 @@
"workbox-precaching": "^6.1.0",
"workbox-routing": "^6.1.0"
}
}
}
11 changes: 7 additions & 4 deletions src/components/AccountDetails/index.tsx
Expand Up @@ -6,6 +6,7 @@ import { Context, useCallback, useContext } from 'react'
import { ExternalLink as LinkIcon } from 'react-feather'
import { useAppDispatch } from 'state/hooks'
import { updateSelectedWallet } from 'state/user/reducer'
import { removeConnectedWallet } from 'state/wallets/reducer'
import { DefaultTheme } from 'styled-components/macro'
import styled, { ThemeContext } from 'styled-components/macro'
import { isMobile } from 'utils/userAgent'
Expand Down Expand Up @@ -245,13 +246,15 @@ export default function AccountDetails({
<WalletAction
style={{ fontSize: '.825rem', fontWeight: 400, marginRight: '8px' }}
onClick={() => {
const walletType = getConnectionName(getConnection(connector).type, getIsMetaMask())
if (connector.deactivate) {
connector.deactivate()
} else {
connector.resetState()
}

dispatch(updateSelectedWallet({ wallet: undefined }))
dispatch(removeConnectedWallet({ account, walletType }))
openOptions()
}}
>
Expand Down Expand Up @@ -339,9 +342,9 @@ export default function AccountDetails({
{!!pendingTransactions.length || !!confirmedTransactions.length ? (
<LowerSection>
<AutoRow mb={'1rem'} style={{ justifyContent: 'space-between' }}>
<ThemedText.Body>
<ThemedText.DeprecatedBody>
<Trans>Recent Transactions</Trans>
</ThemedText.Body>
</ThemedText.DeprecatedBody>
<LinkStyledButton onClick={clearAllTransactionsCallback}>
<Trans>(clear all)</Trans>
</LinkStyledButton>
Expand All @@ -351,9 +354,9 @@ export default function AccountDetails({
</LowerSection>
) : (
<LowerSection>
<ThemedText.Body color={theme.deprecated_text1}>
<ThemedText.DeprecatedBody color={theme.deprecated_text1}>
<Trans>Your transactions will appear here...</Trans>
</ThemedText.Body>
</ThemedText.DeprecatedBody>
</LowerSection>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions src/components/AddressInputPanel/index.tsx
Expand Up @@ -108,9 +108,9 @@ export default function AddressInputPanel({
<InputContainer>
<AutoColumn gap="md">
<RowBetween>
<ThemedText.Black color={theme.deprecated_text2} fontWeight={500} fontSize={14}>
<ThemedText.DeprecatedBlack color={theme.deprecated_text2} fontWeight={500} fontSize={14}>
{label ?? <Trans>Recipient</Trans>}
</ThemedText.Black>
</ThemedText.DeprecatedBlack>
{address && chainId && (
<ExternalLink
href={getExplorerLink(chainId, name ?? address, ExplorerDataType.ADDRESS)}
Expand Down
29 changes: 28 additions & 1 deletion src/components/AmplitudeAnalytics/constants.ts
Expand Up @@ -5,27 +5,51 @@
* and logged.
*/
export enum EventName {
APPROVE_TOKEN_TXN_SUBMITTED = 'Approve Token Transaction Submitted',
CONNECT_WALLET_BUTTON_CLICKED = 'Connect Wallet Button Clicked',
EXPLORE_TOKEN_ROW_SELECTED = 'Explore Token Row Selected',
EXPLORE_TOKEN_ROW_SELECTED = 'Explore Token Row Clicked',
PAGE_VIEWED = 'Page Viewed',
SWAP_AUTOROUTER_VISUALIZATION_EXPANDED = 'Swap Autorouter Visualization Expanded',
SWAP_DETAILS_EXPANDED = 'Swap Details Expanded',
SWAP_MAX_TOKEN_AMOUNT_SELECTED = 'Swap Max Token Amount Selected',
SWAP_PRICE_UPDATE_ACKNOWLEDGED = 'Swap Price Update Acknowledged',
SWAP_QUOTE_RECEIVED = 'Swap Quote Received',
SWAP_SUBMITTED = 'Swap Submitted',
SWAP_TOKENS_REVERSED = 'Swap Tokens Reversed',
SWAP_TRANSACTION_COMPLETED = 'Swap Transaction Completed',
TOKEN_IMPORTED = 'Token Imported',
TOKEN_SELECTED = 'Token Selected',
TOKEN_SELECTOR_OPENED = 'Token Selector Opened',
WALLET_CONNECT_TXN_COMPLETED = 'Wallet Connect Transaction Completed',
WALLET_SELECTED = 'Wallet Selected',
WRAP_TOKEN_TXN_SUBMITTED = 'Wrap Token Transaction Submitted',
// alphabetize additional event names.
}

export enum CUSTOM_USER_PROPERTIES {
WALLET_ADDRESS = 'wallet_address',
WALLET_TYPE = 'wallet_type',
USER_LAST_SEEN_DATE = 'user_last_seen_date',
USER_FIRST_SEEN_DATE = 'user_first_seen_date',
WALLET_CHAIN_IDS = 'all_wallet_chain_ids',
ALL_WALLET_ADDRESSES_CONNECTED = 'all_wallet_addresses_connected',
SCREEN_RESOLUTION = 'screen_resolution',
BROWSER = 'browser',
LIGHT_MODE = 'light_mode',
}

export enum WALLET_CONNECTION_RESULT {
SUCCEEDED = 'Succeeded',
FAILED = 'Failed',
}

export const NATIVE_CHAIN_ID = 'NATIVE'

export enum SWAP_PRICE_UPDATE_USER_RESPONSE {
ACCEPTED = 'Accepted',
REJECTED = 'Rejected',
}

/**
* Known pages in the app. Highest order context.
*/
Expand Down Expand Up @@ -60,17 +84,20 @@ export const enum ModalName {
* Use to identify low-level components given a TraceContext
*/
export const enum ElementName {
APPROVE_TOKEN_BUTTON = 'approve-token-button',
AUTOROUTER_VISUALIZATION_ROW = 'expandable-autorouter-visualization-row',
COMMON_BASES_CURRENCY_BUTTON = 'common-bases-currency-button',
CONFIRM_SWAP_BUTTON = 'confirm-swap-or-send',
CONNECT_WALLET_BUTTON = 'connect-wallet-button',
IMPORT_TOKEN_BUTTON = 'import-token-button',
MAX_TOKEN_AMOUNT_BUTTON = 'max-token-amount-button',
PRICE_UPDATE_ACCEPT_BUTTON = 'price-update-accept-button',
SWAP_BUTTON = 'swap-button',
SWAP_DETAILS_DROPDOWN = 'swap-details-dropdown',
SWAP_TOKENS_REVERSE_ARROW_BUTTON = 'swap-tokens-reverse-arrow-button',
TOKEN_SELECTOR_ROW = 'token-selector-row',
WALLET_TYPE_OPTION = 'wallet-type-option',
WRAP_TOKEN_BUTTON = 'wrap-token-button',
// alphabetize additional element names.
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/AmplitudeAnalytics/index.ts
Expand Up @@ -18,13 +18,16 @@ export function initializeAnalytics(isDevEnvironment = process.env.NODE_ENV ===
API_KEY,
/* userId= */ undefined, // User ID should be undefined to let Amplitude default to Device ID
/* options= */ {
// See documentation: https://www.docs.developers.amplitude.com/data/sdks/javascript/#track-referrers
includeReferrer: true,
// See documentation: https://www.docs.developers.amplitude.com/data/sdks/javascript/#track-utm-parameters
includeUtm: true,
// Disable tracking of private user information by Amplitude
trackingOptions: {
ipAddress: false,
carrier: false,
city: false,
region: false,
country: false,
dma: false, // designated market area
},
}
Expand Down
23 changes: 23 additions & 0 deletions src/components/AmplitudeAnalytics/utils.ts
@@ -0,0 +1,23 @@
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'

import { NATIVE_CHAIN_ID } from './constants'

export const getDurationUntilTimestampSeconds = (futureTimestampInSecondsSinceEpoch?: number): number | undefined => {
if (!futureTimestampInSecondsSinceEpoch) return undefined
return futureTimestampInSecondsSinceEpoch - new Date().getTime() / 1000
}

export const getDurationFromDateMilliseconds = (start: Date): number => {
return new Date().getTime() - start.getTime()
}

export const formatToDecimal = (
intialNumberObject: Percent | CurrencyAmount<Token | Currency>,
decimalPlace: number
): number => parseFloat(intialNumberObject.toFixed(decimalPlace))

export const getTokenAddress = (currency: Currency) => (currency.isNative ? NATIVE_CHAIN_ID : currency.address)

export const formatPercentInBasisPointsNumber = (percent: Percent): number => parseFloat(percent.toFixed(2)) * 100

export const formatPercentNumber = (percent: Percent): number => parseFloat(percent.toFixed(2))
16 changes: 8 additions & 8 deletions src/components/ConnectedAccountBlocked/index.tsx
Expand Up @@ -33,22 +33,22 @@ export default function ConnectedAccountBlocked(props: ConnectedAccountBlockedPr
<Modal isOpen={props.isOpen} onDismiss={Function.prototype()}>
<ContentWrapper>
<WarningIcon />
<ThemedText.LargeHeader lineHeight={2} marginBottom={1} marginTop={1}>
<ThemedText.DeprecatedLargeHeader lineHeight={2} marginBottom={1} marginTop={1}>
<Trans>Blocked Address</Trans>
</ThemedText.LargeHeader>
<ThemedText.DarkGray fontSize={12} marginBottom={12}>
</ThemedText.DeprecatedLargeHeader>
<ThemedText.DeprecatedDarkGray fontSize={12} marginBottom={12}>
{props.account}
</ThemedText.DarkGray>
<ThemedText.Main fontSize={14} marginBottom={12}>
</ThemedText.DeprecatedDarkGray>
<ThemedText.DeprecatedMain fontSize={14} marginBottom={12}>
<Trans>This address is blocked on the Uniswap Labs interface because it is associated with one or more</Trans>{' '}
<ExternalLink href="https://help.uniswap.org/en/articles/6149816">
<Trans>blocked activities</Trans>
</ExternalLink>
.
</ThemedText.Main>
<ThemedText.Main fontSize={12}>
</ThemedText.DeprecatedMain>
<ThemedText.DeprecatedMain fontSize={12}>
<Trans>If you believe this is an error, please send an email including your address to </Trans>{' '}
</ThemedText.Main>
</ThemedText.DeprecatedMain>
<Copy iconSize={12} toCopy="compliance@uniswap.org" color={theme.deprecated_primary1} iconPosition="right">
compliance@uniswap.org
</Copy>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CurrencyInputPanel/FiatValue.tsx
Expand Up @@ -31,7 +31,7 @@ export function FiatValue({
const visibleDecimalPlaces = p < 1.05 ? 4 : 2

return (
<ThemedText.Body fontSize={14} color={fiatValue ? theme.deprecated_text3 : theme.deprecated_text4}>
<ThemedText.DeprecatedBody fontSize={14} color={fiatValue ? theme.deprecated_text3 : theme.deprecated_text4}>
{fiatValue ? (
<Trans>
$
Expand All @@ -51,6 +51,6 @@ export function FiatValue({
</MouseoverTooltip>
</span>
) : null}
</ThemedText.Body>
</ThemedText.DeprecatedBody>
)
}
8 changes: 4 additions & 4 deletions src/components/CurrencyInputPanel/index.tsx
Expand Up @@ -232,9 +232,9 @@ export default function CurrencyInputPanel({
<FixedContainer>
<AutoColumn gap="sm" justify="center">
<Lock />
<ThemedText.Label fontSize="12px" textAlign="center" padding="0 12px">
<ThemedText.DeprecatedLabel fontSize="12px" textAlign="center" padding="0 12px">
<Trans>The market price is outside your specified price range. Single-asset deposit only.</Trans>
</ThemedText.Label>
</ThemedText.DeprecatedLabel>
</AutoColumn>
</FixedContainer>
)}
Expand Down Expand Up @@ -297,7 +297,7 @@ export default function CurrencyInputPanel({
</LoadingOpacityContainer>
{account ? (
<RowFixed style={{ height: '17px' }}>
<ThemedText.Body
<ThemedText.DeprecatedBody
onClick={onMax}
color={theme.deprecated_text3}
fontWeight={500}
Expand All @@ -311,7 +311,7 @@ export default function CurrencyInputPanel({
<Trans>Balance: {formatCurrencyAmount(selectedCurrencyBalance, 4)}</Trans>
)
) : null}
</ThemedText.Body>
</ThemedText.DeprecatedBody>
{showMaxButton && selectedCurrencyBalance ? (
<TraceEvent
events={[Event.onClick]}
Expand Down
14 changes: 7 additions & 7 deletions src/components/ErrorBoundary/index.tsx
Expand Up @@ -101,13 +101,13 @@ export default class ErrorBoundary extends React.Component<PropsWithChildren<unk
<BodyWrapper>
<AutoColumn gap={'md'}>
<SomethingWentWrongWrapper>
<ThemedText.Label fontSize={24} fontWeight={600}>
<ThemedText.DeprecatedLabel fontSize={24} fontWeight={600}>
<Trans>Something went wrong</Trans>
</ThemedText.Label>
</ThemedText.DeprecatedLabel>
</SomethingWentWrongWrapper>
<CodeBlockWrapper>
<code>
<ThemedText.Main fontSize={10}>{error.stack}</ThemedText.Main>
<ThemedText.DeprecatedMain fontSize={10}>{error.stack}</ThemedText.DeprecatedMain>
</code>
</CodeBlockWrapper>
{IS_UNISWAP ? (
Expand All @@ -120,18 +120,18 @@ export default class ErrorBoundary extends React.Component<PropsWithChildren<unk
)}`}
target="_blank"
>
<ThemedText.Link fontSize={16}>
<ThemedText.DeprecatedLink fontSize={16}>
<Trans>Create an issue on GitHub</Trans>
<span></span>
</ThemedText.Link>
</ThemedText.DeprecatedLink>
</ExternalLink>
</LinkWrapper>
<LinkWrapper>
<ExternalLink id="get-support-on-discord" href="https://discord.gg/FCfyBSbCU5" target="_blank">
<ThemedText.Link fontSize={16}>
<ThemedText.DeprecatedLink fontSize={16}>
<Trans>Get support on Discord</Trans>
<span></span>
</ThemedText.Link>
</ThemedText.DeprecatedLink>
</ExternalLink>
</LinkWrapper>
</AutoRow>
Expand Down
6 changes: 3 additions & 3 deletions src/components/FeeSelector/FeeOption.tsx
Expand Up @@ -11,7 +11,7 @@ import { ThemedText } from 'theme'
import { FeeTierPercentageBadge } from './FeeTierPercentageBadge'
import { FEE_AMOUNT_DETAIL } from './shared'

const ResponsiveText = styled(ThemedText.Label)`
const ResponsiveText = styled(ThemedText.DeprecatedLabel)`
line-height: 16px;
font-size: 14px;
Expand All @@ -37,9 +37,9 @@ export function FeeOption({ feeAmount, active, poolState, distributions, onClick
<ResponsiveText>
<Trans>{FEE_AMOUNT_DETAIL[feeAmount].label}%</Trans>
</ResponsiveText>
<ThemedText.Main fontWeight={400} fontSize="12px" textAlign="left">
<ThemedText.DeprecatedMain fontWeight={400} fontSize="12px" textAlign="left">
{FEE_AMOUNT_DETAIL[feeAmount].description}
</ThemedText.Main>
</ThemedText.DeprecatedMain>
</AutoColumn>

{distributions && (
Expand Down
4 changes: 2 additions & 2 deletions src/components/FeeSelector/FeeTierPercentageBadge.tsx
Expand Up @@ -17,15 +17,15 @@ export function FeeTierPercentageBadge({
}) {
return (
<Badge>
<ThemedText.Label fontSize={10}>
<ThemedText.DeprecatedLabel fontSize={10}>
{!distributions || poolState === PoolState.NOT_EXISTS || poolState === PoolState.INVALID ? (
<Trans>Not created</Trans>
) : distributions[feeAmount] !== undefined ? (
<Trans>{distributions[feeAmount]?.toFixed(0)}% select</Trans>
) : (
<Trans>No data</Trans>
)}
</ThemedText.Label>
</ThemedText.DeprecatedLabel>
</Badge>
)
}

0 comments on commit 13aadb7

Please sign in to comment.