Compare commits

...

254 Commits

Author SHA1 Message Date
Crowdin Bot
361e0ca8d7 chore(i18n): synchronize translations from crowdin [skip ci] 2021-07-01 10:04:56 +00:00
Justin Domingue
cc0a757ddd fix: run graphql:codegen on yarn build (#1933)
* run graphql codegen on build

* yarn.lock

* remove ms.macro
2021-06-29 17:22:41 -07:00
Justin Domingue
31632d3c5b ignore state/data/generated.ts 2021-06-29 16:27:12 -07:00
Justin Domingue
9cfbec4b8b generated graphql schema and en-US.po on start (#1930) 2021-06-29 12:03:47 -07:00
Crowdin Bot
b5ac5d882f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-29 09:04:42 +00:00
Crowdin Bot
130606cab4 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-29 08:04:53 +00:00
Moody Salem
fa56919a06 fix(theme): always show the gradient background color 2021-06-28 19:47:22 -05:00
Moody Salem
633f65676e fix(theme): fix the missing background radial gradient
fixes https://github.com/Uniswap/uniswap-interface/issues/1925
2021-06-28 19:35:41 -05:00
Moody Salem
9bccb7ae3a fix(multicall): better use the block number returned from calls, and cancel all calls when a new block comes in 2021-06-28 19:26:47 -05:00
Moody Salem
8a2e4123c6 chore(yarn): update yarn.lock 2021-06-28 18:57:10 -05:00
Moody Salem
e93ddbedfa chore(ci): take a screenshot in the cypress test for an example 2021-06-28 18:55:42 -05:00
Justin Domingue
1667b56a04 feat(thegraph): auto-generate graphql types (#1926)
* auto-generate graphql types

* remove introspection

* generated .ts and add to prettierignore

* updated graph url
2021-06-28 16:43:24 -07:00
Justin Domingue
6e995d6c09 feat(pools): integrate with The Graph using RTK Query (#1924)
* integrate with the graph

* Update src/state/data/slice.ts

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

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2021-06-28 15:12:58 -07:00
Moody Salem
f096112716 fix: improve how we use blocks per fetch in the memoization of the listeners (#1920)
fixes https://github.com/Uniswap/uniswap-interface/issues/1877
2021-06-28 16:39:19 -05:00
Jordan Frankfurt
50c7d36164 replace trustwallet assets repo w/ our fork (#1922) 2021-06-28 16:35:31 -04:00
Moody Salem
8a7f1d51ce chore(ci): record integration tests 2021-06-28 15:12:24 -05:00
Crowdin Bot
8f59f501cc chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-28 16:04:43 +00:00
Jordan Frankfurt
197947835b remove unneeded log (#1917) 2021-06-27 22:23:46 -04:00
Crowdin Bot
94081b29a3 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-27 05:04:39 +00:00
Moody Salem
69183ed8c2 fix: translate claim modal inputs 2021-06-26 23:58:25 -05:00
Crowdin Bot
05e741b6c9 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-27 00:08:49 +00:00
Jordan Frankfurt
dfe550c43b add arbitrum-specific L2 designs (#1912) 2021-06-26 19:54:30 -04:00
Crowdin Bot
65dfb40e44 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-25 15:04:42 +00:00
Moody Salem
25f5ed9983 fix: scrollbars showing up in modal with mouse connected, use auto instead of scroll 2021-06-25 10:00:25 -05:00
Yuta Sugimura
9b1ef415c6 refactor: remove unneeded react import (#1801)
* Add rules

* Remove React import

* remove React import
2021-06-25 09:52:49 -05:00
Crowdin Bot
70f481430a chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-25 07:04:27 +00:00
Justin Domingue
942211eb00 fix: typos in modal css (#1911)
* allow modal scrolling on dekstop

* removed quote and fixed typo
2021-06-24 13:33:11 -07:00
Justin Domingue
6589c41800 allow modal scrolling on dekstop (#1910) 2021-06-24 10:04:07 -07:00
Moody Salem
14bac770b6 fix(arbitrum): explorer links and better anonymization of GA events 2021-06-24 11:38:08 -05:00
Crowdin Bot
c9dbe2f0ac chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-24 10:04:51 +00:00
Crowdin Bot
775cf57c30 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-24 09:04:32 +00:00
Moody Salem
f4935e9264 fix(arbitrum): miscellaneous arbitrum network changes
- adds the arbitrum rinkeby testnet deployment
- compute usdc prices on arbitrum one
2021-06-23 20:58:03 -05:00
Crowdin Bot
6b3914b7b9 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-23 08:05:03 +00:00
Crowdin Bot
41efb6f617 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-23 06:05:18 +00:00
Crowdin Bot
52df5f14cf chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-22 23:04:56 +00:00
Noah Zinsmeister
b48a7c529f fix: proposal sorting 2021-06-22 18:47:12 -04:00
Moody Salem
2eca50be93 chore: remove defunct arbitrum kovan testnet 2021-06-22 17:23:40 -05:00
Moody Salem
be2ce18bfa fix: change polling interval per network (#1898) 2021-06-22 17:21:01 -05:00
yj
fe13b29e5e Update README.md (#1897)
Simple signposting, for issue #1896
2021-06-22 15:03:45 -07:00
Crowdin Bot
02aac08489 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-22 21:05:04 +00:00
Crowdin Bot
8f29980b94 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-22 20:05:13 +00:00
Scott Moses Sunarto
bb542ef0fb feat: Add proposal creation interface (#1799)
* Make address input panel more generalized

* Add TextInput component

* Allow adjusting AppBody maxwidth

* Add create proposal layout page

* Fix style consistency

* create proposal ui goes brrr

* various fixes

* minor tweaks and bug fixes

* merge conflict clean up + bug fix

* i18n

* always show create proposal button

* adjust proposal title top margin and show ButtonError styling

* use button disable instead of button error when form is not filled

* revert mistaken css change

* default params for address input panel

* Refactor & fixes

- Add missing i18n
- Refactor how some styled-components is done
- ButtonError is now disabled when proposal is true in create proposal interface
- Edit copywriting
- Minor styling adjustments

* Fixed create proposal padding on medium screen

* refactor

* refactor pt. 2

* single column styling

* change AddressInputPanel font color

* Design adjustments

* change route for create proposal

* Add autonomous proposal CTA

* cta text edit

* Add link to docs for custom action

* small cleanup

* work with latest governor

Co-authored-by: Noah Zinsmeister <noahwz@gmail.com>
2021-06-22 15:51:32 -04:00
Crowdin Bot
c2fe17615f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-22 13:12:10 +00:00
Crowdin Bot
a4cab75d09 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-22 08:04:47 +00:00
Crowdin Bot
882457cfef chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-21 16:05:32 +00:00
Justin Domingue
9a1bb5dbfb Add missing semicolon in English source 2021-06-21 08:10:00 -07:00
Crowdin Bot
767cc85b3e chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-21 07:07:47 +00:00
Crowdin Bot
47d726e544 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-21 06:04:54 +00:00
Crowdin Bot
32118520cd chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-20 19:05:02 +00:00
Crowdin Bot
ada8a3af92 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-19 07:06:22 +00:00
Crowdin Bot
63694b32c0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-19 06:05:14 +00:00
Crowdin Bot
c9ab94d799 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-19 04:05:38 +00:00
Crowdin Bot
a990c4af70 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-18 21:04:57 +00:00
Crowdin Bot
b5cc33c1f5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-18 20:05:12 +00:00
Justin Domingue
31da6cdb9d fix: new toggle theme (#1782)
* new toggle theme

* moved trans to default

* update radius

* fianlize styles
2021-06-18 12:44:14 -07:00
Crowdin Bot
4079d8a517 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-18 16:05:52 +00:00
Crowdin Bot
e93fbfd31b chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-18 15:05:19 +00:00
Crowdin Bot
7817846368 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 23:04:59 +00:00
Crowdin Bot
fc6a69a9af chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 09:04:49 +00:00
Crowdin Bot
93a774092f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 08:05:12 +00:00
Crowdin Bot
55563e9bb2 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 07:07:40 +00:00
Crowdin Bot
f44aae2f53 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 06:04:53 +00:00
Crowdin Bot
7d674c33e7 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-17 04:05:17 +00:00
Noah Zinsmeister
79e6337629 fix governorIndex 2021-06-16 17:31:24 -04:00
Noah Zinsmeister
3c8e8604b8 Merge remote-tracking branch 'refs/remotes/origin/main' 2021-06-16 17:22:46 -04:00
Noah Zinsmeister
b763659788 restrict governance UI to mainnet only
fix governor name bug

revert useContract change

add governorIndex to vote page

only fetch latest useLatestProposalCount

fix useDataFromEventLogs

hardcode proposalIndexes for old governors
2021-06-16 17:22:37 -04:00
Crowdin Bot
1ac2581419 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 20:04:59 +00:00
Crowdin Bot
9f556680ed chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 19:06:17 +00:00
Justin Domingue
3f242f1b44 fix: memoize extendedEther to unnecessary rerenders (#1869) 2021-06-16 11:07:16 -07:00
Crowdin Bot
126688c753 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 17:16:00 +00:00
Ian Lapham
374cc361a6 small bg fixes (#1868) 2021-06-16 13:14:31 -04:00
Crowdin Bot
0198d0baa1 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 16:05:39 +00:00
Crowdin Bot
da2d7ba648 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 15:05:16 +00:00
Yuta Sugimura
37cf492dd5 fix: Add SwitchLocaleLink to a page where it does not exist (#1867) 2021-06-16 07:24:25 -07:00
Crowdin Bot
9e93f809a0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 14:05:04 +00:00
Crowdin Bot
d9bd392e6d chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 12:05:13 +00:00
Crowdin Bot
c48adc519f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 11:05:10 +00:00
Crowdin Bot
9f8983a92e chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 10:05:07 +00:00
Crowdin Bot
c9d3d81768 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 09:05:06 +00:00
Crowdin Bot
c6f73c35ee chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 08:05:22 +00:00
Crowdin Bot
7a2777b814 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-16 03:05:54 +00:00
Jordan Frankfurt
014595cdfb feat: add multi-contract governance support (#1860)
* Revert "feat: quick fix for new governor"
This reverts commit 5dd1249ddd.

* support multiple governance contracts
2021-06-15 22:36:27 -04:00
Jordan Frankfurt
1b27d8dab0 test integration key change (#1864) 2021-06-15 21:04:54 -04:00
Crowdin Bot
c4d12c86a8 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 23:04:42 +00:00
Crowdin Bot
8d2feeb89e chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 19:05:52 +00:00
Crowdin Bot
576b399768 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 18:06:23 +00:00
Crowdin Bot
eb8ce85872 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 15:04:56 +00:00
Justin Domingue
1644e4f9c6 fix(a11y): color contrast changes (#1803)
* fix: a11y changes

* more a11y fixes

* updated theme colors

* addressed rev4 comments

* address rev5 comments

* addressed rev6
2021-06-15 07:55:38 -07:00
Yuta Sugimura
574fab54d1 fix: props for ResponsiveButtonPrimary (#1839)
* fix: props for ResponsiveButtonPrimary

* fix ResponsiveButtonPrimary style
2021-06-15 07:55:11 -07:00
Crowdin Bot
8e581c19ff chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 09:05:09 +00:00
Crowdin Bot
8c2fa89e9e chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 08:05:05 +00:00
Crowdin Bot
0ae7452eca chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 07:07:02 +00:00
Crowdin Bot
4589beb789 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 06:04:49 +00:00
Crowdin Bot
55aee86971 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 04:04:55 +00:00
Crowdin Bot
a457af91b6 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 03:07:51 +00:00
Crowdin Bot
e61b5da3c5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-15 00:08:26 +00:00
Crowdin Bot
b4f44744c1 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 23:05:29 +00:00
Crowdin Bot
27f4e2e750 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 22:04:51 +00:00
Crowdin Bot
01159c53d5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 21:04:56 +00:00
Crowdin Bot
8d8d63b873 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 20:05:10 +00:00
Crowdin Bot
da9db4b5f1 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 18:04:48 +00:00
Justin Domingue
1724bee0f5 Update useSwapCallback.ts 2021-06-14 10:24:33 -07:00
Crowdin Bot
48e526554b chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 17:14:33 +00:00
Crowdin Bot
53add345de chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 16:05:45 +00:00
Crowdin Bot
e28faf0da2 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 13:12:25 +00:00
Crowdin Bot
f79dc5fe82 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 12:04:53 +00:00
Crowdin Bot
a6f29cbff8 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 11:04:51 +00:00
Crowdin Bot
68f0d4b725 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 10:04:57 +00:00
Crowdin Bot
111e7dc929 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 09:04:55 +00:00
Crowdin Bot
39d61e4913 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 08:07:59 +00:00
Crowdin Bot
3e6d3ec1b5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 07:07:26 +00:00
Crowdin Bot
3f65530bf4 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 06:04:48 +00:00
Crowdin Bot
dba0d20781 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 05:07:28 +00:00
Crowdin Bot
a0f3bd0dc6 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 04:04:52 +00:00
Crowdin Bot
bef85abfd4 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 03:06:19 +00:00
Crowdin Bot
9934dba805 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 02:21:00 +00:00
Crowdin Bot
72d94b2831 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 01:28:24 +00:00
Crowdin Bot
138697a30a chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-14 00:10:25 +00:00
Crowdin Bot
0add8ae177 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 22:04:40 +00:00
Crowdin Bot
13f7859aaa chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 21:04:46 +00:00
Crowdin Bot
3337b5de22 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 20:04:51 +00:00
Noah Zinsmeister
55ea6616a4 Merge remote-tracking branch 'refs/remotes/origin/main' 2021-06-13 15:15:07 -04:00
Noah Zinsmeister
5dd1249ddd feat: quick fix for new governor 2021-06-13 15:15:00 -04:00
Crowdin Bot
4ab2bd3474 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 19:06:13 +00:00
Crowdin Bot
9eb20624cb chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 18:05:07 +00:00
Crowdin Bot
25c5cf04e6 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 17:13:27 +00:00
Crowdin Bot
1f70e63cd0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 16:08:49 +00:00
Crowdin Bot
df88b0ddd1 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 15:05:26 +00:00
Crowdin Bot
679759c3a0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 14:05:00 +00:00
Crowdin Bot
9b6003bdc5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 13:12:31 +00:00
Crowdin Bot
2b32824c26 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 12:09:45 +00:00
Crowdin Bot
a4e4cf8ab9 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 11:04:48 +00:00
Crowdin Bot
f08cea1820 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 10:04:50 +00:00
Crowdin Bot
e2d35c56fc chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 09:05:04 +00:00
Crowdin Bot
5f20040107 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 07:06:32 +00:00
Crowdin Bot
9344abd1cf chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 06:05:04 +00:00
Crowdin Bot
426e31230d chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 05:06:53 +00:00
Crowdin Bot
06c48559c5 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 04:05:34 +00:00
Crowdin Bot
0a33ed1a50 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 03:05:54 +00:00
Crowdin Bot
d5c490b871 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 02:19:46 +00:00
Crowdin Bot
099c2adea3 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 01:28:37 +00:00
Crowdin Bot
d387538576 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-13 00:10:49 +00:00
Crowdin Bot
a3a7d01ce9 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 23:05:25 +00:00
Crowdin Bot
549e67bcea chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 22:09:06 +00:00
Crowdin Bot
932992b57f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 21:04:46 +00:00
Crowdin Bot
76a24376d4 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 20:08:09 +00:00
Crowdin Bot
f873b2249f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 19:08:33 +00:00
Crowdin Bot
22452c03b0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 18:05:07 +00:00
Crowdin Bot
14e045b999 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 17:13:55 +00:00
Crowdin Bot
948781f927 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 16:05:42 +00:00
Crowdin Bot
2f72d6b77e chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 15:06:47 +00:00
Crowdin Bot
a78209690d chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 14:04:39 +00:00
Crowdin Bot
98a2f51125 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 13:10:38 +00:00
Crowdin Bot
a1043573af chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 12:07:02 +00:00
Crowdin Bot
63760faa9d chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 11:04:39 +00:00
Crowdin Bot
0566ec28be chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 10:04:55 +00:00
Crowdin Bot
d4c1baba57 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 09:04:49 +00:00
Crowdin Bot
7e41b27cd3 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 08:05:55 +00:00
Crowdin Bot
1d18a5159f chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 07:06:40 +00:00
Crowdin Bot
bb87d2dd03 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 06:04:58 +00:00
Crowdin Bot
0b27528a6a chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 05:06:33 +00:00
Crowdin Bot
5788a273ba chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 04:09:51 +00:00
Crowdin Bot
4d322b17da chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-12 03:09:09 +00:00
Crowdin Bot
cb5b80b558 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-11 16:05:43 +00:00
Crowdin Bot
6964b519bc chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-11 11:04:45 +00:00
Crowdin Bot
ee4ea2a1f0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-11 10:05:12 +00:00
Crowdin Bot
3763ad15e0 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 18:14:56 +00:00
Justin Domingue
557042a88f add missing translations (#1842) 2021-06-10 10:42:07 -07:00
Crowdin Bot
860413dd52 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 17:21:32 +00:00
Crowdin Bot
18d4cdcce4 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 14:05:54 +00:00
Crowdin Bot
55767de484 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 13:15:24 +00:00
Yuta Sugimura
60d5cef69b fix: untranslated parts (#1837) 2021-06-10 07:49:03 -05:00
yj
ad2833a3ed Translate both text in PositionPage.tsx (#1838) 2021-06-10 07:47:59 -05:00
Crowdin Bot
e4a105714a chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 12:05:11 +00:00
Crowdin Bot
3e842d3259 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 10:05:04 +00:00
Crowdin Bot
e9d18acd41 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-10 00:10:42 +00:00
Moody Salem
abeba3d6b6 fix: translate both prices in the rate toggle
fixes https://github.com/Uniswap/uniswap-interface/issues/1834
2021-06-09 18:06:42 -05:00
Moody Salem
84c4219c02 fix: proposals not showing up on first load of vote page 2021-06-09 18:04:59 -05:00
Crowdin Bot
50b81c8334 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-09 19:14:47 +00:00
Crowdin Bot
8986b63335 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-09 18:15:03 +00:00
Crowdin Bot
631b4c08b6 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-09 17:20:45 +00:00
Crowdin Bot
b92f0b8d90 chore(i18n): synchronize translations from crowdin [skip ci] 2021-06-09 08:05:19 +00:00
Moody Salem
ce926e91b7 chore(ci): skip ci on crowdin syncs 2021-06-08 19:29:57 -05:00
Justin Domingue
4857281a1e undo testing artifact 2021-06-08 11:49:38 -07:00
Crowdin Bot
d2a872e7d2 chore(i18n): synchronize translations from crowdin 2021-06-08 14:09:11 +00:00
Crowdin Bot
73042f20fd chore(i18n): synchronize translations from crowdin 2021-06-08 13:16:53 +00:00
Crowdin Bot
29b5e583c5 chore(i18n): synchronize translations from crowdin 2021-06-08 12:05:11 +00:00
Crowdin Bot
d67f3158bd chore(i18n): synchronize translations from crowdin 2021-06-08 11:07:08 +00:00
Crowdin Bot
817732d62e chore(i18n): synchronize translations from crowdin 2021-06-08 09:05:31 +00:00
Crowdin Bot
562a54a175 chore(i18n): synchronize translations from crowdin 2021-06-08 08:06:38 +00:00
Crowdin Bot
cd1e0cf378 chore(i18n): synchronize translations from crowdin 2021-06-08 06:12:39 +00:00
Crowdin Bot
0c81b08d66 chore(i18n): synchronize translations from crowdin 2021-06-08 04:21:20 +00:00
Crowdin Bot
2662f8afbc chore(i18n): synchronize translations from crowdin 2021-06-08 02:38:00 +00:00
Moody Salem
355012eec9 fix: set polling interval back to 15 seconds 2021-06-07 17:52:49 -05:00
Noah Zinsmeister
68518d7ce0 fix[migrate]: use proper slippage check (#1821) 2021-06-07 15:01:30 -04:00
Crowdin Bot
2c9c99b868 chore(i18n): synchronize translations from crowdin 2021-06-07 18:48:52 +00:00
ChristophSiegenthaler
7b78dfa2c4 Fix typo (#1815)
Co-authored-by: ChristophSiegenthaler <csi@gmx.ch>
2021-06-07 11:07:16 -07:00
Crowdin Bot
e6cbab3c72 chore(i18n): synchronize translations from crowdin 2021-06-07 16:21:50 +00:00
Crowdin Bot
144f86bdfd chore(i18n): synchronize translations from crowdin 2021-06-06 01:33:53 +00:00
Crowdin Bot
6703743aef chore(i18n): synchronize translations from crowdin 2021-06-06 00:16:18 +00:00
Crowdin Bot
0320083909 chore(i18n): synchronize translations from crowdin 2021-06-05 22:08:28 +00:00
Crowdin Bot
b96f7d27ca chore(i18n): synchronize translations from crowdin 2021-06-05 21:08:45 +00:00
Crowdin Bot
45e85bc857 chore(i18n): synchronize translations from crowdin 2021-06-05 20:11:50 +00:00
Crowdin Bot
24e1a01b1a chore(i18n): synchronize translations from crowdin 2021-06-05 19:24:25 +00:00
Crowdin Bot
0e7a94313c chore(i18n): synchronize translations from crowdin 2021-06-05 18:31:11 +00:00
Crowdin Bot
35e80fa3ed chore(i18n): synchronize translations from crowdin 2021-06-05 17:29:29 +00:00
Crowdin Bot
4a70d8eb28 chore(i18n): synchronize translations from crowdin 2021-06-05 16:14:07 +00:00
Moody Salem
706d8724c1 README.md already at the top! 2021-06-05 09:47:18 -05:00
Moody Salem
6e363c1ff1 make _README.md into a symlink 2021-06-05 09:46:49 -05:00
Crowdin Bot
27007708ec chore(i18n): synchronize translations from crowdin 2021-06-04 20:28:49 +00:00
Crowdin Bot
c4739ea963 chore(i18n): synchronize translations from crowdin 2021-06-04 18:41:01 +00:00
Justin Domingue
50954eff0f Create _README.md 2021-06-04 11:14:15 -07:00
Crowdin Bot
af112765e4 chore(i18n): synchronize translations from crowdin 2021-06-04 14:32:59 +00:00
Crowdin Bot
52b71004d0 chore(i18n): synchronize translations from crowdin 2021-06-04 13:29:48 +00:00
Crowdin Bot
2ba7c857cd chore(i18n): synchronize translations from crowdin 2021-06-04 12:26:58 +00:00
Crowdin Bot
67f3b40671 chore(i18n): synchronize translations from crowdin 2021-06-04 05:34:23 +00:00
Crowdin Bot
c2acf5c1a8 chore(i18n): synchronize translations from crowdin 2021-06-04 02:49:43 +00:00
Crowdin Bot
51cf8aa0da chore(i18n): synchronize translations from crowdin 2021-06-04 01:34:22 +00:00
Crowdin Bot
bc0e578610 chore(i18n): synchronize translations from crowdin 2021-06-03 21:28:59 +00:00
Crowdin Bot
1b13cac0fb chore(i18n): synchronize translations from crowdin 2021-06-03 20:33:14 +00:00
Crowdin Bot
14ed4dbb2e chore(i18n): synchronize translations from crowdin 2021-06-03 11:25:20 +00:00
Crowdin Bot
dc140901b3 chore(i18n): synchronize translations from crowdin 2021-06-03 07:33:57 +00:00
Crowdin Bot
07a92ba63b chore(i18n): synchronize translations from crowdin 2021-06-03 06:36:08 +00:00
Crowdin Bot
3f2f46df43 chore(i18n): synchronize translations from crowdin 2021-06-03 05:39:54 +00:00
Crowdin Bot
2dc5c0d386 chore(i18n): synchronize translations from crowdin 2021-06-03 04:58:53 +00:00
Crowdin Bot
38de86f4c9 chore(i18n): synchronize translations from crowdin 2021-06-03 03:01:20 +00:00
Crowdin Bot
b2196e7e48 chore(i18n): synchronize translations from crowdin 2021-06-03 00:24:19 +00:00
Crowdin Bot
30f66f7062 chore(i18n): synchronize translations from crowdin 2021-06-02 23:21:59 +00:00
Justin Domingue
b87430277a support plurals (#1798) 2021-06-02 16:01:16 -07:00
Moody Salem
b4c59cfc6e chore: fix the double translation of 'For'
fixes https://github.com/Uniswap/uniswap-interface/issues/1800
2021-06-02 17:51:54 -05:00
Moody Salem
2326dfa108 chore: remove the lang attribute as well 2021-06-02 17:25:41 -05:00
Crowdin Bot
97bf36efbf chore(i18n): synchronize translations from crowdin 2021-06-02 21:32:30 +00:00
Justin Domingue
264acaae48 Update CONTRIBUTING.md 2021-06-02 14:16:11 -07:00
Crowdin Bot
63e9f6e4d2 chore(i18n): synchronize translations from crowdin 2021-06-02 20:50:26 +00:00
Moody Salem
02d80e07dc refactor(L2): Arbitrum Kovan testnet and Arbitrum One support (#1716)
* experimental! point at a kovan arbitrum deployment

* remove the unwrapped token from mint hook

* fix explorer links

* Etherscan -> Explorer

* move chains to constant file

* use NETWORK_URLS instead

* temporary fix to the syncing issue

* fix tests

* fix unknown chain id crash

* use a multicall that returns arbitrum block numbers

* lower polling interval for layer 2

* use a better multicall

* remove unused import

* fixed multicall2

* make some v2 code chain specific

* fix build

* line number changes

* update keys

* fix the locale parsing of full locale string

* extract

* fix lint

* add arbitrum one

* add arbitrum one to supported chains

* add missing arbitrum one label

* refactor: remove storybook

* point to the arbitrum explorer address

* fix arbitrum mainnet links

* fix how weth shows up in the interface

* make the usdc price feature more cross chain compatible

* missing translation

* clean up some governance code so it doesn't crash on unsupported networks

* improve how we check for transaction receipts for sequencer networks

* improve it a bit more
2021-06-02 15:14:34 -05:00
Crowdin Bot
ad53da5efe chore(i18n): synchronize translations from crowdin 2021-06-02 19:58:27 +00:00
Crowdin Bot
29223ce34f chore(i18n): synchronize translations from crowdin 2021-06-02 18:58:14 +00:00
Crowdin Bot
b88919ed69 chore(i18n): synchronize translations from crowdin 2021-06-02 17:34:57 +00:00
Ian Lapham
ab80910553 fix: add pool find button to v2 pool page (#1700)
* add pool find button to v2 pool page

* update copy to be v2 specific

* fixed migrate v2 liquidity back arrow

* add missing <Trans>

Co-authored-by: Justin Domingue <judo@uniswap.org>
2021-06-02 10:08:45 -07:00
Crowdin Bot
1cdb8aa6a4 chore(i18n): synchronize translations from crowdin 2021-06-02 16:27:43 +00:00
Crowdin Bot
88976d0294 chore(i18n): synchronize translations from crowdin 2021-06-02 15:21:20 +00:00
Crowdin Bot
b908c81e2b chore(i18n): synchronize translations from crowdin 2021-06-02 14:34:38 +00:00
Crowdin Bot
5c20d0adb7 chore(i18n): synchronize translations from crowdin 2021-06-02 09:35:14 +00:00
Crowdin Bot
ca6295fcb7 chore(i18n): synchronize translations from crowdin 2021-06-02 07:35:26 +00:00
Crowdin Bot
e8af59198d chore(i18n): synchronize translations from crowdin 2021-06-02 06:49:31 +00:00
Crowdin Bot
cd4c43b482 chore(i18n): synchronize translations from crowdin 2021-06-02 05:07:18 +00:00
jab416171
c1e07f3713 Fixing some instances of the removeChild issue (#1793)
specifically when the google translate extension triggers it
2021-06-01 20:39:53 -07:00
Crowdin Bot
bccda20473 chore(i18n): synchronize translations from crowdin 2021-06-02 03:03:17 +00:00
Moody Salem
bed8dd5110 fix: do not show price data on non-mainnet 2021-06-01 17:33:50 -05:00
Moody Salem
6bcbabec23 refactor: remove storybook 2021-06-01 17:04:26 -05:00
Justin Domingue
71a490f2aa fix(#1694): fix popup item header overlap (#1783) 2021-06-01 14:30:08 -07:00
Moody Salem
abcf1f5a5c fix: background should show up while loading the js 2021-06-01 16:20:31 -05:00
Crowdin Bot
65e5e9c98e chore(i18n): synchronize translations from crowdin 2021-06-01 20:55:07 +00:00
Moody Salem
fdabb90f0e fix: fire a GA event when the locale is switched 2021-06-01 15:31:15 -05:00
230 changed files with 17040 additions and 11527 deletions

2
.env
View File

@@ -1,4 +1,2 @@
REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847"
REACT_APP_WALLETCONNECT_BRIDGE_URL="https://uniswap.bridge.walletconnect.org"
# Because we use storybook which has its own babel-loader dependency @ 8.2.2, where react-scripts uses 8.1.0
SKIP_PREFLIGHT_CHECK=true

View File

@@ -27,6 +27,7 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/react-in-jsx-scope": "off"
}
}

View File

@@ -52,6 +52,6 @@ jobs:
translation: 'src/locales/%locale%.po'
create_pull_request: false
localization_branch_name: main
commit_message: "chore(i18n): synchronize translations from crowdin"
commit_message: "chore(i18n): synchronize translations from crowdin [skip ci]"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -46,5 +46,6 @@ jobs:
- run: yarn integration-test
env:
CYPRESS_INTEGRATION_TEST_PRIVATE_KEY: ${{ secrets.CYPRESS_INTEGRATION_TEST_PRIVATE_KEY }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

3
.gitignore vendored
View File

@@ -7,6 +7,7 @@
/src/locales/**/*.ts
/src/locales/**/*.json
/src/locales/**/en-US.po
/src/state/data/generated.ts
# dependencies
/node_modules
@@ -39,4 +40,4 @@ package-lock.json
cypress/videos
cypress/screenshots
cypress/fixtures/example.json
cypress/fixtures/example.json

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
/src/state/data/generated.ts

View File

@@ -1,16 +0,0 @@
const { dirname, join, parse, resolve } = require('path')
const { existsSync } = require('fs')
module.exports = {
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'],
typescript: {
check: true,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
}

View File

@@ -1,4 +0,0 @@
import { addons } from '@storybook/addons'
import { light } from './theme'
addons.setConfig({ theme: light })

View File

@@ -1,90 +0,0 @@
import '../src/index.css'
import { Story } from '@storybook/react/types-6-0'
import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
import React from 'react'
import { Provider as StoreProvider } from 'react-redux'
import { ThemeProvider as SCThemeProvider } from 'styled-components'
import { NetworkContextName } from '../src/constants/misc'
import store from '../src/state'
import { theme, ThemedGlobalStyle } from '../src/theme'
import getLibrary from '../src/utils/getLibrary'
import * as storybookThemes from './theme'
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
dependencies: {
withStoriesOnly: true,
hideEmpty: true,
},
docs: {
theme: storybookThemes.light,
},
viewport: {
viewports: {
mobile: {
name: 'iPhone X',
styles: {
width: '375px',
height: '812px',
},
},
tablet: {
name: 'iPad',
styles: {
width: '768px',
height: '1024px',
},
},
laptop: {
name: 'Laptop',
styles: {
width: '1024px',
height: '768px',
},
},
desktop: {
name: 'Desktop',
styles: {
width: '1440px',
height: '1024px',
},
},
},
},
}
export const globalTypes = {
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'light',
toolbar: {
icon: 'circlehollow',
items: ['light', 'dark'],
},
},
}
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
const withProviders = (Component: Story, context: Record<string, any>) => {
const THEME = theme(context.globals.theme === 'dark')
return (
<>
<Web3ReactProvider getLibrary={getLibrary}>
<Web3ProviderNetwork getLibrary={getLibrary}>
<StoreProvider store={store}>
<SCThemeProvider theme={THEME}>
<ThemedGlobalStyle />
<main>
<Component />
</main>
</SCThemeProvider>
</StoreProvider>
</Web3ProviderNetwork>
</Web3ReactProvider>
</>
)
}
export const decorators = [withProviders]

View File

@@ -1,17 +0,0 @@
import { create } from '@storybook/theming'
// this themes the storybook UI
const uniswapBaseTheme = {
brandTitle: 'Uniswap Design',
brandUrl: 'https://uniswap.org',
brandImage: 'https://ipfs.io/ipfs/QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir',
}
export const light = create({
base: 'light',
...uniswapBaseTheme,
})
// export const dark = create({
// base: 'dark',
// ...uniswapBaseTheme,
// })

View File

@@ -6,6 +6,12 @@
yarn install
```
## Generate locale files
```
yarn i18n:extract
```
## Run the interface
```bash

View File

@@ -28,7 +28,7 @@ or visit [app.uniswap.org](https://app.uniswap.org).
## Contributions
See [CONTRIBUTING](./CONTRIBUTING.md).
For steps on local deployment, development, and code contribution, please see [CONTRIBUTING](./CONTRIBUTING.md).
## Accessing Uniswap V2

10
codegen.yml Normal file
View File

@@ -0,0 +1,10 @@
schema: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3'
documents: 'src/**/!(*.d).{ts,tsx}'
generates:
./src/state/data/generated.ts:
plugins:
- typescript
- typescript-operations
- typescript-rtk-query:
importBaseApiFrom: './slice'
exportHooks: true

View File

@@ -1,4 +1,5 @@
{
"projectId": "yp82ef",
"baseUrl": "http://localhost:3000",
"pluginsFile": false,
"fixturesFolder": false,

View File

@@ -4,6 +4,7 @@ describe('Landing Page', () => {
beforeEach(() => cy.visit('/'))
it('loads swap page', () => {
cy.get('#swap-page')
cy.screenshot()
})
it('redirects to url /swap', () => {

View File

@@ -8,7 +8,9 @@ import { JsonRpcProvider } from '@ethersproject/providers'
import { Wallet } from '@ethersproject/wallet'
import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY')
// todo: figure out how env vars actually work in CI
// const TEST_PRIVATE_KEY = Cypress.env('INTEGRATION_TEST_PRIVATE_KEY')
const TEST_PRIVATE_KEY = '0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e770523b4666d19'
// address of the above key
export const TEST_ADDRESS_NEVER_USE = new Wallet(TEST_PRIVATE_KEY).address

View File

@@ -5,6 +5,10 @@
"private": true,
"devDependencies": {
"@ethersproject/experimental": "^5.2.0",
"@graphql-codegen/cli": "1.21.5",
"@graphql-codegen/typescript": "1.22.3",
"@graphql-codegen/typescript-operations": "^1.18.2",
"@graphql-codegen/typescript-rtk-query": "^1.1.1",
"@lingui/cli": "^3.9.0",
"@lingui/loader": "^3.9.0",
"@lingui/macro": "^3.9.0",
@@ -14,17 +18,8 @@
"@reach/dialog": "^0.10.3",
"@reach/portal": "^0.10.3",
"@react-hook/window-scroll": "^1.3.0",
"@reduxjs/toolkit": "^1.3.5",
"@storybook/addon-actions": "^6.1.17",
"@storybook/addon-essentials": "^6.1.17",
"@storybook/addon-links": "^6.1.17",
"@storybook/addons": "^6.1.17",
"@storybook/components": "^6.1.17",
"@storybook/preset-create-react-app": "^3.1.5",
"@storybook/preset-typescript": "^3.0.0",
"@storybook/react": "^6.1.17",
"@storybook/theming": "^6.1.17",
"@styled-system/css": "^5.1.5",
"@reduxjs/toolkit": "^1.6.0",
"@rtk-query/graphql-request-base-query": "^1.0.3",
"@typechain/ethers-v5": "^7.0.0",
"@types/jest": "^25.2.1",
"@types/lingui__core": "^2.7.1",
@@ -76,6 +71,8 @@
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.0.0",
"ethers": "^5.2.0",
"graphql": "^15.5.0",
"graphql-request": "^3.4.0",
"inter-ui": "^3.13.1",
"lightweight-charts": "^3.3.0",
"lodash.flatmap": "^4.5.0",
@@ -102,6 +99,7 @@
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "^1.8.5",
"rebass": "^4.0.7",
"redux-devtools-extension": "^2.13.9",
"redux-localstorage-simple": "^2.3.1",
"serve": "^11.3.2",
"start-server-and-test": "^1.11.0",
@@ -125,14 +123,15 @@
"compile-contract-types": "yarn compile-external-abi-types && yarn compile-v3-contract-types",
"compile-external-abi-types": "typechain --target ethers-v5 --out-dir src/abis/types './src/abis/**/*.json'",
"compile-v3-contract-types": "typechain --target ethers-v5 --out-dir src/types/v3 './node_modules/@uniswap/?(v3-core|v3-periphery)/artifacts/contracts/**/*.json'",
"build": "yarn compile-contract-types && yarn i18n:extract && yarn i18n:compile && react-scripts build",
"build": "yarn compile-contract-types && yarn graphql:generate && yarn i18n:extract && yarn i18n:compile && react-scripts build",
"i18n:extract": "lingui extract --locale en-US",
"i18n:compile": "lingui compile",
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'",
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'",
"graphql:generate": "graphql-codegen --config codegen.yml",
"postinstall": "yarn compile-contract-types",
"start": "yarn compile-contract-types && react-scripts start",
"storybook": "start-storybook -p 6006",
"test": "react-scripts test --env=jsdom"
"test": "react-scripts test --env=jsdom",
"prestart": "yarn graphql:generate && touch src/locales/en-US.po"
},
"eslintConfig": {
"extends": "react-app",

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html translate="no">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" type="image/png" href="%PUBLIC_URL%/favicon.png" />
@@ -24,6 +24,66 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<style>
* {
font-family: 'Inter', sans-serif;
box-sizing: border-box;
}
@supports (font-variation-settings: normal) {
* {
font-family: 'Inter var', sans-serif;
}
}
html,
body {
margin: 0;
padding: 0;
}
button {
user-select: none;
}
html {
font-size: 16px;
font-variant: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
font-feature-settings: 'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on;
}
#background-radial-gradient {
position: fixed;
top: 0;
left: 0;
right: 0;
pointer-events: none;
width: 200vw;
height: 200vh;
background: radial-gradient(50% 50% at 50% 50%, #fc077d10 0%, rgba(255, 255, 255, 0) 100%);
transform: translate(-50vw, -100vh);
z-index: -1;
}
html {
min-height: 100%;
}
@media (prefers-color-scheme: dark) {
html {
background-color: #212429;
}
}
@media (prefers-color-scheme: light) {
html {
background-color: #F7F8FA;
}
}
</style>
<title>Uniswap Interface</title>
</head>
<body>

View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 470.287 514.251" enable-background="new 0 0 470.287 514.251" xml:space="preserve">
<g id="Background">
</g>
<g id="Logos_and_symbols">
<g id="SYMBOL_VER_3">
</g>
<g id="SYMBOL_VER_3_3_">
</g>
<g id="SYMBOL_VER_4">
</g>
<g id="SYMBOL_VER_4_1_">
<g id="SYMBOL_VER_4_3_">
</g>
</g>
<g id="SYMBOL_VER_5_1_">
</g>
<g id="off_2_1_">
</g>
<g id="VER_3_1_">
<g id="SYMBOL_VER_2_1_">
</g>
</g>
<g id="VER_3">
<g id="SYMBOL_VER_2">
</g>
</g>
<g id="off_2">
</g>
<g id="SYMBOL_VER_5">
</g>
<g id="SYMBOL_VER_1">
</g>
<g id="SYMBOL_VER_1_1_">
</g>
<g id="SYMBOL_VER_1-1_3_">
</g>
<g id="SYMBOL_VER_1-1_2_">
</g>
<g id="SYMBOL_VER_1-1">
</g>
<g id="SYMBOL_VER_1-1_1_">
<g id="_x31_-3">
</g>
<g id="Symbol_-_Original_14_">
<path fill="#2D374B" d="M291.134,237.469l35.654-60.5l96.103,149.684l0.046,28.727l-0.313-197.672
c-0.228-4.832-2.794-9.252-6.887-11.859L242.715,46.324c-4.045-1.99-9.18-1.967-13.22,0.063c-0.546,0.272-1.06,0.57-1.548,0.895
l-0.604,0.379L59.399,144.983l-0.651,0.296c-0.838,0.385-1.686,0.875-2.48,1.444c-3.185,2.283-5.299,5.66-5.983,9.448
c-0.103,0.574-0.179,1.158-0.214,1.749l0.264,161.083l89.515-138.745c11.271-18.397,35.825-24.323,58.62-24.001l26.753,0.706
L67.588,409.765l18.582,10.697L245.692,157.22l70.51-0.256L157.091,426.849l66.306,38.138l7.922,4.556
c3.351,1.362,7.302,1.431,10.681,0.21l175.453-101.678l-33.544,19.438L291.134,237.469z M304.736,433.395l-66.969-105.108
l40.881-69.371l87.952,138.628L304.736,433.395z"/>
<polygon fill="#28A0F0" points="237.768,328.286 304.736,433.395 366.601,397.543 278.648,258.915 "/>
<path fill="#28A0F0" d="M422.937,355.379l-0.046-28.727l-96.103-149.684l-35.654,60.5l92.774,150.043l33.544-19.438
c3.29-2.673,5.281-6.594,5.49-10.825L422.937,355.379z"/>
<path fill="#FFFFFF" d="M20.219,382.469l47.369,27.296l157.634-252.801l-26.753-0.706c-22.795-0.322-47.35,5.604-58.62,24.001
L50.334,319.004l-30.115,46.271V382.469z"/>
<polygon fill="#FFFFFF" points="316.202,156.964 245.692,157.22 86.17,420.462 141.928,452.565 157.091,426.849 "/>
<path fill="#96BEDC" d="M452.65,156.601c-0.59-14.746-8.574-28.245-21.08-36.104L256.28,19.692
c-12.371-6.229-27.825-6.237-40.218-0.004c-1.465,0.739-170.465,98.752-170.465,98.752c-2.339,1.122-4.592,2.458-6.711,3.975
c-11.164,8.001-17.969,20.435-18.668,34.095v208.765l30.115-46.271L50.07,157.921c0.035-0.589,0.109-1.169,0.214-1.741
c0.681-3.79,2.797-7.171,5.983-9.456c0.795-0.569,172.682-100.064,173.228-100.337c4.04-2.029,9.175-2.053,13.22-0.063
l173.022,99.523c4.093,2.607,6.659,7.027,6.887,11.859v199.542c-0.209,4.231-1.882,8.152-5.172,10.825l-33.544,19.438
l-17.308,10.031l-61.864,35.852l-62.737,36.357c-3.379,1.221-7.33,1.152-10.681-0.21l-74.228-42.693l-15.163,25.717
l66.706,38.406c2.206,1.255,4.171,2.367,5.784,3.272c2.497,1.4,4.199,2.337,4.8,2.629c4.741,2.303,11.563,3.643,17.71,3.643
c5.636,0,11.132-1.035,16.332-3.072l182.225-105.531c10.459-8.104,16.612-20.325,17.166-33.564V156.601z"/>
</g>
<g id="Symbol_-_Original_13_">
</g>
<g id="Symbol_-_Original_6_">
</g>
<g id="Symbol_-_Original_4_">
</g>
<g id="One_color_version_-_White_3_">
<g id="Symbol_-_Original_15_">
</g>
</g>
<g id="One_color_version_-_White">
<g id="Symbol_-_Original">
</g>
</g>
<g id="Symbol_-_Monochromatic_3_">
<g id="_x33__7_">
</g>
</g>
<g id="Symbol_-_Monochromatic">
<g id="_x33__3_">
</g>
</g>
<g id="_x33__2_">
</g>
<g id="_x33__1_">
</g>
<g id="_x33_">
</g>
<g id="Symbol_-_Original_10_">
</g>
<g id="Symbol_-_Original_1_">
</g>
<g id="Symbol_-_Original_2_">
</g>
<g id="_x34__1_">
</g>
<g id="Symbol_-_Monochromatic_2_">
<g id="_x33__6_">
</g>
</g>
<g id="One_color_version_-_White_2_">
<g id="Symbol_-_Original_11_">
</g>
</g>
<g id="Symbol_-_Original_5_">
<g id="Symbol_-_Original_12_">
</g>
</g>
<g id="One_color_version_-_White_1_">
<g id="Symbol_-_Original_9_">
</g>
</g>
</g>
<g id="SYMBOL_VER_1_2_">
<g id="SYMBOL_VER_2_4_">
</g>
<g id="SYMBOL_VER_2-1-1_1_">
</g>
<g id="SYMBOL_VER_2-2-1_1_">
</g>
<g id="SYMBOL_VER_2-3-1_4_">
</g>
<g id="New_Symbol_1_">
<g id="SYMBOL_VER_2-3-1_3_">
</g>
</g>
<g id="New_Symbol">
<g id="SYMBOL_VER_2-3-1_1_">
</g>
</g>
</g>
<g id="SYMBOL_VER_2_2_">
</g>
<g id="SYMBOL_VER_4_2_">
</g>
<g id="SYMBOL_VER_3_2_">
</g>
<g id="SYMBOL_VER_3_1_">
</g>
<g id="SYMBOL_VER_1-1-1_1_">
</g>
<g id="SYMBOL_VER_1-1-1">
</g>
<g id="SYMBOL_VER_1-1-1_2_2_">
</g>
<g id="SYMBOL_VER_1-1-1_2">
</g>
<g id="SYMBOL_VER_1-1-1_2_1_">
</g>
<g id="Symbol_-_Original_7_">
</g>
<g id="Symbol_-_Original_8_">
</g>
<g id="SYMBOL_VER_2-1-1">
</g>
<g id="SYMBOL_VER_2-2-1">
</g>
<g id="SYMBOL_VER_2-3-1">
</g>
<g id="SYMBOL_VER_5-1_1_">
</g>
<g id="SYMBOL_VER_5-1">
</g>
<g id="SYMBOL_VER_5-2_1_">
</g>
<g id="SYMBOL_VER_5-2">
</g>
<g id="Symbol_-_Monochromatic_1_">
<g id="_x33__4_">
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 250 KiB

View File

@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components/macro'
import { CheckCircle, Triangle } from 'react-feather'

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useContext } from 'react'
import { useCallback, useContext } from 'react'
import styled, { ThemeContext } from 'styled-components'
import { SUPPORTED_WALLETS } from '../../constants/wallet'
import { useActiveWeb3React } from '../../hooks/web3'
@@ -366,7 +366,7 @@ export default function AccountDetails({
>
<LinkIcon size={16} />
<span style={{ marginLeft: '4px' }}>
<Trans>View on Etherscan</Trans>
<Trans>View on Explorer</Trans>
</span>
</AddressLink>
)}
@@ -392,7 +392,7 @@ export default function AccountDetails({
>
<LinkIcon size={16} />
<span style={{ marginLeft: '4px' }}>
<Trans>View on Etherscan</Trans>
<Trans>View on Explorer</Trans>
</span>
</AddressLink>
)}

View File

@@ -1,4 +1,5 @@
import React, { useContext, useCallback } from 'react'
import { t, Trans } from '@lingui/macro'
import { useContext, useCallback, ReactNode } from 'react'
import styled, { ThemeContext } from 'styled-components'
import useENS from '../../hooks/useENS'
import { useActiveWeb3React } from '../../hooks/web3'
@@ -40,7 +41,7 @@ const Input = styled.input<{ error?: boolean }>`
width: 0;
background-color: ${({ theme }) => theme.bg1};
transition: color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')};
color: ${({ error, theme }) => (error ? theme.red1 : theme.primary1)};
color: ${({ error, theme }) => (error ? theme.red1 : theme.text1)};
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
@@ -67,10 +68,16 @@ const Input = styled.input<{ error?: boolean }>`
export default function AddressInputPanel({
id,
className = 'recipient-address-input',
label,
placeholder,
value,
onChange,
}: {
id?: string
className?: string
label?: ReactNode
placeholder?: string
// the typed string value
value: string
// triggers whenever the typed value changes
@@ -99,25 +106,25 @@ export default function AddressInputPanel({
<AutoColumn gap="md">
<RowBetween>
<TYPE.black color={theme.text2} fontWeight={500} fontSize={14}>
Recipient
{label ?? <Trans>Recipient</Trans>}
</TYPE.black>
{address && chainId && (
<ExternalLink
href={getExplorerLink(chainId, name ?? address, ExplorerDataType.ADDRESS)}
style={{ fontSize: '14px' }}
>
(View on Etherscan)
<Trans>(View on Explorer)</Trans>
</ExternalLink>
)}
</RowBetween>
<Input
className="recipient-address-input"
className={className}
type="text"
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
placeholder="Wallet Address or ENS name"
placeholder={placeholder ?? t`Wallet Address or ENS name`}
error={error}
pattern="^(0x[a-fA-F0-9]{40})$"
onChange={handleInput}

View File

@@ -1,44 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import React, { PropsWithChildren } from 'react'
import Component, { BadgeProps, BadgeVariant } from './index'
export default {
title: 'Badge',
argTypes: {
variant: {
name: 'variant',
type: { name: 'string', require: false },
defaultValue: BadgeVariant.DEFAULT,
description: 'badge variant',
control: {
type: 'select',
options: Object.values(BadgeVariant),
},
},
},
args: {
children: '🦄 UNISWAP 🦄',
},
}
const Template: Story<PropsWithChildren<BadgeProps>> = (args) => <Component {...args}>{args.children}</Component>
export const DefaultBadge = Template.bind({})
DefaultBadge.args = {
variant: BadgeVariant.DEFAULT,
}
export const WarningBadge = Template.bind({})
WarningBadge.args = {
variant: BadgeVariant.WARNING,
}
export const NegativeBadge = Template.bind({})
NegativeBadge.args = {
variant: BadgeVariant.NEGATIVE,
}
export const PositiveBadge = Template.bind({})
PositiveBadge.args = {
variant: BadgeVariant.POSITIVE,
}

View File

@@ -1,5 +1,3 @@
import React from 'react'
import Badge, { BadgeVariant } from 'components/Badge'
import styled from 'styled-components/macro'

View File

@@ -1,4 +1,4 @@
import React, { ReactNode, useMemo } from 'react'
import { ReactNode, useMemo } from 'react'
import { useActiveWeb3React } from '../../hooks/web3'
import { Trans } from '@lingui/macro'

View File

@@ -1,153 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import styled from 'styled-components/macro'
import React from 'react'
import {
ButtonConfirmed,
ButtonDropdown,
ButtonDropdownGrey,
ButtonDropdownLight,
ButtonEmpty,
ButtonError,
ButtonGray,
ButtonLight,
ButtonOutlined,
ButtonPink,
ButtonPrimary,
ButtonRadio,
ButtonSecondary,
ButtonUNIGradient,
ButtonWhite,
} from './index'
const wrapperCss = styled.main`
font-size: 2em;
margin: 3em;
max-width: 300px;
`
export default {
title: 'Buttons',
argTypes: {
disabled: { control: { type: 'boolean' } },
onClick: { action: 'clicked' },
},
decorators: [
(Component: Story) => (
<div css={wrapperCss}>
<Component />
</div>
),
],
}
const Unicorn = () => (
<span role="img" aria-label="unicorn">
🦄
</span>
)
export const Radio = () => (
<ButtonRadio>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonRadio>
)
export const DropdownLight = () => (
<ButtonDropdownLight>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonDropdownLight>
)
export const DropdownGrey = () => (
<ButtonDropdownGrey>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonDropdownGrey>
)
export const Dropdown = () => (
<ButtonDropdown>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonDropdown>
)
export const Error = () => (
<ButtonError>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonError>
)
export const Confirmed = () => (
<ButtonConfirmed>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonConfirmed>
)
export const White = () => (
<ButtonWhite>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonWhite>
)
export const Empty = () => (
<ButtonEmpty>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonEmpty>
)
export const Outlined = () => (
<ButtonOutlined>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonOutlined>
)
export const UNIGradient = () => (
<ButtonUNIGradient>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonUNIGradient>
)
export const Pink = () => (
<ButtonPink>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonPink>
)
export const Secondary = () => (
<ButtonSecondary>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonSecondary>
)
export const Gray = () => (
<ButtonGray>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonGray>
)
export const Light = () => (
<ButtonLight>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonLight>
)
export const Primary = () => (
<ButtonPrimary>
<Unicorn />
&nbsp;UNISWAP&nbsp;
<Unicorn />
</ButtonPrimary>
)

View File

@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components/macro'
import { darken } from 'polished'
@@ -72,14 +71,12 @@ export const ButtonPrimary = styled(Base)`
}
&:disabled {
background-color: ${({ theme, altDisabledStyle, disabled }) =>
altDisabledStyle ? (disabled ? theme.primary1 : theme.primary1) : theme.primary1};
color: white;
altDisabledStyle ? (disabled ? theme.primary1 : theme.bg2) : theme.bg2};
color: ${({ theme }) => theme.text2};
cursor: auto;
box-shadow: none;
border: 1px solid transparent;
outline: none;
opacity: 0.4;
opacity: ${({ altDisabledStyle }) => (altDisabledStyle ? '0.5' : '0.4')};
}
`

View File

@@ -1,4 +1,3 @@
import React from 'react'
import ReactConfetti from 'react-confetti'
import { useWindowSize } from '../../hooks/useWindowSize'

View File

@@ -1,5 +1,5 @@
import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core'
import React, { useMemo } from 'react'
import { useMemo } from 'react'
import useTheme from '../../hooks/useTheme'
import { TYPE } from '../../theme'
import { warningSeverity } from '../../utils/prices'
@@ -18,10 +18,10 @@ export function FiatValue({
if (!priceImpact) return undefined
if (priceImpact.lessThan('0')) return theme.green1
const severity = warningSeverity(priceImpact)
if (severity < 1) return theme.text4
if (severity < 1) return theme.text3
if (severity < 3) return theme.yellow1
return theme.red1
}, [priceImpact, theme.green1, theme.red1, theme.text4, theme.yellow1])
}, [priceImpact, theme.green1, theme.red1, theme.text3, theme.yellow1])
return (
<TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>

View File

@@ -1,6 +1,6 @@
import { Pair } from '@uniswap/v2-sdk'
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
import React, { useState, useCallback, ReactNode } from 'react'
import { useState, useCallback, ReactNode } from 'react'
import styled from 'styled-components/macro'
import { darken } from 'polished'
import { useCurrencyBalance } from '../../state/wallet/hooks'
@@ -130,7 +130,7 @@ const StyledBalanceMax = styled.button<{ disabled?: boolean }>`
font-weight: 500;
cursor: pointer;
padding: 0;
color: ${({ theme }) => theme.primary1};
color: ${({ theme }) => theme.primaryText1};
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')};
margin-left: 0.25rem;
@@ -160,6 +160,8 @@ interface CurrencyInputPanelProps {
priceImpact?: Percent
id: string
showCommonBases?: boolean
showCurrencyAmount?: boolean
disableNonToken?: boolean
renderBalance?: (amount: CurrencyAmount<Currency>) => ReactNode
locked?: boolean
}
@@ -174,6 +176,8 @@ export default function CurrencyInputPanel({
otherCurrency,
id,
showCommonBases,
showCurrencyAmount,
disableNonToken,
renderBalance,
fiatValue,
priceImpact,
@@ -298,6 +302,8 @@ export default function CurrencyInputPanel({
selectedCurrency={currency}
otherSelectedCurrency={otherCurrency}
showCommonBases={showCommonBases}
showCurrencyAmount={showCurrencyAmount}
disableNonToken={disableNonToken}
/>
)}
</InputPanel>

View File

@@ -7,7 +7,7 @@ import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo'
import Logo from '../Logo'
export const getTokenLogoURL = (address: string) =>
`https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/${address}/logo.png`
`https://raw.githubusercontent.com/uniswap/assets/master/blockchains/ethereum/assets/${address}/logo.png`
const StyledEthereumLogo = styled.img<{ size: string }>`
width: ${({ size }) => size};

View File

@@ -1,18 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import React from 'react'
import { DAI, WBTC } from '../../constants/tokens'
import Component, { DoubleCurrencyLogoProps } from './index'
export default {
title: 'DoubleCurrencyLogo',
decorators: [],
}
const Template: Story<DoubleCurrencyLogoProps> = (args) => <Component {...args} />
export const DoubleCurrencyLogo = Template.bind({})
DoubleCurrencyLogo.args = {
currency0: DAI,
currency1: WBTC,
size: 220,
}

View File

@@ -1,5 +1,4 @@
import { Currency } from '@uniswap/sdk-core'
import React from 'react'
import styled from 'styled-components/macro'
import CurrencyLogo from '../CurrencyLogo'

View File

@@ -1,4 +1,3 @@
import React from 'react'
import { FeeAmount } from '@uniswap/v3-sdk'
import { Trans } from '@lingui/macro'
import { AutoColumn } from 'components/Column'

View File

@@ -1,5 +1,4 @@
import JSBI from 'jsbi'
import React from 'react'
import { Currency, CurrencyAmount, Fraction } from '@uniswap/sdk-core'
const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000))

View File

@@ -0,0 +1,219 @@
import { Trans } from '@lingui/macro'
import arbitrumLogoUrl from 'assets/svg/arbitrum_logo.svg'
import { YellowCard } from 'components/Card'
import { useOnClickOutside } from 'hooks/useOnClickOutside'
import { useActiveWeb3React } from 'hooks/web3'
import { transparentize } from 'polished'
import React, { useEffect, useRef, useState } from 'react'
import { ArrowDownCircle } from 'react-feather'
import { ApplicationModal } from 'state/application/actions'
import { useModalOpen, useToggleModal } from 'state/application/hooks'
import styled, { css } from 'styled-components'
import { ExternalLink } from 'theme'
import { switchToNetwork } from 'utils/switchToNetwork'
import { NETWORK_LABELS, SupportedChainId } from '../../constants/chains'
const BaseWrapper = css`
position: relative;
${({ theme }) => theme.mediaWidth.upToMedium`
margin-left: 12px;
`};
${({ theme }) => theme.mediaWidth.upToSmall`
margin: 0 0.5rem 0 0;
width: initial;
overflow: hidden;
text-overflow: ellipsis;
flex-shrink: 1;
`};
`
const ArbitrumWrapper = styled.div`
${BaseWrapper}
`
const BaseMenuItem = css`
align-items: center;
background-color: ${({ theme }) => transparentize(0.9, theme.primary1)};
border-radius: 12px;
color: ${({ theme }) => theme.text2};
cursor: pointer;
display: flex;
flex: 1;
flex-direction: row;
font-size: 14px;
font-weight: 400;
justify-content: space-between;
padding: 12px;
:hover {
color: ${({ theme }) => theme.text1};
text-decoration: none;
}
`
const DisabledMenuItem = styled.div`
${BaseMenuItem}
align-items: center;
background-color: ${({ theme }) => theme.bg2};
cursor: auto;
display: flex;
font-size: 10px;
font-style: italic;
justify-content: center;
:hover,
:active,
:focus {
color: ${({ theme }) => theme.text2};
}
`
const FallbackWrapper = styled(YellowCard)`
${BaseWrapper}
border-radius: 12px;
padding: 8px 12px;
`
const Icon = styled.img`
width: 17px;
`
const L1Tag = styled.div`
color: #c4d9f8;
opacity: 40%;
`
const L2Tag = styled.div`
background-color: ${({ theme }) => theme.primary1};
border-radius: 6px;
color: white;
font-size: 12px;
font-weight: 600;
padding: 2px 6px;
`
const MenuFlyout = styled.span`
background-color: ${({ theme }) => theme.bg2};
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),
0px 24px 32px rgba(0, 0, 0, 0.01);
border-radius: 20px;
padding: 8px;
display: flex;
flex-direction: column;
font-size: 1rem;
position: absolute;
left: 0rem;
top: 3rem;
z-index: 100;
width: 237px;
${({ theme }) => theme.mediaWidth.upToMedium`
top: -14.25rem;
`};
> {
padding: 12px;
}
> :not(:first-child) {
margin-top: 4px;
}
> :not(:last-child) {
margin-bottom: 4px;
}
`
const LinkOutCircle = styled(ArrowDownCircle)`
transform: rotate(230deg);
width: 20px;
height: 20px;
`
const MenuItem = styled(ExternalLink)`
${BaseMenuItem}
`
const ButtonMenuItem = styled.button`
${BaseMenuItem}
border: none;
outline: none;
box-shadow: none;
`
const NetworkInfo = styled.button`
align-items: center;
background-color: ${({ theme }) => theme.bg2};
border-radius: 8px;
border: none;
color: ${({ theme }) => theme.text1};
display: flex;
flex-direction: row;
font-weight: 500;
height: 100%;
justify-content: space-between;
margin: 0;
padding: 8px;
width: 172px;
:hover,
:focus {
cursor: pointer;
outline: none;
background-color: ${({ theme }) => theme.bg3};
}
`
export default function NetworkCard() {
const { chainId, library } = useActiveWeb3React()
const node = useRef<HTMLDivElement>(null)
const open = useModalOpen(ApplicationModal.ARBITRUM_OPTIONS)
const toggle = useToggleModal(ApplicationModal.ARBITRUM_OPTIONS)
useOnClickOutside(node, open ? toggle : undefined)
const [implements3085, setImplements3085] = useState(false)
useEffect(() => {
// metamask is currently the only known implementer of this EIP
// here we proceed w/ a noop feature check to ensure the user's version of metamask supports network switching
// if not, we hide the UI
if (!library?.provider?.request || !chainId || !library?.provider?.isMetaMask) {
return
}
switchToNetwork({ library, chainId })
.then((x) => x ?? setImplements3085(true))
.catch(() => setImplements3085(false))
}, [library, chainId])
if (!chainId || chainId === SupportedChainId.MAINNET || !NETWORK_LABELS[chainId] || !library) {
return null
}
if (chainId === SupportedChainId.ARBITRUM_ONE) {
return (
<ArbitrumWrapper ref={node}>
<NetworkInfo onClick={toggle}>
<Icon src={arbitrumLogoUrl} />
<span>Arbitrum</span>
<L2Tag>L2 Alpha</L2Tag>
</NetworkInfo>
{open && (
<MenuFlyout>
<MenuItem href="https://bridge.arbitrum.io/">
<div>
<Trans>Arbitrum Token Bridge</Trans>
</div>
<LinkOutCircle />
</MenuItem>
<MenuItem href="https://explorer.arbitrum.io/">
<div>
<Trans>Arbitrum Explorer</Trans>
</div>
<LinkOutCircle />
</MenuItem>
<MenuItem href="https://offchainlabs.com/">
<div>
<Trans>Learn more</Trans>
</div>
<LinkOutCircle />
</MenuItem>
{implements3085 ? (
<ButtonMenuItem onClick={() => switchToNetwork({ library, chainId: SupportedChainId.MAINNET })}>
<div>
<Trans>Switch to Ethereum</Trans>
</div>
<L1Tag>L1</L1Tag>
</ButtonMenuItem>
) : (
<DisabledMenuItem>
<Trans>Change your network to go back to L1</Trans>
</DisabledMenuItem>
)}
</MenuFlyout>
)}
</ArbitrumWrapper>
)
}
return <FallbackWrapper title={NETWORK_LABELS[chainId]}>{NETWORK_LABELS[chainId]}</FallbackWrapper>
}

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import styled, { keyframes } from 'styled-components'
import { useActiveWeb3React } from '../../hooks/web3'
@@ -21,7 +21,7 @@ const StyledPolling = styled.div`
`
const StyledPollingNumber = styled(TYPE.small)<{ breathe: boolean; hovering: boolean }>`
transition: opacity 0.25s ease;
opacity: ${({ breathe, hovering }) => (hovering ? 0.7 : breathe ? 1 : 0.2)};
opacity: ${({ breathe, hovering }) => (hovering ? 0.7 : breathe ? 1 : 0.5)};
:hover {
opacity: 1;
}

View File

@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components/macro'
import { AlertTriangle, X } from 'react-feather'

View File

@@ -1,5 +1,5 @@
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import React, { useMemo } from 'react'
import { useMemo } from 'react'
import { X } from 'react-feather'
import styled from 'styled-components/macro'
import tokenLogo from '../../assets/images/token-logo.png'

View File

@@ -1,32 +1,28 @@
import useScrollPosition from '@react-hook/window-scroll'
import React, { useState } from 'react'
import { Text } from 'rebass'
import { NavLink } from 'react-router-dom'
import { darken } from 'polished'
import { Trans } from '@lingui/macro'
import useScrollPosition from '@react-hook/window-scroll'
import { darken } from 'polished'
import { useState } from 'react'
import { Moon, Sun } from 'react-feather'
import { NavLink } from 'react-router-dom'
import { Text } from 'rebass'
import { useShowClaimPopup, useToggleSelfClaimModal } from 'state/application/hooks'
import { useUserHasAvailableClaim } from 'state/claim/hooks'
import { useUserHasSubmittedClaim } from 'state/transactions/hooks'
import { useDarkModeManager } from 'state/user/hooks'
import { useETHBalances } from 'state/wallet/hooks'
import styled from 'styled-components/macro'
import Logo from '../../assets/svg/logo.svg'
import LogoDark from '../../assets/svg/logo_white.svg'
import { useActiveWeb3React } from '../../hooks/web3'
import { useDarkModeManager } from '../../state/user/hooks'
import { useETHBalances } from '../../state/wallet/hooks'
import { CardNoise } from '../earn/styled'
import { TYPE, ExternalLink } from '../../theme'
import { YellowCard } from '../Card'
import Menu from '../Menu'
import Row, { RowFixed } from '../Row'
import Web3Status from '../Web3Status'
import { ExternalLink, TYPE } from '../../theme'
import ClaimModal from '../claim/ClaimModal'
import { useToggleSelfClaimModal, useShowClaimPopup } from '../../state/application/hooks'
import { useUserHasAvailableClaim } from '../../state/claim/hooks'
import { useUserHasSubmittedClaim } from '../../state/transactions/hooks'
import { Dots } from '../swap/styleds'
import { CardNoise } from '../earn/styled'
import Menu from '../Menu'
import Modal from '../Modal'
import Row, { RowFixed } from '../Row'
import { Dots } from '../swap/styleds'
import Web3Status from '../Web3Status'
import NetworkCard from './NetworkCard'
import UniBalanceContent from './UniBalanceContent'
const HeaderFrame = styled.div<{ showBackground: boolean }>`
@@ -169,19 +165,6 @@ const HideSmall = styled.span`
`};
`
const NetworkCard = styled(YellowCard)`
border-radius: 12px;
padding: 8px 12px;
${({ theme }) => theme.mediaWidth.upToSmall`
margin: 0;
margin-right: 0.5rem;
width: initial;
overflow: hidden;
text-overflow: ellipsis;
flex-shrink: 1;
`};
`
const BalanceText = styled(Text)`
${({ theme }) => theme.mediaWidth.upToExtraSmall`
display: none;
@@ -301,15 +284,8 @@ export const StyledMenuButton = styled.button`
}
`
const NETWORK_LABELS: { [chainId: number]: string } = {
[4]: 'Rinkeby',
[3]: 'Ropsten',
[5]: 'Görli',
[42]: 'Kovan',
}
export default function Header() {
const { account, chainId } = useActiveWeb3React()
const { account } = useActiveWeb3React()
const userEthBalance = useETHBalances(account ? [account] : [])?.[account ?? '']
// const [isDark] = useDarkModeManager()
@@ -367,9 +343,7 @@ export default function Header() {
<HeaderControls>
<HeaderElement>
<HideSmall>
{chainId && NETWORK_LABELS[chainId] && (
<NetworkCard title={NETWORK_LABELS[chainId]}>{NETWORK_LABELS[chainId]}</NetworkCard>
)}
<NetworkCard />
</HideSmall>
{availableClaim && !showClaimPopup && (
<UNIWrapper onClick={toggleClaimModal}>

View File

@@ -1,5 +1,5 @@
import Tooltip from 'components/Tooltip'
import React, { useState } from 'react'
import { useState } from 'react'
import styled from 'styled-components/macro'
const TextWrapper = styled.span<{ margin: boolean; link?: boolean; fontSize?: string; adjustSize?: boolean }>`

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useRef } from 'react'
import { useEffect, useRef } from 'react'
import styled from 'styled-components/macro'

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback, useEffect, ReactNode } from 'react'
import { useState, useCallback, useEffect, ReactNode } from 'react'
import { LightCard } from 'components/Card'
import { RowBetween } from 'components/Row'
import { Input as NumericalInput } from '../NumericalInput'

View File

@@ -1,90 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import React from 'react'
// import Row, { RowFixed } from 'components/Row'
import styled from 'styled-components/macro'
import Component, { LineChartProps } from './'
import { dummyData } from './data'
// import { AutoColumn } from 'components/Column'
// import { TYPE } from 'theme'
// import DoubleCurrencyLogo from 'components/DoubleLogo'
// import { MKR } from 'constants'
// import { ETHER } from '@uniswap/sdk'
// import LineChart from '.'
const Wrapper = styled.div`
margin: 1em 2em;
max-width: 500px;
& > * {
font-size: 1em;
}
`
export default {
title: 'Charts',
argTypes: {
disabled: { control: { type: 'boolean' } },
onClick: { action: 'clicked' },
},
decorators: [
(Component: Story) => (
<Wrapper>
<Component />
</Wrapper>
),
],
}
const Template: Story<LineChartProps> = (args) => <Component {...args}>{args.children}</Component>
export const Basic = Template.bind({})
Basic.args = { data: dummyData }
// const Full = () => {
// const [value, setValue] = useState<number | undefined>(dummyData[dummyData.length - 1].value)
// const dummyUSDPrice = 410 // used for conversion
// const TopLeftContent = () => (
// <AutoColumn gap="md">
// <RowFixed align="center">
// <DoubleCurrencyLogo currency0={MKR} currency1={ETHER} size={20} />{' '}
// <TYPE.main fontSize="20px" color="white" ml="10px">
// ETH / MKR
// </TYPE.main>
// </RowFixed>
// <Row>
// <TYPE.main fontSize="20px" color="white">
// {value} MKR
// </TYPE.main>
// <TYPE.main color="#565A69" fontSize="20px" ml="10px">
// ($
// {value
// ? (value * dummyUSDPrice).toLocaleString('USD', {
// currency: 'USD',
// minimumFractionDigits: 2
// })
// : null}{' '}
// )
// </TYPE.main>
// </Row>
// </AutoColumn>
// )
// return (
// <Wrapper>
// <LineChart data={dummyData} setValue={setValue} topLeft={<TopLeftContent />} />
// </Wrapper>
// )
// }
// export const FullVersion = Template.bind(() => <LineChart data={dummyData} />)
// Full.args = { data: dummyData }
// Full.decorators = [
// (Story: any) => {
// return (
// <Wrapper>
// <LineChart data={dummyData} />
// </Wrapper>
// )
// }
// ]

View File

@@ -1,5 +1,3 @@
import React from 'react'
import styled, { keyframes } from 'styled-components'
const rotate = keyframes`

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { Slash } from 'react-feather'
import { ImageProps } from 'rebass'
import useTheme from '../../hooks/useTheme'

View File

@@ -1,23 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import React from 'react'
import styled from 'styled-components/macro'
import Component from './index'
const Wrapper = styled.div`
max-width: 150px;
`
export default {
title: 'Menu',
decorators: [
() => (
<Wrapper>
<Component />
</Wrapper>
),
],
}
const Template: Story<any> = (args) => <Component {...args} />
export const Menu = Template.bind({})
Menu.args = {}

View File

@@ -30,7 +30,7 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, ...r
)).attrs({
'aria-label': 'dialog',
})`
overflow-y: ${({ mobile }) => (mobile ? 'scroll' : 'hidden')};
overflow-y: auto;
&[data-reach-dialog-content] {
margin: 0 0 2rem 0;
@@ -39,7 +39,7 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, ...r
box-shadow: 0 4px 8px 0 ${({ theme }) => transparentize(0.95, theme.shadow1)};
padding: 0px;
width: 50vw;
overflow-y: ${({ mobile }) => (mobile ? 'scroll' : 'hidden')};
overflow-y: auto;
overflow-x: hidden;
align-self: ${({ mobile }) => (mobile ? 'flex-end' : 'center')};

View File

@@ -1,4 +1,4 @@
import React, { useContext } from 'react'
import { useContext } from 'react'
import { useActiveWeb3React } from '../../hooks/web3'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
@@ -70,7 +70,7 @@ export function SubmittedView({
style={{ marginLeft: '4px' }}
>
<TYPE.subHeader>
<Trans>View transaction on Etherscan</Trans>
<Trans>View transaction on Explorer</Trans>
</TYPE.subHeader>
</ExternalLink>
)}

View File

@@ -1,12 +1,11 @@
import React from 'react'
import styled from 'styled-components/macro'
import { darken } from 'polished'
import { Trans } from '@lingui/macro'
import { NavLink, Link as HistoryLink } from 'react-router-dom'
import { NavLink, Link as HistoryLink, useLocation } from 'react-router-dom'
import { Percent } from '@uniswap/sdk-core'
import { ArrowLeft } from 'react-feather'
import { RowBetween } from '../Row'
import Row, { RowBetween } from '../Row'
import SettingsTab from '../Settings'
import { useAppDispatch } from 'state/hooks'
@@ -80,7 +79,7 @@ export function FindPoolTabs({ origin }: { origin: string }) {
<StyledArrowLeft />
</HistoryLink>
<ActiveText>
<Trans>Import Pool</Trans>
<Trans>Import V2 Pool</Trans>
</ActiveText>
</RowBetween>
</Tabs>
@@ -90,24 +89,29 @@ export function FindPoolTabs({ origin }: { origin: string }) {
export function AddRemoveTabs({
adding,
creating,
positionID,
defaultSlippage,
positionID,
}: {
adding: boolean
creating: boolean
positionID?: string | undefined
defaultSlippage: Percent
positionID?: string | undefined
}) {
const theme = useTheme()
// reset states on back
const dispatch = useAppDispatch()
const location = useLocation()
// detect if back should redirect to v3 or v2 pool page
const poolLink = location.pathname.includes('add/v2')
? '/pool/v2'
: '/pool' + (!!positionID ? `/${positionID.toString()}` : '')
return (
<Tabs>
<RowBetween style={{ padding: '1rem 1rem 0 1rem' }}>
<HistoryLink
to={'/pool' + (!!positionID ? `/${positionID.toString()}` : '')}
to={poolLink}
onClick={() => {
if (adding) {
// not 100% sure both of these are needed
@@ -132,3 +136,16 @@ export function AddRemoveTabs({
</Tabs>
)
}
export function CreateProposalTabs() {
return (
<Tabs>
<Row style={{ padding: '1rem 1rem 0 1rem' }}>
<HistoryLink to="/vote">
<StyledArrowLeft />
</HistoryLink>
<ActiveText style={{ marginLeft: 'auto', marginRight: 'auto' }}>Create Proposal</ActiveText>
</Row>
</Tabs>
)
}

View File

@@ -1,6 +1,6 @@
import { Trans } from '@lingui/macro'
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import React, { useCallback, useEffect } from 'react'
import { useCallback, useEffect } from 'react'
import ReactGA from 'react-ga'
import { Heart, X } from 'react-feather'
import styled, { keyframes } from 'styled-components'

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useContext, useEffect } from 'react'
import { useCallback, useContext, useEffect } from 'react'
import { X } from 'react-feather'
import { useSpring } from 'react-spring/web'
import styled, { ThemeContext } from 'styled-components'

View File

@@ -1,4 +1,4 @@
import React, { useContext } from 'react'
import { useContext } from 'react'
import { AlertCircle, CheckCircle } from 'react-feather'
import styled, { ThemeContext } from 'styled-components'
import { useActiveWeb3React } from '../../hooks/web3'
@@ -34,7 +34,7 @@ export default function TransactionPopup({
<TYPE.body fontWeight={500}>{summary ?? 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)}</TYPE.body>
{chainId && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
View on Etherscan
View on Explorer
</ExternalLink>
)}
</AutoColumn>

View File

@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components/macro'
import { useActivePopups } from '../../state/application/hooks'
import { AutoColumn } from '../Column'
@@ -33,7 +32,7 @@ const MobilePopupInner = styled.div`
const FixedPopupColumn = styled(AutoColumn)<{ extraPadding: boolean }>`
position: fixed;
top: ${({ extraPadding }) => (extraPadding ? '72px' : '88px')};
top: ${({ extraPadding }) => (extraPadding ? '80px' : '88px')};
right: 1rem;
max-width: 355px !important;
width: 100%;

View File

@@ -1,4 +1,3 @@
import React from 'react'
import { Token } from '@uniswap/sdk-core'
import { Link } from 'react-router-dom'
import { Text } from 'rebass'

View File

@@ -1,5 +1,5 @@
import JSBI from 'jsbi'
import React, { useState } from 'react'
import { useState } from 'react'
import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { Pair } from '@uniswap/v2-sdk'
import { ChevronDown, ChevronUp } from 'react-feather'

View File

@@ -2,7 +2,7 @@ import JSBI from 'jsbi'
import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { Pair } from '@uniswap/v2-sdk'
import { darken } from 'polished'
import React, { useState } from 'react'
import { useState } from 'react'
import { ChevronDown, ChevronUp } from 'react-feather'
import { Link } from 'react-router-dom'
import { Text } from 'rebass'

View File

@@ -1,53 +0,0 @@
// import { Story } from '@storybook/react/types-6-0'
// import React from 'react'
// import { Position } from 'types/position'
// import { basisPointsToPercent } from 'utils'
// import { DAI, WBTC } from '../../constants'
// import Component, { PositionListProps } from './index'
// import { CurrencyAmount } from '@uniswap/sdk-core'
// import JSBI from 'jsbi'
// const FEE_BIPS = {
// FIVE: basisPointsToPercent(5),
// THIRTY: basisPointsToPercent(30),
// ONE_HUNDRED: basisPointsToPercent(100),
// }
// const daiAmount = CurrencyAmount.fromRawAmount(DAI, JSBI.BigInt(500 * 10 ** 18))
// const wbtcAmount = CurrencyAmount.fromRawAmount(WBTC, JSBI.BigInt(10 ** 7))
// const positions = [
// {
// feesEarned: {
// DAI: 1000,
// WBTC: 0.005,
// },
// feeLevel: FEE_BIPS.FIVE,
// tokenAmount0: daiAmount,
// tokenAmount1: wbtcAmount,
// tickLower: 40000,
// tickUpper: 60000,
// },
// {
// feesEarned: {
// DAI: 1000,
// WBTC: 0.005,
// },
// feeLevel: FEE_BIPS.THIRTY,
// tokenAmount0: daiAmount,
// tokenAmount1: wbtcAmount,
// tickLower: 45000,
// tickUpper: 55000,
// },
// ]
// const positions: Position[] = []
export default {
title: 'PositionList',
}
// const Template: Story<PositionListProps> = (args) => <Component {...args} />
// export const PositionList = Template.bind({})
// PositionList.args = {
// positions,
// showUnwrapped: true,
// }

View File

@@ -1,31 +0,0 @@
// import { Story } from '@storybook/react/types-6-0'
// import { FeeAmount, MAX_TICK, MIN_TICK, TICK_SPACINGS } from '@uniswap/v3-sdk'
// import { BigNumber } from 'ethers'
// import React from 'react'
// import { Position } from 'types/position'
// import Component, { PositionListItemProps } from './index'
// const position: Position = {
// nonce: BigNumber.from(0),
// operator: '',
// token0: '',
// token1: '',
// fee: FeeAmount.LOW,
// tickLower: MIN_TICK(TICK_SPACINGS[FeeAmount.LOW]),
// tickUpper: MAX_TICK(TICK_SPACINGS[FeeAmount.LOW]),
// liquidity,
// feeGrowthInside0LastX128fee
// feeGrowthInside0LastX128
// feeGrowthInside1LastX128
// tokensOwed0
// tokensOwed1
// }
export default {
title: 'PositionListItem',
}
// const Template: Story<PositionListItemProps> = (args) => <Component {...args} />
// export const PositionListItem = Template.bind({})
// PositionListItem.args = {position}

View File

@@ -1,4 +1,4 @@
import React, { useMemo } from 'react'
import { useMemo } from 'react'
import { Position } from '@uniswap/v3-sdk'
import Badge from 'components/Badge'
import DoubleCurrencyLogo from 'components/DoubleLogo'
@@ -8,14 +8,14 @@ import { Link } from 'react-router-dom'
import styled from 'styled-components/macro'
import { HideSmall, MEDIA_WIDTHS, SmallOnly } from 'theme'
import { PositionDetails } from 'types/position'
import { WETH9, Price, Token, Percent } from '@uniswap/sdk-core'
import { Price, Token, Percent } from '@uniswap/sdk-core'
import { formatPrice } from 'utils/formatCurrencyAmount'
import Loader from 'components/Loader'
import { unwrappedToken } from 'utils/unwrappedToken'
import RangeBadge from 'components/Badge/RangeBadge'
import { RowFixed } from 'components/Row'
import HoverInlineText from 'components/HoverInlineText'
import { DAI, USDC, USDT, WBTC } from '../../constants/tokens'
import { DAI, USDC, USDT, WBTC, WETH9_EXTENDED } from '../../constants/tokens'
import { Trans } from '@lingui/macro'
const LinkRow = styled(Link)`
@@ -146,7 +146,7 @@ export function getPriceOrderingFromPositionForUI(position?: Position): {
}
// if token1 is an ETH-/BTC-stable asset, set it as the base token
const bases = [...Object.values(WETH9), WBTC]
const bases = [...Object.values(WETH9_EXTENDED), WBTC]
if (bases.some((base) => base.equals(token1))) {
return {
priceLower: position.token0PriceUpper.invert(),

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback, useContext, ReactNode } from 'react'
import { useState, useCallback, useContext, ReactNode } from 'react'
import { Position } from '@uniswap/v3-sdk'
import { LightCard } from 'components/Card'
import { AutoColumn } from 'components/Column'

View File

@@ -1,4 +1,4 @@
import React, { useContext } from 'react'
import { useContext } from 'react'
import styled from 'styled-components/macro'
import { AutoColumn } from '../Column'
import { ThemeContext } from 'styled-components'

View File

@@ -1,4 +1,4 @@
import React, { ReactNode, useCallback, useState } from 'react'
import { ReactNode, useCallback, useState } from 'react'
import styled from 'styled-components/macro'
import Tooltip from '../Tooltip'

View File

@@ -1,5 +1,4 @@
import { Trans } from '@lingui/macro'
import React from 'react'
import { Currency, Price, Token } from '@uniswap/sdk-core'
import StepCounter from 'components/InputStepCounter/InputStepCounter'
import { RowBetween } from 'components/Row'

View File

@@ -1,4 +1,4 @@
import React from 'react'
import { Trans } from '@lingui/macro'
import { Currency } from '@uniswap/sdk-core'
import { ToggleElement, ToggleWrapper } from 'components/Toggle/MultiToggle'
@@ -19,13 +19,13 @@ export default function RateToggle({
const isSorted = tokenA && tokenB && tokenA.sortsBefore(tokenB)
return tokenA && tokenB ? (
<div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 'fit-content', display: 'flex', alignItems: 'center' }} onClick={handleRateToggle}>
<ToggleWrapper width="fit-content">
<ToggleElement isActive={isSorted} fontSize="12px" onClick={handleRateToggle}>
{isSorted ? currencyA.symbol + ' price ' : currencyB.symbol + ' price '}
<ToggleElement isActive={isSorted} fontSize="12px">
<Trans>{isSorted ? currencyA.symbol : currencyB.symbol} price</Trans>
</ToggleElement>
<ToggleElement isActive={!isSorted} fontSize="12px" onClick={handleRateToggle}>
{isSorted ? currencyB.symbol + ' price ' : currencyA.symbol + ' price '}
<ToggleElement isActive={!isSorted} fontSize="12px">
<Trans>{isSorted ? currencyB.symbol : currencyA.symbol} price</Trans>
</ToggleElement>
</ToggleWrapper>
</div>

View File

@@ -1,5 +1,4 @@
import { Trans } from '@lingui/macro'
import React from 'react'
import { Text } from 'rebass'
import { Currency } from '@uniswap/sdk-core'
import styled from 'styled-components/macro'
@@ -23,8 +22,9 @@ const BaseWrapper = styled.div<{ disable?: boolean }>`
background-color: ${({ theme, disable }) => !disable && theme.bg2};
}
color: ${({ theme, disable }) => disable && theme.text3};
background-color: ${({ theme, disable }) => disable && theme.bg3};
opacity: ${({ disable }) => disable && '0.4'};
filter: ${({ disable }) => disable && 'grayscale(1)'};
`
export default function CommonBases({

View File

@@ -1,6 +1,6 @@
import { Trans } from '@lingui/macro'
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
import { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
import { FixedSizeList } from 'react-window'
import { Text } from 'rebass'
import styled from 'styled-components/macro'
@@ -104,12 +104,14 @@ function CurrencyRow({
isSelected,
otherSelected,
style,
showCurrencyAmount,
}: {
currency: Currency
onSelect: () => void
isSelected: boolean
otherSelected: boolean
style: CSSProperties
showCurrencyAmount?: boolean
}) {
const { account } = useActiveWeb3React()
const key = currencyKey(currency)
@@ -141,9 +143,11 @@ function CurrencyRow({
</TYPE.darkGray>
</Column>
<TokenTags currency={currency} />
<RowFixed style={{ justifySelf: 'flex-end' }}>
{balance ? <Balance balance={balance} /> : account ? <Loader /> : null}
</RowFixed>
{showCurrencyAmount && (
<RowFixed style={{ justifySelf: 'flex-end' }}>
{balance ? <Balance balance={balance} /> : account ? <Loader /> : null}
</RowFixed>
)}
</MenuItem>
)
}
@@ -189,6 +193,7 @@ export default function CurrencyList({
fixedListRef,
showImportView,
setImportToken,
showCurrencyAmount,
}: {
height: number
currencies: Currency[]
@@ -199,6 +204,7 @@ export default function CurrencyList({
fixedListRef?: MutableRefObject<FixedSizeList | undefined>
showImportView: () => void
setImportToken: (token: Token) => void
showCurrencyAmount?: boolean
}) {
const itemData: (Currency | BreakLine)[] = useMemo(() => {
if (otherListTokens && otherListTokens?.length > 0) {
@@ -237,13 +243,22 @@ export default function CurrencyList({
isSelected={isSelected}
onSelect={handleSelect}
otherSelected={otherSelected}
showCurrencyAmount={showCurrencyAmount}
/>
)
} else {
return null
}
},
[currencies.length, onCurrencySelect, otherCurrency, selectedCurrency, setImportToken, showImportView]
[
currencies.length,
onCurrencySelect,
otherCurrency,
selectedCurrency,
setImportToken,
showImportView,
showCurrencyAmount,
]
)
const itemKey = useCallback((index: number, data: typeof itemData) => {

View File

@@ -1,9 +1,10 @@
import { Currency, Ether, Token } from '@uniswap/sdk-core'
import React, { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Currency, Token } from '@uniswap/sdk-core'
import { KeyboardEvent, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import ReactGA from 'react-ga'
import { t, Trans } from '@lingui/macro'
import { FixedSizeList } from 'react-window'
import { Text } from 'rebass'
import { ExtendedEther } from '../../constants/tokens'
import { useActiveWeb3React } from '../../hooks/web3'
import { useAllTokens, useToken, useIsUserAddedToken, useSearchInactiveTokenLists } from '../../hooks/Tokens'
import { CloseIcon, TYPE, ButtonText, IconWrapper } from '../../theme'
@@ -47,6 +48,8 @@ interface CurrencySearchProps {
onCurrencySelect: (currency: Currency) => void
otherSelectedCurrency?: Currency | null
showCommonBases?: boolean
showCurrencyAmount?: boolean
disableNonToken?: boolean
showManageView: () => void
showImportView: () => void
setImportToken: (token: Token) => void
@@ -57,6 +60,8 @@ export function CurrencySearch({
onCurrencySelect,
otherSelectedCurrency,
showCommonBases,
showCurrencyAmount,
disableNonToken,
onDismiss,
isOpen,
showManageView,
@@ -105,7 +110,7 @@ export function CurrencySearch({
const filteredSortedTokens = useSortedTokensByQuery(sortedTokens, debouncedQuery)
const ether = useMemo(() => chainId && Ether.onChain(chainId), [chainId])
const ether = useMemo(() => chainId && ExtendedEther.onChain(chainId), [chainId])
const filteredSortedTokensWithETH: Currency[] = useMemo(() => {
const s = debouncedQuery.toLowerCase().trim()
@@ -202,7 +207,7 @@ export function CurrencySearch({
{({ height }) => (
<CurrencyList
height={height}
currencies={filteredSortedTokensWithETH}
currencies={disableNonToken ? filteredSortedTokens : filteredSortedTokensWithETH}
otherListTokens={filteredInactiveTokens}
onCurrencySelect={handleCurrencySelect}
otherCurrency={otherSelectedCurrency}
@@ -210,6 +215,7 @@ export function CurrencySearch({
fixedListRef={fixedList}
showImportView={showImportView}
setImportToken={setImportToken}
showCurrencyAmount={showCurrencyAmount}
/>
)}
</AutoSizer>
@@ -223,12 +229,12 @@ export function CurrencySearch({
)}
<Footer>
<Row justify="center">
<ButtonText onClick={showManageView} color={theme.blue1} className="list-token-manage-button">
<ButtonText onClick={showManageView} color={theme.primary1} className="list-token-manage-button">
<RowFixed>
<IconWrapper size="16px" marginRight="6px">
<IconWrapper size="16px" marginRight="6px" stroke={theme.primaryText1}>
<Edit />
</IconWrapper>
<TYPE.main color={theme.blue1}>
<TYPE.main color={theme.primaryText1}>
<Trans>Manage Token Lists</Trans>
</TYPE.main>
</RowFixed>

View File

@@ -1,5 +1,5 @@
import { Currency, Token } from '@uniswap/sdk-core'
import React, { useCallback, useEffect, useState } from 'react'
import { useCallback, useEffect, useState } from 'react'
import useLast from '../../hooks/useLast'
import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo'
import Modal from '../Modal'
@@ -17,6 +17,8 @@ interface CurrencySearchModalProps {
onCurrencySelect: (currency: Currency) => void
otherSelectedCurrency?: Currency | null
showCommonBases?: boolean
showCurrencyAmount?: boolean
disableNonToken?: boolean
}
export enum CurrencyModalView {
@@ -33,6 +35,8 @@ export default function CurrencySearchModal({
selectedCurrency,
otherSelectedCurrency,
showCommonBases = false,
showCurrencyAmount = true,
disableNonToken = false,
}: CurrencySearchModalProps) {
const [modalView, setModalView] = useState<CurrencyModalView>(CurrencyModalView.manage)
const lastOpen = useLast(isOpen)
@@ -74,6 +78,8 @@ export default function CurrencySearchModal({
selectedCurrency={selectedCurrency}
otherSelectedCurrency={otherSelectedCurrency}
showCommonBases={showCommonBases}
showCurrencyAmount={showCurrencyAmount}
disableNonToken={disableNonToken}
showImportView={() => setModalView(CurrencyModalView.importToken)}
setImportToken={setImportToken}
showManageView={() => setModalView(CurrencyModalView.manage)}

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback } from 'react'
import { useState, useCallback } from 'react'
import styled from 'styled-components/macro'
import ReactGA from 'react-ga'
import { TYPE, CloseIcon } from 'theme'

View File

@@ -1,4 +1,4 @@
import React, { CSSProperties } from 'react'
import { CSSProperties } from 'react'
import { Token } from '@uniswap/sdk-core'
import { AutoRow, RowFixed } from 'components/Row'
import { AutoColumn } from 'components/Column'

View File

@@ -1,5 +1,4 @@
import { TokenList } from '@uniswap/token-lists/dist/types'
import React from 'react'
import { Token, Currency } from '@uniswap/sdk-core'
import styled from 'styled-components/macro'
import { TYPE, CloseIcon } from 'theme'
@@ -18,6 +17,7 @@ import { ExternalLink } from '../../theme/components'
import ListLogo from 'components/ListLogo'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import { PaddedColumn } from './styleds'
import { Plural, Trans } from '@lingui/macro'
const Wrapper = styled.div`
position: relative;
@@ -59,7 +59,9 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
<PaddedColumn gap="14px" style={{ width: '100%', flex: '1 1' }}>
<RowBetween>
{onBack ? <ArrowLeft style={{ cursor: 'pointer' }} onClick={onBack} /> : <div />}
<TYPE.mediumHeader>Import {tokens.length > 1 ? 'Tokens' : 'Token'}</TYPE.mediumHeader>
<TYPE.mediumHeader>
<Plural value={tokens.length} one="Import token" other="Import tokens" />
</TYPE.mediumHeader>
{onDismiss ? <CloseIcon onClick={onDismiss} /> : <div />}
</RowBetween>
</PaddedColumn>
@@ -68,9 +70,10 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
<AutoColumn justify="center" style={{ textAlign: 'center', gap: '16px', padding: '1rem' }}>
<AlertCircle size={48} stroke={theme.text2} strokeWidth={1} />
<TYPE.body fontWeight={400} fontSize={16}>
{
"This token doesn't appear on the active token list(s). Make sure this is the token that you want to trade."
}
<Trans>
This token doesn&apos;t appear on the active token list(s). Make sure this is the token that you want to
trade.
</Trans>
</TYPE.body>
</AutoColumn>
{tokens.map((token) => {
@@ -101,7 +104,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
<RowFixed>
{list.logoURI && <ListLogo logoURI={list.logoURI} size="16px" />}
<TYPE.small ml="6px" fontSize={14} color={theme.text3}>
via {list.name} token list
<Trans>via {list.name} token list</Trans>
</TYPE.small>
</RowFixed>
) : (
@@ -109,7 +112,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
<RowFixed>
<AlertCircle stroke={theme.red1} size="10px" />
<TYPE.body color={theme.red1} ml="4px" fontSize="10px" fontWeight={500}>
Unknown Source
<Trans>Unknown Source</Trans>
</TYPE.body>
</RowFixed>
</WarningWrapper>
@@ -129,7 +132,7 @@ export function ImportToken({ tokens, list, onBack, onDismiss, handleCurrencySel
}}
className=".token-dismiss-button"
>
Import
<Trans>Import</Trans>
</ButtonPrimary>
</AutoColumn>
</Wrapper>

View File

@@ -1,5 +1,5 @@
import { Trans } from '@lingui/macro'
import React, { useState } from 'react'
import { useState } from 'react'
import { PaddedColumn, Separator } from './styleds'
import { RowBetween } from 'components/Row'
import { ArrowLeft } from 'react-feather'

View File

@@ -1,4 +1,4 @@
import React, { memo, useCallback, useMemo, useRef, useState, useEffect } from 'react'
import { memo, useCallback, useMemo, useRef, useState, useEffect } from 'react'
import { Settings, CheckCircle } from 'react-feather'
import ReactGA from 'react-ga'
import { useAppDispatch, useAppSelector } from 'state/hooks'

View File

@@ -1,4 +1,4 @@
import React, { useRef, RefObject, useCallback, useState, useMemo } from 'react'
import { useRef, RefObject, useCallback, useState, useMemo } from 'react'
import Column from 'components/Column'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import { PaddedColumn, Separator, SearchInput } from './styleds'

View File

@@ -1,4 +1,3 @@
import React from 'react'
import { Text } from 'rebass'
import styled from 'styled-components/macro'
import { RowFixed } from '../Row'

View File

@@ -1,5 +1,5 @@
import { t, Trans } from '@lingui/macro'
import React, { useContext, useRef, useState } from 'react'
import { useContext, useRef, useState } from 'react'
import { Settings, X } from 'react-feather'
import ReactGA from 'react-ga'
import { Text } from 'rebass'

View File

@@ -1,4 +1,4 @@
import React, { useCallback } from 'react'
import { useCallback } from 'react'
import styled from 'styled-components/macro'
const StyledRangeInput = styled.input<{ size: number }>`

View File

@@ -1,5 +1,6 @@
import { Trans } from '@lingui/macro'
import React, { useMemo } from 'react'
import { useMemo } from 'react'
import ReactGA from 'react-ga'
import { useLocation } from 'react-router'
import styled from 'styled-components/macro'
import { DEFAULT_LOCALE, LOCALE_LABEL, SupportedLocale } from '../../constants/locales'
@@ -38,7 +39,21 @@ export function SwitchLocaleLink() {
return (
<Container>
<Trans>
Uniswap available in: {<StyledInternalLink to={target}>{LOCALE_LABEL[targetLocale]}</StyledInternalLink>}
Uniswap available in:{' '}
{
<StyledInternalLink
onClick={() => {
ReactGA.event({
category: 'Localization',
action: 'Switch Locale',
label: `${activeLocale} -> ${targetLocale}`,
})
}}
to={target}
>
{LOCALE_LABEL[targetLocale]}
</StyledInternalLink>
}
</Trans>
</Container>
)

View File

@@ -0,0 +1,146 @@
import React, { memo, useCallback, useRef } from 'react'
import styled from 'styled-components'
const Input = styled.input<{ error?: boolean; fontSize?: string }>`
font-size: ${({ fontSize }) => fontSize || '1.25rem'};
outline: none;
border: none;
flex: 1 1 auto;
width: 0;
background-color: ${({ theme }) => theme.bg1};
transition: color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')};
color: ${({ error, theme }) => (error ? theme.red1 : theme.text1)};
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
width: 100%;
padding: 0px;
-webkit-appearance: textfield;
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-outer-spin-button,
::-webkit-inner-spin-button {
-webkit-appearance: none;
}
::placeholder {
color: ${({ theme }) => theme.text4};
}
`
const TextAreaInput = styled.textarea<{ error?: boolean; fontSize?: string }>`
font-size: ${({ fontSize }) => fontSize || '1.25rem'};
outline: none;
border: none;
flex: 1 1 auto;
width: 0;
resize: none;
background-color: ${({ theme }) => theme.bg1};
transition: color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')};
color: ${({ error, theme }) => (error ? theme.red1 : theme.text1)};
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
width: 100%;
line-height: 1.2;
padding: 0px;
-webkit-appearance: textfield;
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-outer-spin-button,
::-webkit-inner-spin-button {
-webkit-appearance: none;
}
::placeholder {
color: ${({ theme }) => theme.text4};
}
`
export const TextInput = ({
className,
value,
onUserInput,
placeholder,
fontSize,
}: {
className?: string
value: string
onUserInput: (value: string) => void
placeholder: string
fontSize: string
}) => {
const handleInput = useCallback(
(event) => {
onUserInput(event.target.value)
},
[onUserInput]
)
return (
<div className={className}>
<Input
type="text"
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
placeholder={placeholder || ''}
onChange={handleInput}
value={value}
fontSize={fontSize}
/>
</div>
)
}
export const ResizingTextArea = memo(
({
className,
value,
onUserInput,
placeholder,
fontSize,
}: {
className?: string
value: string
onUserInput: (value: string) => void
placeholder: string
fontSize: string
}) => {
const inputRef = useRef<HTMLTextAreaElement>(document.createElement('textarea'))
const handleInput = useCallback(
(event) => {
inputRef.current.style.height = 'auto'
inputRef.current.style.height = inputRef.current.scrollHeight + 'px'
onUserInput(event.target.value)
},
[onUserInput]
)
return (
<TextAreaInput
style={{ height: 'auto', minHeight: '500px' }}
className={className}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
placeholder={placeholder || ''}
onChange={handleInput}
value={value}
fontSize={fontSize}
ref={inputRef}
/>
)
}
)
ResizingTextArea.displayName = 'ResizingTextArea'

View File

@@ -1,14 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import React from 'react'
import Component from './index'
export default {
title: 'ThemeColorPalette',
}
const Template: Story<any> = (_args: any, context: Record<string, any>) => {
const isDarkMode = context.globals.theme === 'dark'
return <Component isDarkMode={isDarkMode} />
}
export const Palette = Template.bind({})

View File

@@ -1,5 +1,4 @@
import { readableColor } from 'polished'
import React from 'react'
import styled from 'styled-components/macro'
import { colors } from 'theme'

View File

@@ -1,5 +1,4 @@
import { Trans } from '@lingui/macro'
import React from 'react'
import styled from 'styled-components/macro'
import { TYPE } from '../../theme'

View File

@@ -1,35 +0,0 @@
import { Story } from '@storybook/react/types-6-0'
import styled from 'styled-components/macro'
import React, { useState } from 'react'
import MultiToggle from './MultiToggle'
const wrapperCss = styled.main`
font-size: 2em;
margin: 3em;
max-width: 300px;
`
export default {
title: 'Toggles',
argTypes: {
width: { control: { type: 'string' } },
},
decorators: [
(Component: Story) => (
<div css={wrapperCss}>
<Component />
</div>
),
],
}
export const MultiToggleExample = () => {
const [active, setActive] = useState(0)
function doSomethingWithIndex(index: number) {
// here's where youd update state based on index choice
// switch(index){} ...
setActive(index)
}
return <MultiToggle toggle={doSomethingWithIndex} activeIndex={active} options={['option1', 'option2', 'option3']} />
}

View File

@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components/macro'
export const ToggleWrapper = styled.button<{ width?: string }>`
@@ -31,32 +30,3 @@ export const ToggleElement = styled.span<{ isActive?: boolean; fontSize?: string
color: ${({ theme, isActive }) => (isActive ? theme.text2 : theme.text3)};
}
`
export const ToggleText = styled.div`
color: ${({ theme }) => theme.text3};
font-size: 12px;
margin-right: 0.5rem;
width: 100%;
white-space: nowrap;
padding: 0 0 0 4px;
`
export interface ToggleProps {
options: string[]
activeIndex: number
toggle: (index: number) => void
id?: string
width?: string
}
export default function MultiToggle({ id, options, activeIndex, toggle, width }: ToggleProps) {
return (
<ToggleWrapper id={id} width={width}>
{options.map((option, index) => (
<ToggleElement key={id + '-' + index} isActive={index === activeIndex} onClick={() => toggle(index)}>
{option}
</ToggleElement>
))}
</ToggleWrapper>
)
}

View File

@@ -1,54 +1,57 @@
import { Trans } from '@lingui/macro'
import React from 'react'
import { darken } from 'polished'
import { ReactNode } from 'react'
import styled from 'styled-components/macro'
const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>`
padding: 0.25rem 0.5rem;
border-radius: 14px;
background: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.primary1 : theme.text4) : 'none')};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text3)};
font-size: 1rem;
font-weight: 400;
padding: 0.35rem 0.6rem;
border-radius: 12px;
background: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.primary1 : theme.text4) : 'none')};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text2)};
padding: 0.25rem 0.6rem;
border-radius: 9px;
background: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.primary1 : theme.bg4) : 'none')};
color: ${({ theme, isActive }) => (isActive ? theme.white : theme.text2)};
font-size: 1rem;
font-weight: ${({ isOnSwitch }) => (isOnSwitch ? '500' : '400')};
:hover {
user-select: ${({ isOnSwitch }) => (isOnSwitch ? 'none' : 'initial')};
background: ${({ theme, isActive, isOnSwitch }) =>
isActive ? (isOnSwitch ? theme.primary1 : theme.text3) : 'none'};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text3)};
isActive ? (isOnSwitch ? darken(0.05, theme.primary1) : darken(0.05, theme.bg4)) : 'none'};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.white) : theme.text3)};
}
`
const StyledToggle = styled.button<{ isActive?: boolean; activeElement?: boolean }>`
border-radius: 12px;
border: none;
background: ${({ theme }) => theme.bg3};
border: 2px solid;
border-color: ${({ theme, isActive }) => (isActive ? theme.primary1 : theme.bg3)};
background: ${({ theme }) => theme.bg1};
display: flex;
width: fit-content;
cursor: pointer;
outline: none;
padding: 0;
padding: 2px;
`
export interface ToggleProps {
id?: string
isActive: boolean
toggle: () => void
checked?: ReactNode
unchecked?: ReactNode
}
export default function Toggle({ id, isActive, toggle }: ToggleProps) {
export default function Toggle({
id,
isActive,
toggle,
checked = <Trans>On</Trans>,
unchecked = <Trans>Off</Trans>,
}: ToggleProps) {
return (
<StyledToggle id={id} isActive={isActive} onClick={toggle}>
<ToggleElement isActive={isActive} isOnSwitch={true}>
<Trans>On</Trans>
{checked}
</ToggleElement>
<ToggleElement isActive={!isActive} isOnSwitch={false}>
<Trans>Off</Trans>
{unchecked}
</ToggleElement>
</StyledToggle>
)

View File

@@ -1,5 +1,4 @@
import { Token } from '@uniswap/sdk-core'
import React from 'react'
import Modal from '../Modal'
import { ImportToken } from 'components/SearchModal/ImportToken'

View File

@@ -1,4 +1,4 @@
import React, { ReactNode, useCallback, useState } from 'react'
import { ReactNode, useCallback, useState } from 'react'
import styled from 'styled-components/macro'
import Popover, { PopoverProps } from '../Popover'

View File

@@ -1,5 +1,5 @@
import { Currency } from '@uniswap/sdk-core'
import React, { ReactNode, useContext } from 'react'
import { ReactNode, useContext } from 'react'
import styled, { ThemeContext } from 'styled-components'
import { getExplorerLink, ExplorerDataType } from '../../utils/getExplorerLink'
import Modal from '../Modal'
@@ -116,7 +116,7 @@ export function TransactionSubmittedContent({
{chainId && hash && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
<Text fontWeight={500} fontSize={14} color={theme.primary1}>
<Trans>View on Etherscan</Trans>
<Trans>View on Explorer</Trans>
</Text>
</ExternalLink>
)}

View File

@@ -1,5 +1,5 @@
import { t, Trans } from '@lingui/macro'
import React, { useState, useContext } from 'react'
import { useState, useContext } from 'react'
import { Percent } from '@uniswap/sdk-core'
import styled, { ThemeContext } from 'styled-components'

View File

@@ -1,5 +1,4 @@
import { AbstractConnector } from '@web3-react/abstract-connector'
import React from 'react'
import styled from 'styled-components/macro'
import { SUPPORTED_WALLETS } from '../../constants/wallet'
import Option from './Option'

View File

@@ -2,7 +2,7 @@ import { AbstractConnector } from '@web3-react/abstract-connector'
import { UnsupportedChainIdError, useWeb3React } from '@web3-react/core'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import { AutoRow } from 'components/Row'
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { isMobile } from 'react-device-detect'
import ReactGA from 'react-ga'
import styled from 'styled-components/macro'

View File

@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import { useState, useEffect } from 'react'
import { useWeb3React } from '@web3-react/core'
import styled from 'styled-components/macro'
import { Trans } from '@lingui/macro'

View File

@@ -1,7 +1,7 @@
import { AbstractConnector } from '@web3-react/abstract-connector'
import { UnsupportedChainIdError, useWeb3React } from '@web3-react/core'
import { darken, lighten } from 'polished'
import React, { useMemo } from 'react'
import { useMemo } from 'react'
import { Activity } from 'react-feather'
import { t, Trans } from '@lingui/macro'
import styled, { css } from 'styled-components'

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import Modal from '../Modal'
import { AutoColumn, ColumnCenter } from '../Column'
@@ -192,7 +192,7 @@ export default function AddressClaimModal({ isOpen, onDismiss }: { isOpen: boole
)}
{attempting && hash && !claimConfirmed && chainId && hash && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)} style={{ zIndex: 99 }}>
<Trans>View transaction on Etherscan</Trans>
<Trans>View transaction on Explorer</Trans>
</ExternalLink>
)}
</AutoColumn>

View File

@@ -1,7 +1,7 @@
import JSBI from 'jsbi'
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { isAddress } from 'ethers/lib/utils'
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { Text } from 'rebass'
import styled from 'styled-components/macro'
import Circle from '../../assets/images/blue-loader.svg'
@@ -221,7 +221,7 @@ export default function ClaimModal() {
href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)}
style={{ zIndex: 99 }}
>
<Trans>View transaction on Etherscan</Trans>
<Trans>View transaction on Explorer</Trans>
</ExternalLink>
)}
</AutoColumn>

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import Modal from '../Modal'
import { AutoColumn } from '../Column'
import styled from 'styled-components/macro'

View File

@@ -1,4 +1,3 @@
import React from 'react'
import { AutoColumn } from '../Column'
import { RowBetween } from '../Row'
import styled from 'styled-components/macro'

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback } from 'react'
import { useState, useCallback } from 'react'
import { useV2LiquidityTokenPermit } from '../../hooks/useERC20Permit'
import useTransactionDeadline from '../../hooks/useTransactionDeadline'
import { formatCurrencyAmount } from '../../utils/formatCurrencyAmount'

Some files were not shown because too many files have changed in this diff Show More