Skip to content

Commit 0f70c08

Browse files
JFrankfurtcrowdin-botmicaelr95Justin Dominguemoodysalem
authored
chore(widgets): Merge main into widgets (#3013)
* chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * fix: center focused outline card (#2625) * fix: add usdc to arbitrum/optimism common bases (#2641) * remove WETH from optimism bases (#2640) * use l2 logos in base pairs (#2634) * fix: split calls into more chunks if they fail due to out of gas errors (#2630) * fix: split calls into more chunks if they fail due to out of gas errors * set to 100m gas * back to 25m so we batch fewer calls * do not pass through gas limit, some simplification of the code * unused import * fix: restrict @davatar usage to avoid 3p fetches (#2649) * chore(i18n): synchronize translations from crowdin [skip ci] * fix(L2): ensure chainIds match before fetching pool data (#2652) * ensure chainIds match before fetching pool data * debounce both input currencies, and only look for pairs on currencies that share a chainId * pr feedback * fix: use optional operator for chainId (#2666) * chore: update token list (#2670) * update token list * Fix code style issues with ESLint Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * fix: update token list (#2671) * update token list * Fix code style issues with ESLint Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * feat: extend privacy and terms (#2623) * initial iteration * add logging * added hook * polish * remove unused import * add hash * addressed pr feedback * remove autorouter icon * use firebase store * style * adjust recat ga * log remove liquidity * update copy * addressed pr feedback * addressed pr feedback * prevent privacy content from dismissing modal * make top-level key origin * use hostname * restore trm * chore(i18n): synchronize translations from crowdin [skip ci] * log full signed tx (#2681) * refactor monitoring (#2682) * chore: set final privacy learn more link' (#2684) * add learn more button * add final link * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * fix: back arrow bug in wallet modal and fill tx for wallet (#2687) * add tx to wallet connect * remove id from env * restore env * block import of unsupported tokens (#2673) generalize custom import token block ui * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(deps-dev): bump @uniswap/token-lists (#2699) * chore(i18n): synchronize translations from crowdin [skip ci] * try out 'dimension1' (#2704) * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * fix: walletconnect modal re-open after user rejection (#2693) Co-authored-by: M0kY <moky@example.com> * chore: update unsupported token list (#2689) * chore: update unsupported token list * Fix code style issues with ESLint Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * fix: memoize the list stuff so the tokens are consistently clickable (#2724) * chore(i18n): synchronize translations from crowdin [skip ci] * feat: update cmc list link (#2710) * update cmc lists * update CMC url * add token to unsupported list (#2732) * don't overwrite localstorage lists when fetch throws (#2723) * try cd1 for custom dimension (#2734) * fix: Update walletlink-connector to 6.2.8 (#2655) * Update walletlink-connector to 6.2.5 which has a walletlink update to support addEthereumChain+switchEthereumChain requests * Update walletlink-connector to 6.2.7 * Update walletlink-connector to 6.2.8 * fix: Parse latest proposal description correctly * add proposal start time (#2738) * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * fix: #2741 Increase liquidity form off center (#2746) * fix: bump to latest token list including ENS token * fix: remove deprecated optimism status url (#2771) * feat: Menu update. Add help center & feature requests. Remove analytics & github. (#2709) * Add help center, remove analytics from menu * Add canny feature requests link, remove github link * add coffee icon * no unused imports eslint rule (#2773) * chore(i18n): synchronize translations from crowdin [skip ci] * add protocols param to quote endpoint (#2774) * add protocols param to quote endpoint * Fix code style issues with ESLint Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * fix: lint error (#2775) * fix(optimism): Optimism regenesis support (#2703) * feat(optimism): optimistic kovan local regenesis changes * use the regenesis version of the sdk * remove the override no longer necessary * diff rpc url * back to kovan url * lint error * Optimism mainnet regenesis test (#2695) * remove the optimism mainnet specific code and point to the mainnet regenesis rpc url * point at the old mainnet multicall address * bump the sdk version * copy the list * multicall address regenesis change * revert the gas limit special casing for optimism * bump the sdk version * remove a couple other temporary edits * unused test case * specific version of v3-sdk * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * chore(i18n): synchronize translations from crowdin [skip ci] * feat: add support for 0.01% tier (#2769) * chore: add support for 0.01% tier * only show 1bps on mainnet * rename VERY_LOW to LOWEST * upgrade to v3-sdk 3.7.0 * add snapshot testing for lowest tier * fix integration test * fix integration test * use ALL_SUPPORTED_CHAIN_IDS over string all * consider 0.01% tier in pool (#2770) * merge main and only consider lowest tier for mainnet * chore(i18n): synchronize translations from crowdin [skip ci] * fix(L2): update block warning updater to check most recent block timestamp (#2777) * update block warning updater to check most recent block timestamp * stop doing dumb state manipulation * fix: copy in network alert * chore(i18n): synchronize translations from crowdin [skip ci] * fix(L2): remove redux from chain connectivity (#2781) * remove redux from chain connectivity * useMachineTimeMs instead of Date.now to force updates, useCurrentBlockTimestamp * use useInterval * change not created font size to 10 (#2785) * chore(i18n): synchronize translations from crowdin [skip ci] * fix: format date using Date.toLocaleString (#2459) * fix: format date using Date.toLocaleString Fixes #2458 * fix: date typings * chore(i18n): synchronize translations from crowdin [skip ci] * fix: broken link to docs (#2816) * chore: fix typo in useAllCurrencyCombinations.ts (#2778) occurence -> occurrence * chore: update typechain scripts for Windows (#2707) There are two errors when deploying on Windows system: 1. Using single quotes in path argument doesn't seem to be accepted in typechain command 2. `?(v3-core|v3-periphery)` operator doesn't work Here are fixes/workarounds. * perf: lazy load vote related routes (#2468) * perf: lazy load vote related routes * wrap Switch in Suspense * remove exact to match nested routes * fix nested routes * split Landing * fix * chore(i18n): synchronize translations from crowdin [skip ci] * fix: Enable 3085 requests for coinbase wallet (#2753) enable 3085 requests for coinbase wallet * feat: set the auto slippage tolerance by the dollar value of gas (#2815) * feat: set the auto slippage tolerance by the dollar value of gas * comments * min/max at 0.5% to 25% * oops on constant * address review feedback * Fixing #2818 (#2820) * Fix code style issues with ESLint * chore(i18n): synchronize translations from crowdin [skip ci] * fix: fix #2818 * chore(i18n): synchronize translations from crowdin [skip ci] * log an event on max click (#2827) * Add trailing slash to L2 info links (#2696) Some links were broken. For example on /pools/ page click the 'Top Pools' CTA. It would mistakenly direct you to info.uniswap.org/optimismpools instead of optimism/pools * fix(L2): block L2 tokens explicitly linked to L1 tokens that are blocked (#2721) * block L2 tokens explicitly linked to L1 tokens that are blocked * Fix code style issues with ESLint * check for support on all connectors, and disable when the connector (or lack thereof) no longer supports 3085 (#2824) * feat: display an ENS avatar (#2806) * feat: ens avatar resolution * chore: uninstall @davatar/react * fix: add avatar alt * feat: support data uris * feat: support arweave uris * feat: support erc721 avatars * feat: support erc1155 avatars * fix: jazzicon integration * fix: clean usage of status icon * fix: fix jazzicon svg offset * refactor: share status icon component * fix: pass memoized args to multicall * Update locales.ts (#2825) update Finnish from person (Suomalainen) to language (suomi) * chore(i18n): synchronize translations from crowdin [skip ci] * chore: fix the build blocking linter error * chore: run linters with auto_fix = false for forks (#2852) * fix: do not show urls if issue is not occurring on app.uniswap.org (#2855) * fix: do not show urls if issue is not occurring on app.uniswap.org fixes #2572 * address comment * fix: remove orphaned node (#2863) * fix: remove orphaned node * fix: react cleanup * refactor: use ref for jazzicon (#2874) * chore(i18n): synchronize translations from crowdin [skip ci] * chore(deps): bump ws from 5.2.2 to 5.2.3 (#2759) Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@5.2.2...5.2.3) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump url-parse from 1.5.1 to 1.5.3 (#2504) Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](unshiftio/url-parse@1.5.1...1.5.3) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add more tests for tryParseTick (#2110) * fix(lint): clean up the eslint config (#2886) * fix(lint): clean up the eslint config * Fix code style issues with ESLint * fix the linter errors that arose from using the proper config * clean up the rebass text renames * fix if statement, use the config * use the same name prefix for both steps * `TextPreset` -> `ThemedText` Co-authored-by: Lint Action <lint-action@samuelmeuli.com> * fix: Add routes for stakewise tokens (#2832) * Add additional routes for stakewise tokens * Reference StakeWise addresses with sdk tokens * Sort token imports * fix: fix layout of proposal list items on the vote page on mobile (#2898) * fix: fixing layout from using grid to flexbox * fix: setting WrapSmall to nowrap due to layout issue on mobile * fix: using width auto instead of disabling flex wrap Co-authored-by: Julian Anderson <juliancanderson@gmail.com> * fix: typo in arweave URI recognition (#2901) * deleted files * Revert "Merge branch 'main' of https://github.com/Uniswap/interface" (#2912) This reverts commit bf7a40b, reversing changes made to 097b836. * fix: inadvertent merges/reverts (#2915) * Revert "Revert "Merge branch 'main' of https://github.com/Uniswap/interface" (#2912)" This reverts commit 7d343dc. * Revert "deleted files" This reverts commit 097b836. * refactor: Replace multicall implementation with library (#2768) - Replace the local implementation of multicall with the new redux-multicall lib - Create wrappers for redux-multicall hooks to inject block number and chainId * fix: introduce safeNamehash (#2925) * namehash -> safeNamehash where necessary * cleanup * address comment * feat: Add learn more link in TRM description (#2919) * Add learn more link in TRM description * Update src/components/PrivacyPolicy/index.tsx Co-authored-by: Justin Domingue <judo@uniswap.org> * give a bit more gas to balanceOf (#2943) * fix: memoize hooks from /swap (#2949) * fix: memoize hooks from /swap * chore: rm console * add fix for polygon proposal title (#2974) * fix: display Uniswap token list in UI (#2821) * fix: display Uniswap token list in UI * chore: remove default-token-list build dependency * fix: use ENS name for Uniswap token list * fix: change Uniswap token list url * fix: extend transaction deadline to 3 days (#2982) * feat: integrate SwapRouter02 on L1/L2 + gas ui * client-side smart order router support * support auto router on L2s * add swap router version in approval/swap callback GA events to save $ on approval txs * add persistent UI view of gas estimate on L1s Co-authored-by: Lint Action <lint-action@samuelmeuli.com> Co-authored-by: Ian Lapham <ian@uniswap.org> Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com> * Update CONTRIBUTING.md (#2992) * feat: Update contribution spec (#2993) * Update CONTRIBUTING.md (#2994) * Update CONTRIBUTING.md (#2995) * feat: Update contribution spec (#2996) * chore(i18n): synchronize translations from crowdin [skip ci] * fix: double scroll in manage token list (#3020) * fix double scroll * remove bottom padding * restrict walletlink to mainnet only (#3024) * increase warning timer (#3004) * add index.html styles to widget Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Micael Rodrigues <micaelr95@outlook.pt> Co-authored-by: Justin Domingue <judo@uniswap.org> Co-authored-by: Moody Salem <moodysalem@users.noreply.github.com> Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> Co-authored-by: Ian Lapham <ian@uniswap.org> Co-authored-by: Lint Action <lint-action@samuelmeuli.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: M0kY <46133205+M0kY@users.noreply.github.com> Co-authored-by: M0kY <moky@example.com> Co-authored-by: Will Hennessy <hennessywill@gmail.com> Co-authored-by: Brendan Weinstein <65564422+brendanww@users.noreply.github.com> Co-authored-by: Noah Zinsmeister <noahwz@gmail.com> Co-authored-by: Ben Krochta <35636764+bkrochta@users.noreply.github.com> Co-authored-by: Moody Salem <moody.salem@gmail.com> Co-authored-by: Raj <sukhrajghuman@live.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Matthew Salamon <35425388+Matthews3301@users.noreply.github.com> Co-authored-by: Sam Chen <chenxsan@gmail.com> Co-authored-by: Ali Eray Kısabacak <eraykisabacak@hotmail.com> Co-authored-by: Kimmo S <kkpsiren@gmail.com> Co-authored-by: Dmitri Tsumak <tsumak.dmitri@gmail.com> Co-authored-by: Julian Anderson <juliancanderson@gmail.com> Co-authored-by: Carlos Diaz-Padron <carlosdiazpadron@gmail.com> Co-authored-by: J M Rossy <jm.rossy@gmail.com> Co-authored-by: Barry G <bgitarts@gmail.com> Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com> Co-authored-by: Tina Zheng <59578595+tinaszheng@users.noreply.github.com>
1 parent 263840f commit 0f70c08

File tree

120 files changed

+5694
-2476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5694
-2476
lines changed

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ REACT_APP_INFURA_KEY="099fc58e0de9451d80b18d7c74caa7c1"
22
REACT_APP_PORTIS_ID="c0e2bf01-4b08-4fd5-ac7b-8e26b58cd236"
33
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
44
REACT_APP_GOOGLE_ANALYTICS_ID="UA-128182339-4"
5-
REACT_APP_FIREBASE_KEY="AIzaSyBcZWwTcTJHj_R6ipZcrJkXdq05PuX0Rs0"
5+
REACT_APP_FIREBASE_KEY="AIzaSyBcZWwTcTJHj_R6ipZcrJkXdq05PuX0Rs0"

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ makes large architectural changes, consider following all the standards.
2727
- If something breaks, add automated tests so it doesn't break again
2828
- Add integration tests for new pages or flows
2929
- Verify that all CI checks pass before merging
30-
- Have at least one product manager or designer approve of significant UX changes
30+
- Have at least one product manager or designer approve of any significant UX changes
3131

3232
## Guidelines
3333

@@ -42,7 +42,7 @@ The following points should help guide your development:
4242
- An Ethereum node should be the only critical dependency
4343
- All other external dependencies should only enhance the UX ([graceful degradation](https://developer.mozilla.org/en-US/docs/Glossary/Graceful_degradation))
4444
- Accessibility: anyone can use the interface
45-
- The interface should be responsive, small and run well on low performance devices (majority of swaps on mobile!)
45+
- The interface should be responsive, small and also run well on low performance devices (majority of swaps on mobile!)
4646

4747
## Release process
4848

@@ -73,4 +73,4 @@ We sync to the repository on a schedule, rather than download translations at bu
7373

7474
You can contribute by joining Crowdin to proofread existing translations [here](https://crowdin.com/project/uniswap-interface/invite?d=93i5n413q403t4g473p443o4c3t2g3s21343u2c3n403l4b3v2735353i4g4k4l4g453j4g4o4j4e4k4b323l4a3h463s4g453q443m4e3t2b303s2a35353l403o443v293e303k4g4n4r4g483i4g4r4j4e4o473i5n4a3t463t4o4)
7575

76-
Or, ask to join us as a translator in the Discord!
76+
Or, ask to join us as a translator in the Discord!!

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
"@uniswap/liquidity-staker": "^1.0.2",
6060
"@uniswap/merkle-distributor": "1.0.1",
6161
"@uniswap/redux-multicall": "^1.0.0",
62+
"@uniswap/router-sdk": "^1.0.3",
6263
"@uniswap/sdk-core": "^3.0.1",
64+
"@uniswap/smart-order-router": "^2.5.4",
6365
"@uniswap/token-lists": "^1.0.0-beta.27",
6466
"@uniswap/v2-core": "1.0.0",
6567
"@uniswap/v2-periphery": "^1.1.0-beta.0",
66-
"@uniswap/v2-sdk": "^3.0.0-alpha.2",
68+
"@uniswap/v2-sdk": "^3.0.1",
6769
"@uniswap/v3-core": "1.0.0",
6870
"@uniswap/v3-periphery": "^1.1.1",
6971
"@uniswap/v3-sdk": "^3.7.1",
@@ -119,6 +121,7 @@
119121
"typescript": "^4.2.3",
120122
"ua-parser-js": "^0.7.28",
121123
"use-count-up": "^2.2.5",
124+
"use-resize-observer": "^8.0.0",
122125
"web-vitals": "^2.1.0",
123126
"workbox-core": "^6.1.0",
124127
"workbox-precaching": "^6.1.0",

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
html {
6868
font-size: 16px;
6969
font-variant: none;
70+
font-smooth: always;
7071
-webkit-font-smoothing: antialiased;
7172
-moz-osx-font-smoothing: grayscale;
7273
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

src/assets/images/gas-icon.svg

Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { animated, useSpring } from 'react-spring'
2+
import useResizeObserver from 'use-resize-observer'
3+
4+
/**
5+
* @param open conditional to show content or hide
6+
* @returns Wrapper to smoothly hide and expand content
7+
*/
8+
export default function AnimatedDropdown({ open, children }: React.PropsWithChildren<{ open: boolean }>) {
9+
const { ref, height } = useResizeObserver()
10+
11+
const props = useSpring({
12+
height: open ? height ?? 0 : 0,
13+
config: {
14+
mass: 1.2,
15+
tension: 300,
16+
friction: 20,
17+
clamp: true,
18+
velocity: 0.01,
19+
},
20+
})
21+
22+
return (
23+
<animated.div
24+
style={{
25+
...props,
26+
overflow: 'hidden',
27+
width: '100%',
28+
willChange: 'height',
29+
}}
30+
>
31+
<div ref={ref}>{children}</div>
32+
</animated.div>
33+
)
34+
}

src/components/Button/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const BaseButton = styled(RebassButton)<
3333
position: relative;
3434
z-index: 1;
3535
&:disabled {
36+
opacity: 50%;
3637
cursor: auto;
3738
pointer-events: none;
3839
}
@@ -236,7 +237,7 @@ const ButtonConfirmedStyle = styled(BaseButton)`
236237
/* border: 1px solid ${({ theme }) => theme.green1}; */
237238
238239
&:disabled {
239-
/* opacity: 50%; */
240+
opacity: 50%;
240241
background-color: ${({ theme }) => theme.bg2};
241242
color: ${({ theme }) => theme.text2};
242243
cursor: auto;

src/components/CurrencyInputPanel/FiatValue.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { Trans } from '@lingui/macro'
2+
// eslint-disable-next-line no-restricted-imports
3+
import { t } from '@lingui/macro'
24
import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core'
35
import HoverInlineText from 'components/HoverInlineText'
46
import { useMemo } from 'react'
57

68
import useTheme from '../../hooks/useTheme'
79
import { ThemedText } from '../../theme'
810
import { warningSeverity } from '../../utils/prices'
11+
import { MouseoverTooltip } from '../Tooltip'
912

1013
export function FiatValue({
1114
fiatValue,
@@ -25,18 +28,24 @@ export function FiatValue({
2528
}, [priceImpact, theme.green1, theme.red1, theme.text3, theme.yellow1])
2629

2730
return (
28-
<ThemedText.Body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>
31+
<ThemedText.Body fontSize={14} color={fiatValue ? theme.text3 : theme.text4}>
2932
{fiatValue ? (
3033
<Trans>
31-
~$ <HoverInlineText text={fiatValue?.toSignificant(6, { groupSeparator: ',' })} />
34+
$
35+
<HoverInlineText
36+
text={fiatValue?.toSignificant(6, { groupSeparator: ',' })}
37+
textColor={fiatValue ? theme.text3 : theme.text4}
38+
/>
3239
</Trans>
3340
) : (
3441
''
3542
)}
3643
{priceImpact ? (
3744
<span style={{ color: priceImpactColor }}>
3845
{' '}
39-
(<Trans>{priceImpact.multiply(-1).toSignificant(3)}%</Trans>)
46+
<MouseoverTooltip text={t`The estimated difference between the USD values of input and output amounts.`}>
47+
(<Trans>{priceImpact.multiply(-1).toSignificant(3)}%</Trans>)
48+
</MouseoverTooltip>
4049
</span>
4150
) : null}
4251
</ThemedText.Body>

src/components/CurrencyInputPanel/index.tsx

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ const InputPanel = styled.div<{ hideInput?: boolean }>`
2929
background-color: ${({ theme, hideInput }) => (hideInput ? 'transparent' : theme.bg2)};
3030
z-index: 1;
3131
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
32+
transition: height 1s ease;
33+
will-change: height;
3234
`
3335

3436
const FixedContainer = styled.div`
3537
width: 100%;
3638
height: 100%;
3739
position: absolute;
3840
border-radius: 20px;
39-
background-color: ${({ theme }) => theme.bg1};
40-
opacity: 0.95;
41+
background-color: ${({ theme }) => theme.bg2};
4142
display: flex;
4243
align-items: center;
4344
justify-content: center;
@@ -46,7 +47,7 @@ const FixedContainer = styled.div`
4647

4748
const Container = styled.div<{ hideInput: boolean }>`
4849
border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')};
49-
border: 1px solid ${({ theme, hideInput }) => (hideInput ? ' transparent' : theme.bg2)};
50+
border: 1px solid ${({ theme }) => theme.bg0};
5051
background-color: ${({ theme }) => theme.bg1};
5152
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
5253
:focus,
@@ -56,35 +57,35 @@ const Container = styled.div<{ hideInput: boolean }>`
5657
`
5758

5859
const CurrencySelect = styled(ButtonGray)<{ visible: boolean; selected: boolean; hideInput?: boolean }>`
59-
visibility: ${({ visible }) => (visible ? 'visible' : 'hidden')};
6060
align-items: center;
61-
font-size: 24px;
62-
font-weight: 500;
63-
background-color: ${({ selected, theme }) => (selected ? theme.bg0 : theme.primary1)};
64-
color: ${({ selected, theme }) => (selected ? theme.text1 : theme.white)};
65-
border-radius: 16px;
61+
background-color: ${({ selected, theme }) => (selected ? theme.bg2 : theme.primary1)};
6662
box-shadow: ${({ selected }) => (selected ? 'none' : '0px 6px 10px rgba(0, 0, 0, 0.075)')};
6763
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);
68-
outline: none;
64+
color: ${({ selected, theme }) => (selected ? theme.text1 : theme.white)};
6965
cursor: pointer;
66+
border-radius: 16px;
67+
outline: none;
7068
user-select: none;
7169
border: none;
70+
font-size: 24px;
71+
font-weight: 500;
7272
height: ${({ hideInput }) => (hideInput ? '2.8rem' : '2.4rem')};
7373
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
7474
padding: 0 8px;
7575
justify-content: space-between;
76-
margin-right: ${({ hideInput }) => (hideInput ? '0' : '12px')};
76+
margin-left: ${({ hideInput }) => (hideInput ? '0' : '12px')};
7777
:focus,
7878
:hover {
79-
background-color: ${({ selected, theme }) => (selected ? theme.bg2 : darken(0.05, theme.primary1))};
79+
background-color: ${({ selected, theme }) => (selected ? theme.bg3 : darken(0.05, theme.primary1))};
8080
}
81+
visibility: ${({ visible }) => (visible ? 'visible' : 'hidden')};
8182
`
8283

8384
const InputRow = styled.div<{ selected: boolean }>`
8485
${({ theme }) => theme.flexRowNoWrap}
8586
align-items: center;
8687
justify-content: space-between;
87-
padding: ${({ selected }) => (selected ? ' 1rem 1rem 0.75rem 1rem' : '1rem 1rem 0.75rem 1rem')};
88+
padding: ${({ selected }) => (selected ? ' 1rem 1rem 0.75rem 1rem' : '1rem 1rem 1rem 1rem')};
8889
`
8990

9091
const LabelRow = styled.div`
@@ -128,28 +129,30 @@ const StyledTokenName = styled.span<{ active?: boolean }>`
128129

129130
const StyledBalanceMax = styled.button<{ disabled?: boolean }>`
130131
background-color: transparent;
132+
background-color: ${({ theme }) => theme.primary5};
131133
border: none;
132134
border-radius: 12px;
133-
font-size: 14px;
134-
font-weight: 500;
135+
color: ${({ theme }) => theme.primary1};
135136
cursor: pointer;
136-
padding: 0;
137-
color: ${({ theme }) => theme.primaryText1};
137+
font-size: 11px;
138+
font-weight: 500;
139+
margin-left: 0.25rem;
138140
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
141+
padding: 4px 6px;
139142
pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')};
140-
margin-left: 0.25rem;
143+
144+
:hover {
145+
opacity: ${({ disabled }) => (!disabled ? 0.8 : 0.4)};
146+
}
141147
142148
:focus {
143149
outline: none;
144150
}
145-
146-
${({ theme }) => theme.mediaWidth.upToExtraSmall`
147-
margin-right: 0.5rem;
148-
`};
149151
`
150152

151153
const StyledNumericalInput = styled(NumericalInput)<{ $loading: boolean }>`
152-
${loadingOpacityMixin}
154+
${loadingOpacityMixin};
155+
text-align: left;
153156
`
154157

155158
interface CurrencyInputPanelProps {
@@ -220,6 +223,15 @@ export default function CurrencyInputPanel({
220223
)}
221224
<Container hideInput={hideInput}>
222225
<InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}} selected={!onCurrencySelect}>
226+
{!hideInput && (
227+
<StyledNumericalInput
228+
className="token-amount-input"
229+
value={value}
230+
onUserInput={onUserInput}
231+
$loading={loading}
232+
/>
233+
)}
234+
223235
<CurrencySelect
224236
visible={currency !== undefined}
225237
selected={!!currency}
@@ -257,49 +269,39 @@ export default function CurrencyInputPanel({
257269
{onCurrencySelect && <StyledDropDown selected={!!currency} />}
258270
</Aligner>
259271
</CurrencySelect>
260-
{!hideInput && (
261-
<StyledNumericalInput
262-
className="token-amount-input"
263-
value={value}
264-
onUserInput={onUserInput}
265-
$loading={loading}
266-
/>
267-
)}
268272
</InputRow>
269-
{!hideInput && !hideBalance && (
273+
{!hideInput && !hideBalance && currency && (
270274
<FiatRow>
271275
<RowBetween>
276+
<LoadingOpacityContainer $loading={loading}>
277+
<FiatValue fiatValue={fiatValue} priceImpact={priceImpact} />
278+
</LoadingOpacityContainer>
272279
{account ? (
273280
<RowFixed style={{ height: '17px' }}>
274281
<ThemedText.Body
275282
onClick={onMax}
276-
color={theme.text2}
277-
fontWeight={400}
283+
color={theme.text3}
284+
fontWeight={500}
278285
fontSize={14}
279286
style={{ display: 'inline', cursor: 'pointer' }}
280287
>
281288
{!hideBalance && currency && selectedCurrencyBalance ? (
282289
renderBalance ? (
283290
renderBalance(selectedCurrencyBalance)
284291
) : (
285-
<Trans>
286-
Balance: {formatCurrencyAmount(selectedCurrencyBalance, 4)} {currency.symbol}
287-
</Trans>
292+
<Trans>Balance: {formatCurrencyAmount(selectedCurrencyBalance, 4)}</Trans>
288293
)
289294
) : null}
290295
</ThemedText.Body>
291296
{showMaxButton && selectedCurrencyBalance ? (
292297
<StyledBalanceMax onClick={onMax}>
293-
<Trans>(Max)</Trans>
298+
<Trans>MAX</Trans>
294299
</StyledBalanceMax>
295300
) : null}
296301
</RowFixed>
297302
) : (
298303
<span />
299304
)}
300-
<LoadingOpacityContainer $loading={loading}>
301-
<FiatValue fiatValue={fiatValue} priceImpact={priceImpact} />
302-
</LoadingOpacityContainer>
303305
</RowBetween>
304306
</FiatRow>
305307
)}

src/components/CurrencyLogo/index.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,24 @@ export const getTokenLogoURL = (
3737
const StyledEthereumLogo = styled.img<{ size: string }>`
3838
width: ${({ size }) => size};
3939
height: ${({ size }) => size};
40-
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);
41-
border-radius: 24px;
40+
background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%);
41+
42+
border-radius: 50%;
43+
-mox-box-shadow: 0 0 1px white;
44+
-webkit-box-shadow: 0 0 1px white;
45+
box-shadow: 0 0 1px white;
46+
border: 0px solid rgba(255, 255, 255, 0);
4247
`
4348

4449
const StyledLogo = styled(Logo)<{ size: string }>`
4550
width: ${({ size }) => size};
4651
height: ${({ size }) => size};
47-
border-radius: ${({ size }) => size};
48-
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);
49-
background-color: ${({ theme }) => theme.white};
52+
background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%);
53+
border-radius: 50%;
54+
-mox-box-shadow: 0 0 1px black;
55+
-webkit-box-shadow: 0 0 1px black;
56+
box-shadow: 0 0 1px black;
57+
border: 0px solid rgba(255, 255, 255, 0);
5058
`
5159

5260
export default function CurrencyLogo({

0 commit comments

Comments
 (0)