diff --git a/.env b/.env index ce235f433..f6f801fd5 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ REACT_APP_CHAIN_ID="137" -REACT_APP_NETWORK_URL="https://rpc-mainnet.matic.network" +REACT_APP_NETWORK_URL="https://polygon-rpc.com/" REACT_APP_GOOGLE_ANALYTICS_ID="UA-188438708-1" IPFS_DEPLOY_PINATA__API_KEY=16f568d2ab3bbb712be5 IPFS_DEPLOY_PINATA__SECRET_API_KEY=d17f8f50c3e6a633b12843890a8fb537908f0632f642bc9b97e54f3ac321ecbb @@ -7,3 +7,4 @@ REACT_APP_PORTIS_ID="e086c1f2-2d26-4443-804f-3398bbab069e" REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF" REACT_APP_MOONPAY_KEY="pk_live_72EGoobLnlgc8WB7AaxyiWu2S43dj8eY" REACT_APP_TRANSAK_KEY="258960cf-1e17-4419-bf7f-77443282f5da" +REACT_APP_GRAPH_API_URL="https://polygon.furadao.org/subgraphs/name/quickswap" \ No newline at end of file diff --git a/.env.production b/.env.production index b3a6ce89a..c9bebbc3b 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,4 @@ REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF" REACT_APP_GOOGLE_ANALYTICS_ID="UA-188438708-1" REACT_APP_MOONPAY_KEY="pk_live_72EGoobLnlgc8WB7AaxyiWu2S43dj8eY" REACT_APP_TRANSAK_KEY="258960cf-1e17-4419-bf7f-77443282f5da" +REACT_APP_GRAPH_API_URL="https://polygon.furadao.org/subgraphs/name/quickswap" \ No newline at end of file diff --git a/README.md b/README.md index b424e2fb8..95c1e8e89 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Enabling users to: Useful links: - Website: [quickswap.exchange](https://quickswap.exchange/) +- Beta: [beta.quickswap.exchange](https://beta.quickswap.exchange/) - Info: [info.quickswap.exchange](https://info.quickswap.exchange) - Twitter: [@QuickswapDEX](https://twitter.com/QuickswapDEX) - Reddit: [/r/QuickSwap](https://www.reddit.com/r/QuickSwap) diff --git a/package.json b/package.json index 51b766714..d51d2f88f 100755 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "hamburger-react": "^2.4.1", "i18next": "^20.4.0", "i18next-browser-languagedetector": "^6.1.2", - "i18next-xhr-backend": "^3.2.2", "ipfs-deploy": "^11.1.0", "lodash.flatmap": "^4.5.0", "multicodec": "^3.0.1", @@ -98,7 +97,10 @@ "glob-parent": "^5.1.2", "browserslist": "^4.16.5", "ajv": "^6.12.3", - "async": "^3.2.2" + "async": "^3.2.2", + "ejs": "^3.1.7", + "cross-fetch": "^3.1.5", + "eventsource": "^2.0.2" }, "scripts": { "analyze": "source-map-explorer 'build/static/js/*.js'", @@ -134,11 +136,15 @@ "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.60", "apexcharts": "3.32.1", + "i18next-http-backend": "^1.4.1", "react-apexcharts": "1.3.9", "react-cool-inview": "^2.0.8", "react-error-overlay": "^6.0.10", "react-ga": "^3.3.0", + "react-reflex": "^4.0.6", "react-slick": "^0.28.1", + "react-virtuoso": "^2.8.4", + "sass": "^1.51.0", "slick-carousel": "^1.8.1", "styled-components": "^5.3.3" } diff --git a/public/locales/de.json b/public/locales/de.json index d252e5ada..373e95293 100755 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -1,89 +1,21 @@ { - "noWallet": "Keine Ethereum-Wallet gefunden", - "wrongNetwork": "Du bist auf dem falschen Netzwerk.", - "switchNetwork": "Bitte wechsle zum {{ correctNetwork }}", - "installWeb3MobileBrowser": "Bitte besuche uns mit einem web3-fähigen mobilen Browser wie z.B. Trust Wallet oder Coinbase Wallet.", - "installMetamask": "Bitte besuch uns erneut, nachdem du Metamask oder Brave installiert hast.", - "disconnected": "Nicht verbunden", "swap": "Tauschen", - "swapAnyway": "Trotzdem tauschen", - "send": "Senden", - "sendAnyway": "Trotzdem senden", "pool": "Pool", - "betaWarning": "Dieses Projekt ist in beta. Nutzung auf eigenes Risiko.", "input": "Input", "output": "Output", - "estimated": "geschätzt", - "balance": "Guthaben: {{ balanceInput }}", - "unlock": "Freischalten", "pending": "hängige", - "selectToken": "Token auswählen", - "searchOrPaste": "Token Name, Symbol oder Adresse suchen", - "searchOrPasteMobile": "Name, Symbol oder Adresse", - "noExchange": "Exchange nicht gefunden", - "exchangeRate": "Wechselkurs", - "invertedRate": "Invertierter Wechselkurs", "unknownError": "Oops! Ein unbekannter Fehler ist aufgetreten. Bitte Seite neu laden oder uns von einem anderen Browser oder Gerät erneut besuchen.", - "enterValueCont": "Wert {{ missingCurrencyValue }} eingeben um fortzufahren.", - "selectTokenCont": "Token auswählen um fortzufahren.", "noLiquidity": "Keine Liquidität.", - "insufficientLiquidity": "Liquidität ungenügend.", - "unlockTokenCont": "Token freischalten um fortzufahren.", - "transactionDetails": "Details der Transaktion", - "hideDetails": "Details ausblenden", - "slippageWarning": "Wechselkursrutsch", - "highSlippageWarning": "Hoher Wechselkursrutsch", - "youAreSelling": "Du verkaufst", - "orTransFail": "oder die Transaktion wird fehlschlagen.", "youWillReceive": "Du erhältst mindestens", - "youAreBuying": "Du kaufst", - "itWillCost": "Es kostet höchstens", - "forAtMost": "für maximal", - "insufficientBalance": "Guthaben ungenügend", - "inputNotValid": "Eingabewert ungültig", - "differentToken": "Es müssen unterschiedliche Token sein.", - "noRecipient": "Empfängeradresse angeben.", - "invalidRecipient": "Bitte gib eine gültige Empfängeradresse an.", - "recipientAddress": "Adresse des Empfängers", - "youAreSending": "Du schickst", - "willReceive": "erhält mindestens", "to": "zu", "addLiquidity": "Liquidität hinzufügen", "deposit": "Depot", - "currentPoolSize": "Aktuelle Größe des Pools", "yourPoolShare": "Dein Anteil am Pool", - "noZero": "Wert darf nicht Null sein.", - "mustBeETH": "Einer der Inputs muß ETH sein.", - "enterCurrencyOrLabelCont": "{{ inputCurrency }} oder {{ label }} Wert eingeben um fortzufahren.", - "youAreAdding": "Du fügst zwischen", "and": "und", - "intoPool": "in den Liquiditätspool.", - "outPool": "vom Liquiditätspool.", - "youWillMint": "Du prägst", - "liquidityTokens": "Liquiditätstokens.", - "totalSupplyIs": "Die gesamte Anzahl Liquiditätstokens ist aktuell", - "youAreSettingExRate": "Du setzt den anfänglichen Wechselkurs auf", - "totalSupplyIs0": "Die gesamte Anzahl Liquiditätstokens ist aktuell 0.", - "tokenWorth": "Zum gegenwärtigen Wechselkurs ist jeder Pool Token so viel Wert", - "firstLiquidity": "Du bist die erste Person die Liquidität bereitstellt!", - "initialExchangeRate": "Der initiale Wechselkurs wird auf deiner Überweisung basieren. Stelle sicher, dass deine ETH und {{ label }} denselben Fiatwert haben.", "removeLiquidity": "Liquidität entfernen", - "poolTokens": "Pool Tokens", - "enterLabelCont": "{{ label }} Wert eingeben um fortzufahren.", - "youAreRemoving": "Du entfernst zwischen", - "youWillRemove": "Du entfernst", - "createExchange": "Exchange erstellen", - "invalidTokenAddress": "Ungültige Tokenadresse", - "exchangeExists": "{{ label }} Exchange existiert bereits!", - "invalidSymbol": "Symbol ungültig", - "invalidDecimals": "Dezimalstellen ungültig", "tokenAddress": "Tokenadresse", "label": "Label", "name": "Name", "symbol": "Symbol", - "decimals": "Dezimalstellen", - "enterTokenCont": "Tokenadresse eingeben um fortzufahren", - "priceChange": "Geschätzter Wechselkursrutsch", - "forAtLeast": "für mindestens ", - "brokenToken": "Der ausgewählte Token ist nicht kompatibel mit Uniswap V1. Liquidität hinzufügen wird zu nicht mehr zugänglichen Token führen!" + "decimals": "Dezimalstellen" } diff --git a/public/locales/en.json b/public/locales/en.json index 80ce9dc34..f5a3122a3 100755 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -1,91 +1,4 @@ { - "noWallet": "No Ethereum wallet found", - "wrongNetwork": "You are on the wrong network", - "switchNetwork": "Please switch to {{ correctNetwork }}", - "installWeb3MobileBrowser": "Please visit us from a web3-enabled mobile browser such as Trust Wallet or Coinbase Wallet.", - "installMetamask": "Please visit us after installing Metamask on Chrome or Brave.", - "disconnected": "Disconnected", - "swap": "Swap", - "swapAnyway": "Swap Anyway", - "send": "Send", - "sendAnyway": "Send Anyway", - "pool": "Pool", - "betaWarning": "This project is in beta. Use at your own risk.", - "input": "Input", - "output": "Output", - "estimated": "estimated", - "balance": "Balance: {{ balanceInput }}", - "unlock": "Unlock", - "pending": "Pending", - "selectToken": "Select a token", - "searchOrPaste": "Search Token Name, Symbol, or Address", - "searchOrPasteMobile": "Name, Symbol, or Address", - "noExchange": "No Exchange Found", - "noToken": "No Token Found", - "exchangeRate": "Exchange Rate", - "unknownError": "Oops! An unknown error occurred. Please refresh the page, or visit from another browser or device.", - "enterValueCont": "Enter a {{ missingCurrencyValue }} value to continue.", - "selectTokenCont": "Select a token to continue.", - "noLiquidity": "No liquidity.", - "insufficientLiquidity": "Insufficient liquidity.", - "unlockTokenCont": "Please unlock token to continue.", - "transactionDetails": "Advanced Details", - "hideDetails": "Hide Details", - "slippageWarning": "Slippage Warning", - "highSlippageWarning": "High Slippage Warning", - "youAreSelling": "You are selling", - "orTransFail": "or the transaction will fail.", - "youWillReceive": "You will receive at least", - "youAreBuying": "You are buying", - "itWillCost": "It will cost at most", - "forAtMost": "for at most", - "inputNotValid": "Not a valid input value", - "differentToken": "Must be different token.", - "noRecipient": "Enter a wallet address to send to.", - "invalidRecipient": "Please enter a valid wallet address recipient.", - "recipientAddress": "Recipient Address", - "youAreSending": "You are sending", - "willReceive": "will receive at least", - "to": "to", - "addLiquidity": "Add Liquidity", - "deposit": "Deposit", - "currentPoolSize": "Current Pool Size", - "yourPoolShare": "Your Pool Share", - "noZero": "Amount cannot be zero.", - "mustBeETH": "One of the input must be ETH.", - "enterCurrencyOrLabelCont": "Enter a {{ inputCurrency }} or {{ label }} value to continue.", - "youAreAdding": "You are adding", - "and": "and", - "intoPool": "into the liquidity pool.", - "outPool": "from the liquidity pool.", - "youWillMint": "You will mint", - "liquidityTokens": "liquidity tokens.", - "totalSupplyIs": "Current total supply of liquidity tokens is", - "youAreSettingExRate": "You are setting the initial exchange rate to", - "totalSupplyIs0": "Current total supply of liquidity tokens is 0.", - "tokenWorth": "At current exchange rate, each pool token is worth", - "firstLiquidity": "You are the first person to add liquidity!", - "initialExchangeRate": "The initial exchange rate will be set based on your deposits. Please make sure that your ETH and {{ label }} deposits have the same fiat value.", - "removeLiquidity": "Remove Liquidity", - "poolTokens": "Pool Tokens", - "enterLabelCont": "Enter a {{ label }} value to continue.", - "youAreRemoving": "You are removing between", - "youWillRemove": "You will remove", - "createExchange": "Create Exchange", - "invalidTokenAddress": "Not a valid token address", - "exchangeExists": "{{ label }} Exchange already exists!", - "invalidSymbol": "Invalid symbol", - "invalidDecimals": "Invalid decimals", - "tokenAddress": "Token Address", - "label": "Label", - "name": "Name", - "symbol": "Symbol", - "decimals": "Decimals", - "enterTokenCont": "Enter a token address to continue", - "priceChange": "Expected price slippage", - "forAtLeast": "for at least ", - "brokenToken": "The selected token is not compatible with Uniswap V1. Adding liquidity will result in locked funds.", - "toleranceExplanation": "Lowering this limit decreases your risk of frontrunning. However, this makes more likely that your transaction will fail due to normal price movements.", "tokenSearchPlaceholder": "Search name or paste address", "txnSwapMessage": "Swap {{ token0Symbol }} for {{ token1Symbol }}", "txnAddMessage": "Add {{ token0Symbol }} and {{ token1Symbol }}", @@ -162,7 +75,7 @@ "claiming": "Claiming", "claim": "Claim", "convert": "Convert", - "convertQUICK": "Convert your QUICK(old) to QUICK(new). Read more about QUICK token split <1>here", + "convertQUICK": "Convert your QUICK(OLD) to QUICK(NEW). Read more about QUICK token split here.", "conversionRate": "Conversion Rate", "yourbalance": "Your balance", "youwillreceive": "You will receive", @@ -172,5 +85,117 @@ "convertingQUICKtoQUICKV2": "Converting {{ quickAmount }} QUICK -> {{ quickV2Amount }} QUICK-v2", "convertedQUICKtoQUICKV2": "Converted {{ quickAmount }} QUICK -> {{ quickV2Amount }} QUICK-v2", "submittedTxQUICKConvert": "Submitted Transction to convert {{ quickAmount }} QUICK -> {{ quickV2Amount }} QUICK-v2", - "successConvertedQUICKtoQUICKV2": "Sucessfully Converted {{ quickAmount }} QUICK -> {{ quickV2Amount }} QUICK-v2" + "successConvertedQUICKtoQUICKV2": "Sucessfully Converted {{ quickAmount }} QUICK -> {{ quickV2Amount }} QUICK-v2", + "totalValueLocked": "Total Value Locked", + "topAssetExchange": "Top Asset Exchange on the Polygon Network", + "buyCryptoFiat": "Buy crypto with Fiat", + "buyCryptoFiatDesc": "Simple way to buy or sell crypto with a credit card, bank transfer and more", + "buyNow": "Buy Now", + "enterApp": "Enter App", + "swap": "Swap", + "liquidity": "Liquidity", + "swapSectionShortDesc": "Swap tokens at near-zero gas fees", + "liquiditySectionShortDesc": "Let your crypto work for you", + "swapSectionLongDesc": "Deposit your Liquidity Provider tokens to receive Rewards in $QUICK on top of LP Fees.", + "liquiditySectionLongDesc": "Provide Liquidity and earn 0.25% fee on all trades proportional to your share of the pool. Earn additional rewards by depositing your LP Tokens in Rewards Pools.", + "24hTxs": "24h Transactions", + "24hTradingVol": "24H TRADING VOLUME", + "24hRewardsDistributed": "24H REWARDS DISTRIBUTED", + "totalTradingPairs": "TOTAL TRADING PAIRS", + "stake": "Stake", + "24hVol": "24H Volume", + "liquidityPools": "Liquidity Pools", + "all": "All", + "transactions": "Transactions", + "buys": "Buys", + "sells": "Sells", + "volume": "Volume", + "market": "Market", + "limit": "Limit", + "proMode": "Pro Mode", + "limitOrderDisclaimer": "* Disclaimer: Limit Orders on QuickSwap are provided by Gelato, a 3rd party protocol and should be considered in beta. DYOR and use at your own risk. QuickSwap is not responsible. More info can be found here.", + "date": "date", + "type": "type", + "usd": "usd", + "price": "Price", + "txn": "txn", + "chart": "chart", + "trades": "trades", + "info": "info", + "left": "left", + "right": "right", + "none": "none", + "hour": "h", + "min": "m", + "supplyLiquidityHelp": "When you add liquidity, you are given pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time.", + "yourliquidityPools": "Your Liquidity Pools", + "poolMissingComment": "Don’t see a pool you joined? Import it.
Unstake your LP Tokens from Farms to see them here.", + "farm": "Farm", + "help": "Help", + "lpMining": "LP Mining", + "dualMining": "Dual Mining", + "totalRewards": "Total Rewards", + "fees24h": "Fees [24h]", + "rewardRate": "Reward Rate", + "stakedOnly": "Staked Only", + "active": "Active", + "ended": "Ended", + "stakeMessageLP": "Stake LP Tokens to earn dQUICK + Pool Fees", + "stakeMessageDual": "Stake LP Tokens to earn dQUICK + WMATIC rewards", + "search": "Search", + "searchPlaceHolder": "Search name, symbol or paste address", + "sortBy": "Sort By", + "sortdesc": "Sort Desc", + "sortasc": "Sort Asc", + "pool": "Pool", + "input": "Input", + "output": "Output", + "pending": "Pending", + "unknownError": "Oops! An unknown error occurred. Please refresh the page, or visit from another browser or device.", + "noLiquidity": "No liquidity.", + "youWillReceive": "You will receive at least", + "to": "to", + "addLiquidity": "Add Liquidity", + "deposit": "Deposit", + "yourPoolShare": "Your Pool Share", + "and": "and", + "removeLiquidity": "Remove Liquidity", + "tokenAddress": "Token Address", + "label": "Label", + "name": "Name", + "symbol": "Symbol", + "decimals": "Decimals", + "quickswapAnalytics": "Quickswap Analytics", + "tokens": "Tokens", + "pairs": "Pairs", + "overview": "Overview", + "24hFees": "24h Fees", + "topTokens": "Top Tokens", + "seeAll": "See All", + "topPairs": "Top Pairs", + "allPairs": "All Pairs", + "allCryptos": "All Cryptos", + "favourites": "Favourites", + "newListing": "New Listing", + "24hr": "24hr", + "dayAbb": "D", + "weekAbb": "W", + "fees": "Fees", + "totalTokensLocked": "Total Tokens Locked", + "7dTradingVol": "7d Trading Vol", + "totalLiquidity": "Total Liquidity", + "24hTradingVol1": "24h Trading Vol", + "contractAddress": "Contract Address", + "pools": "Pools", + "dragonAlertDesc": "As of May 2022, you can stake QUICK(NEW) in Syrup Pools. Note that there are some Syrup Pools that will still accept QUICK(OLD) for staking, until they run out of rewards.", + "dragonLairTitle": "Stake QUICK to earn QUICK", + "dragonSyrup": "Dragon’s Syrup", + "dragonSyrupTitle": "Earn tokens of your choice over time", + "stakeQUICKTitle": "Single Stake — Auto compounding", + "total": "Total", + "yourdeposits": "Your Deposits", + "unstake": "Unstake", + "unstakeQUICKDesc": "⭐️ When you unstake, the contract will automatically claim QUICK on your behalf.", + "earn": "Earn", + "apr": "APR" } diff --git a/public/locales/es-AR.json b/public/locales/es-AR.json index 6b54ab0b2..19b006f50 100755 --- a/public/locales/es-AR.json +++ b/public/locales/es-AR.json @@ -1,75 +1,18 @@ { - "noWallet": "No se encontró billetera de Ethereum", - "wrongNetwork": "Te encontrás en la red equivocada", - "switchNetwork": "Por favor cambia a {{ correctNetwork }}", - "installWeb3MobileBrowser": "Por favor ingresá desde un navegador móvil con web3 habilitado como Trust Wallet o Coinbase Wallet.", - "installMetamask": "Por favor visítanos nuevamente luego de instalar Metamask en Chrome o Brave.", - "disconnected": "Desconectado", "swap": "Intercambiar", - "send": "Enviar", "pool": "Pool", - "betaWarning": "Este proyecto se encuentra en beta. Usalo bajo tu propio riesgo.", "input": "Entrada", "output": "Salida", - "estimated": "estimado", - "balance": "Saldo: {{ balanceInput }}", - "unlock": "Desbloquear", "pending": "Pendiente", - "selectToken": "Seleccioná un token", - "searchOrPaste": "Buscar Token o Pegar Dirección", - "noExchange": "No se encontró la divisa", - "exchangeRate": "Tasa de Cambio", - "enterValueCont": "Ingresá un valor en {{ missingCurrencyValue }} para continuar.", - "selectTokenCont": "Seleccioná un token para continuar.", "noLiquidity": "Sin liquidez.", - "unlockTokenCont": "Por favor desbloqueá un token para continuar.", - "transactionDetails": "Detalles de la transacción", - "hideDetails": "Ocultar detalles", - "youAreSelling": "Estás vendiendo", - "orTransFail": "o la transacción fallará.", "youWillReceive": "Vas a recibir al menos", - "youAreBuying": "Estás comprando", - "itWillCost": "Costará a lo sumo", - "insufficientBalance": "Saldo insuficiente", - "inputNotValid": "No es un valor de entrada válido", - "differentToken": "Debe ser un token distinto.", - "noRecipient": "Ingresá una dirección de billetera para enviar.", - "invalidRecipient": "Por favor ingrese una billetera de destino válida.", - "recipientAddress": "Dirección del recipiente", - "youAreSending": "Estás enviando", - "willReceive": "recibirá al menos", "to": "a", "addLiquidity": "Agregar liquidez", "deposit": "Depositar", - "currentPoolSize": "Tamaño del Pool Actual", "yourPoolShare": "Tu parte del Pool", - "noZero": "El monto no puede ser cero.", - "mustBeETH": "Una de las entradas debe ser ETH.", - "enterCurrencyOrLabelCont": "Ingresá un valor de {{ inputCurrency }} o de {{ label }} para continuar.", - "youAreAdding": "Estás agregando entre", "and": "y", - "intoPool": "en el pool de liquidez.", - "outPool": "en el pool de liquidez.", - "youWillMint": "Vas a acuñar", - "liquidityTokens": "tokens de liquidez.", - "totalSupplyIs": "El actual suministro total de tokens de liquidez es", - "youAreSettingExRate": "Está configurando el tipo de cambio inicial a", - "totalSupplyIs0": "El actual suministro total de tokens de liquidez es 0.", - "tokenWorth": "Al tipo de cambio actual, cada token del pool vale", - "firstLiquidity": "Sos la primer persona en agregar liquidez!", - "initialExchangeRate": "El tipo de cambio inicial se establecerá en función de tus depósitos. Por favor, asegúrate de que tus depósitos en ETH y {{ label }} tengan el mismo valor fíat.", "removeLiquidity": "Remover Liquidez", - "poolTokens": "Pool de Tokens", - "enterLabelCont": "Ingresá un valor de {{ label }} para continuar.", - "youAreRemoving": "Estás quitando entre", - "youWillRemove": "Vas a remover", - "createExchange": "Crear divisa", - "invalidTokenAddress": "No es una dirección de token válida", - "exchangeExists": "La divisa {{ label }} ya existe!", - "invalidSymbol": "Símbolo inválido", - "invalidDecimals": "Decimales inválidos", "tokenAddress": "Dirección de Token", "label": "Etiqueta", - "decimals": "Decimales", - "enterTokenCont": "Ingresá una dirección de token para continuar" + "decimals": "Decimales" } diff --git a/public/locales/es-US.json b/public/locales/es-US.json index 7dbd5566d..d23b07a62 100755 --- a/public/locales/es-US.json +++ b/public/locales/es-US.json @@ -1,75 +1,18 @@ { - "noWallet": "No se ha encontrado billetera de Ethereum", - "wrongNetwork": "Se encuentra en la red equivocada", - "switchNetwork": "Por favor cambie a {{ correctNetwork }}", - "installWeb3MobileBrowser": "Por favor ingrese desde un navegador móvil con web3 habilitado como Trust Wallet o Coinbase Wallet.", - "installMetamask": "Por favor visítenos nuevamente luego de instalar Metamask en Chrome o Brave.", - "disconnected": "Desconectado", "swap": "Intercambiar", - "send": "Enviar", "pool": "Pool", - "betaWarning": "Este proyecto se encuentra en beta. Úselo bajo tu propio riesgo.", "input": "Entrada", "output": "Salida", - "estimated": "estimado", - "balance": "Saldo: {{ balanceInput }}", - "unlock": "Desbloquear", "pending": "Pendiente", - "selectToken": "Seleccione un token", - "searchOrPaste": "Buscar Token o Pegar Dirección", - "noExchange": "No se ha encontrado la divisa", - "exchangeRate": "Tasa de Cambio", - "enterValueCont": "Ingrese un valor en {{ missingCurrencyValue }} para continuar.", - "selectTokenCont": "Seleccione un token para continuar.", "noLiquidity": "Sin liquidez.", - "unlockTokenCont": "Por favor desbloquea un token para continuar.", - "transactionDetails": "Detalles de la transacción", - "hideDetails": "Ocultar detalles", - "youAreSelling": "Está vendiendo", - "orTransFail": "o la transacción fallará.", "youWillReceive": "Va a recibir al menos", - "youAreBuying": "Está comprando", - "itWillCost": "Costará a lo sumo", - "insufficientBalance": "Saldo insuficiente", - "inputNotValid": "No es un valor de entrada válido", - "differentToken": "Debe ser un token distinto.", - "noRecipient": "Ingrese una dirección de billetera para enviar.", - "invalidRecipient": "Por favor ingrese una billetera de destino válida.", - "recipientAddress": "Dirección del recipiente", - "youAreSending": "Está enviando", - "willReceive": "recibirá al menos", "to": "a", "addLiquidity": "Agregar liquidez", "deposit": "Depositar", - "currentPoolSize": "Tamaño del Pool Actual", "yourPoolShare": "Su parte del Pool", - "noZero": "El monto no puede ser cero.", - "mustBeETH": "Una de las entradas debe ser ETH.", - "enterCurrencyOrLabelCont": "Ingrese un valor de {{ inputCurrency }} o de {{ label }} para continuar.", - "youAreAdding": "Está agregando entre", "and": "y", - "intoPool": "en el pool de liquidez.", - "outPool": "en el pool de liquidez.", - "youWillMint": "Va a acuñar", - "liquidityTokens": "tokens de liquidez.", - "totalSupplyIs": "El actual suministro total de tokens de liquidez es", - "youAreSettingExRate": "Está configurando el tipo de cambio inicial a", - "totalSupplyIs0": "El actual suministro total de tokens de liquidez es 0.", - "tokenWorth": "Al tipo de cambio actual, cada token del pool vale", - "firstLiquidity": "Es la primer persona en agregar liquidez!", - "initialExchangeRate": "El tipo de cambio inicial se establecerá en función de sus depósitos. Por favor, asegúrese de que sus depósitos en ETH y {{ label }} tengan el mismo valor fíat.", "removeLiquidity": "Remover Liquidez", - "poolTokens": "Pool de Tokens", - "enterLabelCont": "Ingresa un valor de {{ label }} para continuar.", - "youAreRemoving": "Está quitando entre", - "youWillRemove": "Va a remover", - "createExchange": "Crear tipo de cambio", - "invalidTokenAddress": "No es una dirección de token válida", - "exchangeExists": "El tipo de cambio {{ label }} ya existe!", - "invalidSymbol": "Símbolo inválido", - "invalidDecimals": "Decimales inválidos", "tokenAddress": "Dirección de Token", "label": "Etiqueta", - "decimals": "Decimales", - "enterTokenCont": "Ingrese una dirección de token para continuar" + "decimals": "Decimales" } diff --git a/public/locales/it-IT.json b/public/locales/it-IT.json index 41ffe99e8..24070ce6e 100755 --- a/public/locales/it-IT.json +++ b/public/locales/it-IT.json @@ -1,87 +1,21 @@ { - "noWallet": "Wallet Ethereum non trovato", - "wrongNetwork": "Sei connesso alla rete sbagliata", - "switchNetwork": "Perfavore connettiti su {{ correctNetwork }}", - "installWeb3MobileBrowser": "Perfavore visita il sito da un browser abilitato web3 o da un app mobile come Trust Wallet o Coinbase Wallet.", - "installMetamask": "Perfavore ritorna dopo aver installato Metamask su Chrome o Brave.", - "disconnected": "Disconnesso", "swap": "Scambia", - "swapAnyway": "Scambia comunque", - "send": "Invia", - "sendAnyway": "Invia comunque", "pool": "Riserva", - "betaWarning": "Questo progetto è in beta. Usalo a tuo rischio.", "input": "Input", "output": "Output", - "estimated": "stimato", - "balance": "Saldo: {{ balanceInput }}", - "unlock": "Sblocca", "pending": "In attesa", - "selectToken": "Seleziona un token", - "searchOrPaste": "Cerca Nome, Simbolo o Indirizzo Token", - "searchOrPasteMobile": "Nome, Simbolo, o Indirizzo", - "noExchange": "Nessun Exchange Trovato", - "exchangeRate": "Tasso di cambio", "unknownError": "Oops! Si è verificato un Errore imprevisto. Aggiorna la pagina o visita da un altro browser o dispositivo.", - "enterValueCont": "Inserisci un valore {{ missingCurrencyValue }} per continuare.", - "selectTokenCont": "Seleziona un token per continuare.", "noLiquidity": "Nessuna liquidità.", - "insufficientLiquidity": "Liquidità insufficiente.", - "unlockTokenCont": "Si prega di sbloccare il token per continuare.", - "transactionDetails": "Dettagli avanzati", - "hideDetails": "Nascondi dettagli", - "slippageWarning": "Avviso di scostamento", - "highSlippageWarning": "Avviso di elevato scostamento", - "youAreSelling": "Stai vendendo", - "orTransFail": "o la transazione fallità.", "youWillReceive": "Riceverai almeno", - "youAreBuying": "Stai comprando", - "itWillCost": "Costerà al massimo", - "forAtMost": "per al massimo", - "insufficientBalance": "Saldo insufficente", - "inputNotValid": "Non è un valore di input valido", - "differentToken": "Deve essere un token diverso.", - "noRecipient": "Inserisci un indirizzo di wallet a cui inviare.", - "invalidRecipient": "Inserisci un destinatario valido per l'indirizzo del wallet.", - "recipientAddress": "Indirizzo del destinatario", - "youAreSending": "Stai inviando", - "willReceive": "riceverà almeno", "to": "a", "addLiquidity": "Aggiungi liquidità", "deposit": "Depositare", - "currentPoolSize": "Dimensione attuale del pool", "yourPoolShare": "La tua parte di pool condivisa", - "noZero": "L'importo non può essere zero.", - "mustBeETH": "Uno degli input deve essere ETH.", - "enterCurrencyOrLabelCont": "Inserisci un valore {{ inputCurrency }} o {{ label }} per continuare.", - "youAreAdding": "Stai agginugendo", "and": "e", - "intoPool": "nella riserva di liquidità.", - "outPool": "dalla riserva di liquidità.", - "youWillMint": "Tu conierai", - "liquidityTokens": "token di liquidità.", - "totalSupplyIs": "L'attuale disponibilità totale di token di liquidità è", - "youAreSettingExRate": "Stai impostando il tasso di cambio iniziale su", - "totalSupplyIs0": "L'attuale disponibilità totale di token di liquidità è 0.", - "tokenWorth": "Al tasso di cambio corrente, ogni token del pool vale", - "firstLiquidity": "Sei la prima persona ad aggiungere liquidità!", - "initialExchangeRate": "Il tasso di cambio iniziale verrà impostato in base ai tuoi depositi. Assicurati che i tuoi depositi ETH e {{ label }} abbiano lo stesso valore fiat.", "removeLiquidity": "Rimuovi Liquidità", - "poolTokens": "Token Pool", - "enterLabelCont": "Inserisci un valore {{ label }} per continuare.", - "youAreRemoving": "Stai rimuovendo tra", - "youWillRemove": "Rimuoverai", - "createExchange": "Crea scambio", - "invalidTokenAddress": "Indirizzo token non valido", - "exchangeExists": "{{ label }} Exchange già esistente!", - "invalidSymbol": "Simbolo non valido", - "invalidDecimals": "Decimali non validi", "tokenAddress": "Indirizzo Token", "label": "Etichetta", "name": "Nome", "symbol": "Simbolo", - "decimals": "Decimali", - "enterTokenCont": "Inserire un indirizzo token per continuare", - "priceChange": "Scostamento del prezzo previsto", - "forAtLeast": "per almeno " + "decimals": "Decimali" } diff --git a/public/locales/iw.json b/public/locales/iw.json index a66030d78..5b3b8b928 100755 --- a/public/locales/iw.json +++ b/public/locales/iw.json @@ -1,75 +1,18 @@ { - "noWallet": "לא נמצא ארנק", - "wrongNetwork": "נבחרה רשת לא נכונה", - "switchNetwork": "{{ correctNetwork }} יש צורך לשנות את הרשת ל", - "installWeb3MobileBrowser": "יש צורך בארנק ווב3.0, תתקין מטאמאסק או ארנק דומה", - "installMetamask": " Metamask יש צורך להתקין תוסף מטאמאסק לדפדפן, חפשו בגוגל ", - "disconnected": "מנותק", "swap": "המרה", - "send": "שליחה", "pool": "להפקיד", - "betaWarning": "הפרויקט נמצא בשלב בטא, השתמשו באחריות", "input": "מוכר", "output": "אקבל", - "estimated": "הערכה", - "balance": "בארנק שלי {{ balanceInput }}", - "unlock": "שחרור נעילת ארנק", "pending": "ממתין לאישור", - "selectToken": "בחרו את הטוקן להמרה", - "searchOrPaste": "הכניסו שם או כתובת של טוקן לחיפוש", - "noExchange": "לא מתאפשרת המרה", - "exchangeRate": "שער המרה", - "enterValueCont": "כדי להמשיך {{ missingCurrencyValue }} הזינו ", - "selectTokenCont": "בחרו טוקן כדי להמשיך", "noLiquidity": "אין נזילות", - "unlockTokenCont": "יש צורך לאשר את הטוקן למסחר", - "transactionDetails": "פרטי הטרנזקציה", - "hideDetails": "הסתר פרטים נוספים", - "youAreSelling": "למכירה", - "orTransFail": "או שהטרנזקציה תיכשל", "youWillReceive": "תוצר המרה מינימלי", - "youAreBuying": "קונה", - "itWillCost": "זה יעלה", - "insufficientBalance": "אין בחשבון מספיק מטבעות", - "inputNotValid": "קלט לא תקין", - "differentToken": "יש צורך בטוקנים שונים", - "noRecipient": "לא הוכנסה כתובת ארנק יעד", - "invalidRecipient": "לא הוכנסה כתובת תקינה", - "recipientAddress": "כתובת יעד", - "youAreSending": "כמות לשליחה", - "willReceive": "יתקבל לכל הפחות", "to": "אל", "addLiquidity": "להוספת נזילות למאגר", "deposit": "הפקדה", - "currentPoolSize": "גודל מאגר הנזילות הכולל", "yourPoolShare": "חלקך במאגר הנזילות", - "noZero": "אפס אינו ערך תקין", - "mustBeETH": "ETH חייב להופיע באחד מהצדדים", - "enterCurrencyOrLabelCont": "כדי להמשיך {{ inputCurrency }} או {{ label }} הכנס", - "youAreAdding": "מתווספים למאגר", "and": "וגם", - "intoPool": "לתוך הנזילות", - "outPool": "מתוך", - "youWillMint": "יונפקו לכם", - "liquidityTokens": "טוקנים של נזילות", - "totalSupplyIs": "חלקך במאגר הנזילות", - "youAreSettingExRate": "שער ההמרה יקבע על ידך", - "totalSupplyIs0": "אין לך טוקנים של נזילות", - "tokenWorth": "שווי כל טוקן נזילות הינו", - "firstLiquidity": "אתה הראשוןה שמזרים נזילות למאגר", - "initialExchangeRate": "ושל האית'ר הינן בערך שווה {{ label }} תוודאו שההפקדה של הטוקן", "removeLiquidity": "הוצאה של נזילות", - "poolTokens": "טוקנים של מאגר הנזילות", - "enterLabelCont": "כדי להמשיך {{ label }} הכנס ", - "youAreRemoving": "יוסרו", - "youWillRemove": "יוסרו", - "createExchange": "ליצירת זוג מסחר", - "invalidTokenAddress": "כתובת טוקן לא נכונה", - "exchangeExists": "{{ label }} כבר קיים זוג המרה עבור", - "invalidSymbol": "תו שגוי", - "invalidDecimals": "ספרות עשרוניות שגויות", "tokenAddress": "כתובת הטוקן", "label": "שם", - "decimals": "ספרות עשרויות", - "enterTokenCont": "הכניסו כתובת טוקן כדי להמשיך" + "decimals": "ספרות עשרויות" } diff --git a/public/locales/ro.json b/public/locales/ro.json index e22650712..b60b142d0 100755 --- a/public/locales/ro.json +++ b/public/locales/ro.json @@ -1,75 +1,18 @@ { - "noWallet": "Niciun portofel Ethereum găsit", - "wrongNetwork": "Nu ești conectat la rețeaua corectă", - "switchNetwork": "Conectează-te te rog la {{ correctNetwork }}", - "installWeb3MobileBrowser": "Incearcă să vizitezi această pagina folosind un browser precum Trust Wallet sau Coinbase Wallet.", - "installMetamask": "Vizitează această pagină din nou după ce instalezi MetaMask în Chrome sau Brave", - "disconnected": "Deconectat", "swap": "Schimba", - "send": "Trimite", "pool": "Extrage", - "betaWarning": "Proiectul este încă în versiunea beta. Folosește-l cu grijă, riscul este al tău.", "input": "Input", "output": "Output", - "estimated": "estimat", - "balance": "Balanță: {{ balanceInput }}", - "unlock": "Deschide", "pending": "În Așteptare", - "selectToken": "Selectează un token", - "searchOrPaste": "Caută Token sau Setează Adresă", - "noExchange": "Niciun Exchange Găsit", - "exchangeRate": "Curs Valutar", - "enterValueCont": "Setează o valoare pentru {{ missingCurrencyValue }} pentru a continua.", - "selectTokenCont": "Selectează un token pentru a continua.", "noLiquidity": "Lichiditate Inexistentă.", - "unlockTokenCont": "Te rog deblochează tokenul pentru a continua.", - "transactionDetails": "Detalii Tranzacții", - "hideDetails": "Ascunde Detaili", - "youAreSelling": "Vinzi", - "orTransFail": "sau tranzacția va eșua.", "youWillReceive": "Vei primi cel puțin", - "youAreBuying": "Cumperi", - "itWillCost": "Va costa cel mult", - "insufficientBalance": "Balanță Insuficientă", - "inputNotValid": "Valoarea setată nu este validă", - "differentToken": "Trebuie să fie un token diferit.", - "noRecipient": "Setează o adresă de portofel pentru destinatar.", - "invalidRecipient": "Te rog setează o adresă de portofel validă pentru destinatar.", - "recipientAddress": "Adresa Destinatarului", - "youAreSending": "Trimiți", - "willReceive": "vei primi cel puțin", "to": "spre", "addLiquidity": "Crește Lichiditatea", "deposit": "Depozitează", - "currentPoolSize": "Mărimea Actualului Fond Comun", "yourPoolShare": "Partea Ta Din Fond Comun", - "noZero": "Cantitatea nu poate fi zero.", - "mustBeETH": "Una dintre valori trebuie să fie ETH.", - "enterCurrencyOrLabelCont": "Setează o valoare pentru {{ inputCurrency }} sau {{ label }} pentru a continua. ", - "youAreAdding": "Adaugi între", "and": "și", - "intoPool": "în fondul comun de lichidatate.", - "outPool": "din fondul comun de lichiditate.", - "youWillMint": "Vei printa", - "liquidityTokens": "tokene disponibile.", - "totalSupplyIs": "Actuala ofertă totală de tokene disponibile este", - "youAreSettingExRate": "Setezi cursul valutar inițial la", - "totalSupplyIs0": "Actuala ofertă totală de tokene disponibile este 0.", - "tokenWorth": "La acest schimb valutar, fiecare token disponibil este estimată la", - "firstLiquidity": "Ești prima persoană care aduce lichiditate!", - "initialExchangeRate": "Schimbul valutar inițial va fi setat în funcție de depozitul tău. Te rog asigură-te că depoziturile ETH și {{ label }} pe care le-ai făcut au aceeași valoare în monezi naționale.", "removeLiquidity": "Elimină Lichiditate", - "poolTokens": "Extrage Tokene", - "enterLabelCont": "Setează o valoare pentru {{ label }} pentru a continua.", - "youAreRemoving": "Elimini între", - "youWillRemove": "Vei elimina", - "createExchange": "Creează Exchange", - "invalidTokenAddress": "Adresă de token nu este validă", - "exchangeExists": "{{ label }} Exchange există deja!", - "invalidSymbol": "Simbol invalid!", - "invalidDecimals": "Zecimale invalidate", "tokenAddress": "Adresă Token", "label": "Denumire", - "decimals": "Zecimale", - "enterTokenCont": "Setează o adresă de token pentru a continua" + "decimals": "Zecimale" } diff --git a/public/locales/ru.json b/public/locales/ru.json index 6c6d3b034..7ae132fa7 100755 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -1,75 +1,18 @@ { - "noWallet": "Кошелек эфира не найден", - "wrongNetwork": "Некорректная сеть", - "switchNetwork": "Пожалуйста, перейдите в {{ correctNetwork }}", - "installWeb3MobileBrowser": "Пожалуйста, откройте в браузере с поддержкой web3, таком, как Trust Wallet или Coinbase Wallet.", - "installMetamask": "Пожалуйста, откройте в Chrome или Brave с установленным расширением Metamask.", - "disconnected": "Нет подключения", "swap": "Обменять", - "send": "Отправить", "pool": "Вложить", - "betaWarning": "Проект находится на стадии бета тестирования.", "input": "Ввести", "output": "Вывести", - "estimated": "по оценке", - "balance": "Баланс: {{ balanceInput }}", - "unlock": "Разблокировать", "pending": "Ожидание", - "selectToken": "Выберите токен", - "searchOrPaste": "Поиск токена или вставить адрес токена", - "noExchange": "Обмен не найден", - "exchangeRate": "Курс обмена", - "enterValueCont": "Введите {{ missingCurrencyValue }}, чтобы продолжить.", - "selectTokenCont": "Введите токен, чтобы продолжить.", "noLiquidity": "Нет ликвидности.", - "unlockTokenCont": "Пожалуйста, разблокируйте токен, чтобы продолжить.", - "transactionDetails": "Детали транзакции", - "hideDetails": "Скрыть подробности", - "youAreSelling": "Вы продаете", - "orTransFail": "или транзакция будет отклонена.", "youWillReceive": "Вы получите как минимум", - "youAreBuying": "Вы покупаете", - "itWillCost": "В крайнем случае это будет стоить", - "insufficientBalance": "Недостаточно средств", - "inputNotValid": "Некорректное значение", - "differentToken": "Должны быть разные токены.", - "noRecipient": "Введите адрес кошелька эфира, куда перечислить.", - "invalidRecipient": "Пожалуйста, введите корректный адрес кошелька получателя.", - "recipientAddress": "Адрес получателя", - "youAreSending": "Вы отправляете", - "willReceive": "получит как минимум", "to": "", "addLiquidity": "Добавить ликвидность", "deposit": "Вложить", - "currentPoolSize": "Текущий размер пула", "yourPoolShare": "Ваша доля в пуле", - "noZero": "Значение не может быть нулевым.", - "mustBeETH": "Одно из значений должно быть ETH.", - "enterCurrencyOrLabelCont": "Введите {{ inputCurrency }} или {{ label }}, чтобы продолжить.", - "youAreAdding": "Вы добавляете от", "and": "и", - "intoPool": "в пул ликвидности.", - "outPool": "из пула ликвидности.", - "youWillMint": "Вы произведёте", - "liquidityTokens": "токенов ликвидности.", - "totalSupplyIs": "Ваш объем токенов ликвидности", - "youAreSettingExRate": "Вы устанавливаете начальный курс обмена", - "totalSupplyIs0": "Ваш объем токенов ликвидности 0.", - "tokenWorth": "При текущем курсе, каждый токен пула оценивается в", - "firstLiquidity": "Вы первый, кто создаст ликвидность!", - "initialExchangeRate": "Начальный курс обмена будет установлен согласно вашим депозитам. Убедитесь, что ваши депозиты ETH и {{ label }} имеют одинаковое значение в валюте.", "removeLiquidity": "Убрать ликвидность", - "poolTokens": "Токены пула", - "enterLabelCont": "Введите {{ label }}, чтобы продолжить.", - "youAreRemoving": "Вы убираете в от", - "youWillRemove": "Вы уберёте", - "createExchange": "Создать обмен", - "invalidTokenAddress": "Некорректный адрес токена", - "exchangeExists": "{{ label }} Обмен уже существует!", - "invalidSymbol": "Некорректный символ", - "invalidDecimals": "Некорректное десятичное значение", "tokenAddress": "Адрес токена", "label": "Название", - "decimals": "Десятичное значение", - "enterTokenCont": "Чтобы продолжить, введите адрес токена" + "decimals": "Десятичное значение" } diff --git a/public/locales/vi.json b/public/locales/vi.json index a0fd69436..6ef7ff425 100755 --- a/public/locales/vi.json +++ b/public/locales/vi.json @@ -1,87 +1,21 @@ { - "noWallet": "Không tìm thấy ví tiền Ethereum", - "wrongNetwork": "Kết nối mạng không đúng", - "switchNetwork": "Vui lòng chuyển sang {{ correctNetwork }}", - "installWeb3MobileBrowser": "Vui lòng truy cập từ trình duyệt di động hỗ trợ web3 như là Ví Trust hoặc Ví Coinbase", - "installMetamask": "Vui lòng truy cập sau khi cài đặt Metamask trên Chrome hoặc Brave.", - "disconnected": "Ngắt kết nối rồi", "swap": "Hoán đổi", - "swapAnyway": "Tiếp tục hoán đổi?", - "send": "Gửi", - "sendAnyway": "Tiếp tục gửi?", "pool": "Chung vốn", - "betaWarning": "Dự án này đang trong giai đoạn thử nghiệm. Sử dụng có rủi ro của riêng bạn", "input": "Đầu vào", "output": "Đầu ra", - "estimated": "ước lượng", - "balance": "Số dư: {{ balanceInput }}", - "unlock": "Mở khóa", "pending": "Đang chờ xử lý", - "selectToken": "Chọn một đồng tiền ảo", - "searchOrPaste": "Tìm kiếm tên, biểu tượng, hoặc địa chỉ của đồng tiền ảo", - "searchOrPasteMobile": "Tên, Biểu tượng, hoặc Địa chỉ", - "noExchange": "Không tìm thấy giao dịch", - "exchangeRate": "Tỷ giá", "unknownError": "Rất tiếc! Xảy ra lỗi không xác định. Vui lòng làm mới trang, hoặc truy cập từ trình duyệt hay thiết bị khác.", - "enterValueCont": "Nhập một giá trị {{ missingCurrencyValue }} để tiếp tục.", - "selectTokenCont": "Chọn một đồng tiền ảo để tiếp tục.", "noLiquidity": "Không có tính thanh khoản.", - "insufficientLiquidity": "Không đủ tính thanh khoản.", - "unlockTokenCont": "Vui lòng mở khoá đồng tiền ảo để tiếp tục", - "transactionDetails": "Chi tiết nâng cao", - "hideDetails": "Ẩn chi tiết", - "slippageWarning": "Cảnh báo trượt giá", - "highSlippageWarning": "Cảnh báo trượt giá cao", - "youAreSelling": "Bạn đang bán", - "orTransFail": "hoặc giao dịch sẽ thất bại.", "youWillReceive": "Bạn sẽ nhận dược ít nhất là", - "youAreBuying": "Bạn đang mua", - "itWillCost": "Nó sẽ có giá cao nhất", - "forAtMost": "nhiều nhất", - "insufficientBalance": "Số dư không đủ", - "inputNotValid": "Giá trị nhập vào không hợp lệ", - "differentToken": "Đồng tiền ảo phải khác nhau.", - "noRecipient": "Nhập địa chỉ ví để gửi đến.", - "invalidRecipient": "Vui lòng nhập một người nhận địa chỉ ví hợp lệ.", - "recipientAddress": "Địa chỉ người nhận", - "youAreSending": "Bạn đang gửi", - "willReceive": "sẽ nhận dược ít nhất là", "to": "đến", "addLiquidity": "Thêm tiền thanh khoản", "deposit": "Gửi tiền", - "currentPoolSize": "Quy mô hiện tại của quỹ", "yourPoolShare": "Phần hùn của bạn trong quỹ", - "noZero": "Số tiền không thể bằng không.", - "mustBeETH": "Một trong những đầu vào phải là ETH.", - "enterCurrencyOrLabelCont": "Nhập giá trị {{ inputCurrency }} hoặc {{ label }} để tiếp tục.", - "youAreAdding": "Bạn đang thêm", "and": "và", - "intoPool": "vào nhóm thanh khoản.", - "outPool": "từ nhóm thanh khoản.", - "youWillMint": "Bạn sẽ đúc tiền", - "liquidityTokens": "đồng thanh khoản.", - "totalSupplyIs": "Tổng cung hiện tại của đồng thanh khoản là", - "youAreSettingExRate": "Bạn đang đặt tỷ giá hối đoái ban đầu thành", - "totalSupplyIs0": "Tổng cung hiện tại của đồng thanh khoản là 0.", - "tokenWorth": "Tại tỷ giá hối đoái hiện tại, giá trị đồng token của quỹ là", - "firstLiquidity": "Bạn là người đầu tiên thêm thanh khoản!", - "initialExchangeRate": "Tỷ giá hối đoái ban đầu sẽ được thiết lập dựa trên tiền gửi của bạn. Vui lòng đảm bảo rằng tiền gửi ETH và {{ label }} của bạn có cùng giá trị tiền định danh.", "removeLiquidity": "Loại bỏ thanh khoản", - "poolTokens": "Đồng tiền ảo của quỹ", - "enterLabelCont": "Nhập giá trị {{ label }} để tiếp tục", - "youAreRemoving": "Bạn đang loại bỏ giữa", - "youWillRemove": "Bạn sẽ loại bỏ", - "createExchange": "Tạo giao dịch", - "invalidTokenAddress": "Địa chỉ đồng tiền điện tử không hợp lệ", - "exchangeExists": "{{ label }} Giao dịch đã tồn tại!", - "invalidSymbol": "Biểu tượng không hợp lệ", - "invalidDecimals": "Số thập phân không hợp lệ", "tokenAddress": "Địa chỉ đồng tiền điện tử", "label": "Nhãn", "name": "Tên", "symbol": "Biểu tượng", - "decimals": "Số thập phân", - "enterTokenCont": "Nhập địa chỉ đồng tiền ảo để tiếp tục", - "priceChange": "Trượt giá dự kiến", - "forAtLeast": "cho ít nhất " + "decimals": "Số thập phân" } diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 57d1d2d3c..6bf3cedf1 100755 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1,75 +1,18 @@ { - "noWallet": "未发现以太钱包", - "wrongNetwork": "网络错误", - "switchNetwork": "请切换到 {{ correctNetwork }}", - "installWeb3MobileBrowser": "请从支持web3的移动端浏览器,如 Trust Wallet 或 Coinbase Wallet 访问。", - "installMetamask": "请从安装了 Metamask 插件的 Chrome 或 Brave 访问。", - "disconnected": "未连接", "swap": "兑换", - "send": "发送", "pool": "资金池", - "betaWarning": "项目尚处于beta阶段。使用需自行承担风险。", "input": "输入", "output": "输出", - "estimated": "估计", - "balance": "余额: {{ balanceInput }}", - "unlock": "解锁", "pending": "处理中", - "selectToken": "选择通证", - "searchOrPaste": "搜索通证或粘贴地址", - "noExchange": "未找到交易所", - "exchangeRate": "兑换率", - "enterValueCont": "输入{{ missingCurrencyValue }}值并继续。", - "selectTokenCont": "选取通证继续。", "noLiquidity": "没有流动金。", - "unlockTokenCont": "请解锁通证并继续。", - "transactionDetails": "交易明细", - "hideDetails": "隐藏明细", - "youAreSelling": "你正在出售", - "orTransFail": "或交易失败。", "youWillReceive": "你将至少收到", - "youAreBuying": "你正在购买", - "itWillCost": "它将至少花费", - "insufficientBalance": "余额不足", - "inputNotValid": "无效的输入值", - "differentToken": "必须是不同的通证。", - "noRecipient": "输入接收钱包地址。", - "invalidRecipient": "请输入有效的收钱地址。", - "recipientAddress": "接收地址", - "youAreSending": "你正在发送", - "willReceive": "将至少收到", "to": "至", "addLiquidity": "添加流动金", "deposit": "存入", - "currentPoolSize": "当前资金池大小", "yourPoolShare": "你的资金池份额", - "noZero": "金额不能为零。", - "mustBeETH": "输入中必须有一个是 ETH。", - "enterCurrencyOrLabelCont": "输入 {{ inputCurrency }} 或 {{ label }} 值并继续。", - "youAreAdding": "你将添加", "and": "和", - "intoPool": "入流动资金池。", - "outPool": "出流动资金池。", - "youWillMint": "你将铸造", - "liquidityTokens": "流动通证。", - "totalSupplyIs": "当前流动通证的总量是", - "youAreSettingExRate": "你将初始兑换率设置为", - "totalSupplyIs0": "当前流动通证的总量是0。", - "tokenWorth": "当前兑换率下,每个资金池通证价值", - "firstLiquidity": "你是第一个添加流动金的人!", - "initialExchangeRate": "初始兑换率将由你的存入情况决定。请确保你存入的 ETH 和 {{ label }} 具有相同的总市值。", "removeLiquidity": "删除流动金", - "poolTokens": "资金池通证", - "enterLabelCont": "输入 {{ label }} 值并继续。", - "youAreRemoving": "你正在移除", - "youWillRemove": "你将移除", - "createExchange": "创建交易所", - "invalidTokenAddress": "通证地址无效", - "exchangeExists": "{{ label }} 交易所已存在!", - "invalidSymbol": "通证符号无效", - "invalidDecimals": "小数位数无效", "tokenAddress": "通证地址", "label": "通证符号", - "decimals": "小数位数", - "enterTokenCont": "输入通证地址并继续" + "decimals": "小数位数" } diff --git a/public/locales/zh-TW.json b/public/locales/zh-TW.json index 0bf94f4e7..fb2d72162 100755 --- a/public/locales/zh-TW.json +++ b/public/locales/zh-TW.json @@ -1,75 +1,18 @@ { - "noWallet": "未偵測到以太坊錢包", - "wrongNetwork": "你位在錯誤的網路", - "switchNetwork": "請切換到 {{ correctNetwork }}", - "installWeb3MobileBrowser": "請安裝含有 web3 瀏覽器的手機錢包,如 Trust Wallet 或 Coinbase Wallet。", - "installMetamask": "請使用 Chrome 或 Brave 瀏覽器安裝 Metamask。", - "disconnected": "未連接", "swap": "兌換", - "send": "發送", "pool": "資金池", - "betaWarning": "本產品仍在測試階段。使用者需自負風險。", "input": "輸入", "output": "輸出", - "estimated": "估計", - "balance": "餘額: {{ balanceInput }}", - "unlock": "解鎖", "pending": "處理中", - "selectToken": "選擇代幣", - "searchOrPaste": "選擇代幣或輸入地址", - "noExchange": "找不到交易所", - "exchangeRate": "匯率", - "enterValueCont": "輸入 {{ missingCurrencyValue }} 以繼續。", - "selectTokenCont": "選擇代幣以繼續。", "noLiquidity": "沒有流動性資金。", - "unlockTokenCont": "解鎖代幣以繼續。", - "transactionDetails": "交易明細", - "hideDetails": "隱藏明細", - "youAreSelling": "你正在出售", - "orTransFail": "或交易失敗。", "youWillReceive": "你將至少收到", - "youAreBuying": "你正在購買", - "itWillCost": "這將花費至多", - "insufficientBalance": "餘額不足", - "inputNotValid": "無效的輸入值", - "differentToken": "必須是不同的代幣。", - "noRecipient": "請輸入收款人錢包地址。", - "invalidRecipient": "請輸入有效的錢包地址。", - "recipientAddress": "收款人錢包地址", - "youAreSending": "你正在發送", - "willReceive": "將至少收到", "to": "至", "addLiquidity": "增加流動性資金", "deposit": "存入", - "currentPoolSize": "目前的資金池總量", "yourPoolShare": "你在資金池中的佔比", - "noZero": "金額不能為零。", - "mustBeETH": "輸入中必須包含 ETH。", - "enterCurrencyOrLabelCont": "輸入 {{ inputCurrency }} 或 {{ label }} 以繼續。", - "youAreAdding": "你將把", "and": "和", - "intoPool": "加入資金池。", - "outPool": "領出資金池。", - "youWillMint": "你將產生", - "liquidityTokens": "流動性代幣。", - "totalSupplyIs": "目前流動性代幣供給總量為", - "youAreSettingExRate": "初始的匯率將被設定為", - "totalSupplyIs0": "目前流動性代幣供給為零。", - "tokenWorth": "依據目前的匯率,每個流動性代幣價值", - "firstLiquidity": "您是第一個提供流動性資金的人!", - "initialExchangeRate": "初始的匯率將取決於你存入的資金。請確保存入的 ETH 和 {{ label }} 的價值相等。", "removeLiquidity": "領出流動性資金", - "poolTokens": "資金池代幣", - "enterLabelCont": "輸入 {{ label }} 以繼續。", - "youAreRemoving": "您正在移除", - "youWillRemove": "您即將移除", - "createExchange": "創建交易所", - "invalidTokenAddress": "無效的代幣地址", - "exchangeExists": "{{ label }} 的交易所已經存在!", - "invalidSymbol": "代幣符號錯誤", - "invalidDecimals": "小數位數錯誤", "tokenAddress": "代幣地址", "label": "代幣符號", - "decimals": "小數位數", - "enterTokenCont": "輸入代幣地址" + "decimals": "小數位數" } diff --git a/src/App.css b/src/App.css deleted file mode 100755 index 74b5e0534..000000000 --- a/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.tsx b/src/App.tsx index 1e6c33a91..07210ef55 100755 --- a/src/App.tsx +++ b/src/App.tsx @@ -44,7 +44,6 @@ import MulticallUpdater from 'state/multicall/updater'; import 'slick-carousel/slick/slick.css'; import 'slick-carousel/slick/slick-theme.css'; import './i18n'; -import './App.css'; import { mainTheme } from './theme'; import Background from 'layouts/Background'; diff --git a/src/apollo/client.js b/src/apollo/client.js index a1df72408..a8b315224 100755 --- a/src/apollo/client.js +++ b/src/apollo/client.js @@ -4,7 +4,7 @@ import { HttpLink } from 'apollo-link-http'; export const client = new ApolloClient({ link: new HttpLink({ - uri: 'https://polygon.furadao.org/subgraphs/name/quickswap', + uri: process.env.REACT_APP_GRAPH_API_URL, }), cache: new InMemoryCache(), shouldBatch: true, @@ -12,7 +12,7 @@ export const client = new ApolloClient({ export const healthClient = new ApolloClient({ link: new HttpLink({ - uri: 'https://polygon.furadao.org/subgraphs/name/quickswap', + uri: process.env.REACT_APP_GRAPH_API_URL, }), cache: new InMemoryCache(), shouldBatch: true, @@ -20,23 +20,7 @@ export const healthClient = new ApolloClient({ export const txClient = new ApolloClient({ link: new HttpLink({ - uri: 'https://polygon.furadao.org/subgraphs/name/quickswap', - }), - cache: new InMemoryCache(), - shouldBatch: true, -}); - -export const v1Client = new ApolloClient({ - link: new HttpLink({ - uri: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap', - }), - cache: new InMemoryCache(), - shouldBatch: true, -}); - -export const stakingClient = new ApolloClient({ - link: new HttpLink({ - uri: 'https://api.thegraph.com/subgraphs/name/way2rach/talisman', + uri: process.env.REACT_APP_GRAPH_API_URL, }), cache: new InMemoryCache(), shouldBatch: true, @@ -44,7 +28,7 @@ export const stakingClient = new ApolloClient({ export const blockClient = new ApolloClient({ link: new HttpLink({ - uri: 'https://polygon.furadao.org/subgraphs/name/quickswap', + uri: process.env.REACT_APP_GRAPH_API_URL, }), cache: new InMemoryCache(), }); diff --git a/src/apollo/queries.ts b/src/apollo/queries.ts index ea4ac76a5..b0687c5a5 100755 --- a/src/apollo/queries.ts +++ b/src/apollo/queries.ts @@ -345,6 +345,20 @@ export const TOKEN_DATA: any = (tokenAddress: string, block: number) => { return gql(queryString); }; +export const PAIR_ID: any = (tokenAddress0: string, tokenAddress1: string) => { + const queryString = ` + query tokens { + pairs0: pairs(where: {token0: "${tokenAddress0}", token1: "${tokenAddress1}"}){ + id + } + pairs1: pairs(where: {token0: "${tokenAddress1}", token1: "${tokenAddress0}"}){ + id + } + } + `; + return gql(queryString); +}; + export const TOKEN_DATA1: any = ( tokenAddress: string, tokenAddress1: string, @@ -674,3 +688,36 @@ export const FILTERED_TRANSACTIONS = gql` } } `; + +export const SWAP_TRANSACTIONS = gql` + query($allPairs: [Bytes]!, $skip: Int!, $lastTime: Int!) { + swaps( + first: 1000 + where: { pair_in: $allPairs, timestamp_gte: $lastTime } + skip: $skip + orderBy: timestamp + orderDirection: desc + ) { + transaction { + id + timestamp + } + pair { + token0 { + id + symbol + } + token1 { + id + symbol + } + } + amount0In + amount0Out + amount1In + amount1Out + amountUSD + to + } + } +`; diff --git a/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.jpg b/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.jpg new file mode 100644 index 000000000..f9f89aa25 Binary files /dev/null and b/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.jpg differ diff --git a/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.png b/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.png deleted file mode 100644 index 7c1106b4a..000000000 Binary files a/src/assets/tokenLogo/0x2bf9b864cdc97b08b6d79ad4663e71b8ab65c45c.png and /dev/null differ diff --git a/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpeg b/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpeg deleted file mode 100644 index e21625a6e..000000000 Binary files a/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpeg and /dev/null differ diff --git a/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpg b/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpg new file mode 100644 index 000000000..c40379ef2 Binary files /dev/null and b/src/assets/tokenLogo/0x6968105460f67c3bf751be7c15f92f5286fd0ce5.jpg differ diff --git a/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.jpg b/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.jpg new file mode 100644 index 000000000..401358370 Binary files /dev/null and b/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.jpg differ diff --git a/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.png b/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.png deleted file mode 100644 index f97db9284..000000000 Binary files a/src/assets/tokenLogo/0x8d1566569d5b695d44a9a234540f68d393cdc40d.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.jpg b/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.jpg new file mode 100644 index 000000000..8c21b4372 Binary files /dev/null and b/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.jpg differ diff --git a/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.png b/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.png deleted file mode 100644 index 92f260faf..000000000 Binary files a/src/assets/tokenLogo/0xa0e390e9cea0d0e8cd40048ced9fa9ea10d71639.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpeg b/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpeg deleted file mode 100644 index 375341d09..000000000 Binary files a/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpeg and /dev/null differ diff --git a/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpg b/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpg new file mode 100644 index 000000000..c556d5c7d Binary files /dev/null and b/src/assets/tokenLogo/0xaa7dbd1598251f856c12f63557a4c4397c253cea.jpg differ diff --git a/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.jpg b/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.jpg new file mode 100644 index 000000000..fd06d5d6f Binary files /dev/null and b/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.jpg differ diff --git a/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.png b/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.png deleted file mode 100644 index 5e3d77609..000000000 Binary files a/src/assets/tokenLogo/0xb9638272ad6998708de56bbc0a290a1de534a578.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.jpg b/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.jpg new file mode 100644 index 000000000..97488dea9 Binary files /dev/null and b/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.jpg differ diff --git a/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.png b/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.png deleted file mode 100644 index 72cede4d4..000000000 Binary files a/src/assets/tokenLogo/0xc56d17dd519e5eb43a19c9759b5d5372115220bd.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.jpg b/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.jpg new file mode 100644 index 000000000..ad636b417 Binary files /dev/null and b/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.jpg differ diff --git a/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.png b/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.png deleted file mode 100644 index 01068eeb6..000000000 Binary files a/src/assets/tokenLogo/0xc58158c14d4757ef36ce25e493758f2fceedec5d.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.jpg b/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.jpg new file mode 100644 index 000000000..14d5dac1e Binary files /dev/null and b/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.jpg differ diff --git a/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.png b/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.png deleted file mode 100644 index dcfe6a3d0..000000000 Binary files a/src/assets/tokenLogo/0xdab35042e63e93cc8556c9bae482e5415b5ac4b1.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.jpg b/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.jpg new file mode 100644 index 000000000..bc2639b55 Binary files /dev/null and b/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.jpg differ diff --git a/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.png b/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.png deleted file mode 100644 index 094bb72e6..000000000 Binary files a/src/assets/tokenLogo/0xe40d881cf66e1f6d19979a5ff6c830c6af65d278.png and /dev/null differ diff --git a/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.jpg b/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.jpg new file mode 100644 index 000000000..646725f6f Binary files /dev/null and b/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.jpg differ diff --git a/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.png b/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.png deleted file mode 100644 index db5d701eb..000000000 Binary files a/src/assets/tokenLogo/0xefee2de82343be622dcb4e545f75a3b9f50c272d.png and /dev/null differ diff --git a/src/components/AccountDetails/AccountDetails.tsx b/src/components/AccountDetails/AccountDetails.tsx index bf5678932..af9fded58 100755 --- a/src/components/AccountDetails/AccountDetails.tsx +++ b/src/components/AccountDetails/AccountDetails.tsx @@ -2,33 +2,18 @@ import React, { useCallback } from 'react'; import { useDispatch } from 'react-redux'; import { useActiveWeb3React } from 'hooks'; import { AppDispatch } from 'state'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { clearAllTransactions } from 'state/transactions/actions'; import { shortenAddress, getEtherscanLink } from 'utils'; import { SUPPORTED_WALLETS } from 'constants/index'; import { ReactComponent as Close } from 'assets/images/CloseIcon.svg'; import { injected, walletlink, safeApp } from 'connectors'; import { ExternalLink as LinkIcon } from 'react-feather'; +import 'components/styles/AccountDetails.scss'; import StatusIcon from './StatusIcon'; import Copy from './CopyHelper'; import Transaction from './Transaction'; -const useStyles = makeStyles(({ palette }) => ({ - addressLink: { - textDecoration: 'none', - display: 'flex', - alignItems: 'center', - color: palette.text.primary, - '& p': { - marginLeft: 4, - }, - '&:hover': { - textDecoration: 'underline', - }, - }, -})); - function renderTransactions(transactions: string[]) { return ( <> @@ -55,8 +40,6 @@ const AccountDetails: React.FC = ({ openOptions, }) => { const { chainId, account, connector } = useActiveWeb3React(); - const classes = useStyles(); - const { palette } = useTheme(); const dispatch = useDispatch(); function formatConnectorName() { @@ -78,7 +61,7 @@ const AccountDetails: React.FC = ({ (isMetaMask && k === 'METAMASK')), ) .map((k) => SUPPORTED_WALLETS[k].name)[0]; - return Connected with {name}; + return Connected with {name}; } const clearAllTransactionsCallback = useCallback(() => { @@ -87,56 +70,45 @@ const AccountDetails: React.FC = ({ return ( - - Account - + +
Account
+
- - + + {formatConnectorName()} - + {connector !== injected && connector !== walletlink && connector !== safeApp && ( - { (connector as any).close(); }} - variant='body2' > Disconnect - + )} {connector !== safeApp && ( - { openOptions(); }} - variant='body2' > Change - + )} - + - +
{ENSName ? ENSName : account && shortenAddress(account)} - +
- + {account && ( Copy Address @@ -144,7 +116,7 @@ const AccountDetails: React.FC = ({ )} {chainId && account && ( = ({ rel='noopener noreferrer' > - View on Block Explorer + View on Block Explorer )} @@ -165,21 +137,18 @@ const AccountDetails: React.FC = ({ {!!pendingTransactions.length || !!confirmedTransactions.length ? ( <> - Recent Transactions - Recent Transactions + Clear all - + {renderTransactions(pendingTransactions)} @@ -188,9 +157,7 @@ const AccountDetails: React.FC = ({ ) : ( - - Your transactions will appear here... - +

Your transactions will appear here...

)}
diff --git a/src/components/AccountDetails/CopyHelper.tsx b/src/components/AccountDetails/CopyHelper.tsx index 1ca6fd9be..4ace80a8a 100755 --- a/src/components/AccountDetails/CopyHelper.tsx +++ b/src/components/AccountDetails/CopyHelper.tsx @@ -1,20 +1,8 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import useCopyClipboard from 'hooks/useCopyClipboard'; import { CheckCircle, Copy } from 'react-feather'; -const useStyles = makeStyles(({ palette }) => ({ - copyIcon: { - color: palette.text.primary, - display: 'flex', - cursor: 'pointer', - '&:hover, &:active, &:focus': { - color: 'white', - }, - }, -})); - interface CopyHelperProps { toCopy: string; children?: React.ReactNode; @@ -22,16 +10,13 @@ interface CopyHelperProps { const CopyHelper: React.FC = ({ toCopy, children }) => { const [isCopied, setCopied] = useCopyClipboard(); - const classes = useStyles(); return ( - setCopied(toCopy)}> + setCopied(toCopy)}> {isCopied ? ( <> - - Copied - + Copied ) : ( diff --git a/src/components/AccountDetails/StatusIcon.tsx b/src/components/AccountDetails/StatusIcon.tsx index 3227998cb..e5d92b66e 100755 --- a/src/components/AccountDetails/StatusIcon.tsx +++ b/src/components/AccountDetails/StatusIcon.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; +import { Box } from '@material-ui/core'; import { SUPPORTED_WALLETS } from 'constants/index'; import { injected, portis } from 'connectors'; import { useActiveWeb3React } from 'hooks'; @@ -21,17 +21,17 @@ const StatusIcon: React.FC = () => { ) .map((k) => SUPPORTED_WALLETS[k].iconName)[0]; return ( - + wallet icon {connector === portis && ( { portis.portis.showPortis(); }} > - Show Portis + Show Portis )} diff --git a/src/components/AccountDetails/Transaction.tsx b/src/components/AccountDetails/Transaction.tsx index 47109ca04..9948154b1 100755 --- a/src/components/AccountDetails/Transaction.tsx +++ b/src/components/AccountDetails/Transaction.tsx @@ -7,32 +7,11 @@ import { useActiveWeb3React } from 'hooks'; import { getEtherscanLink } from 'utils'; import { useAllTransactions } from 'state/transactions/hooks'; -const useStyles = makeStyles(({ palette }) => ({ - transactionState: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: 4, - }, - iconWrapper: { - color: palette.primary.main, - display: 'flex', - }, - transactionStatusText: { - color: palette.primary.main, - textDecoration: 'none', - '&:hover': { - textDecoration: 'underline', - }, - }, -})); - interface TransactionProps { hash: string; } const Transaction: React.FC = ({ hash }) => { - const classes = useStyles(); const { chainId } = useActiveWeb3React(); const allTransactions = useAllTransactions(); @@ -48,16 +27,16 @@ const Transaction: React.FC = ({ hash }) => { if (!chainId) return null; return ( - + {summary ?? hash} ↗ - + {pending ? ( ) : success ? ( diff --git a/src/components/AddLiquidity/AddLiquidity.tsx b/src/components/AddLiquidity/AddLiquidity.tsx index da06c2150..38fac2c58 100755 --- a/src/components/AddLiquidity/AddLiquidity.tsx +++ b/src/components/AddLiquidity/AddLiquidity.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState, useMemo } from 'react'; -import { Box, Button, Typography } from '@material-ui/core'; +import { Box, Button } from '@material-ui/core'; import { CurrencyInput, TransactionErrorContent, @@ -7,7 +7,6 @@ import { ConfirmationModalContent, DoubleCurrencyLogo, } from 'components'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; import { useWalletModalToggle } from 'state/application/hooks'; import { TransactionResponse } from '@ethersproject/providers'; import { BigNumber } from '@ethersproject/bignumber'; @@ -44,72 +43,11 @@ import { import { wrappedCurrency } from 'utils/wrappedCurrency'; import { ReactComponent as AddLiquidityIcon } from 'assets/images/AddLiquidityIcon.svg'; -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - exchangeSwap: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - margin: '16px auto', - zIndex: 2, - position: 'relative', - }, - swapButtonWrapper: { - marginTop: 16, - '& button': { - height: 56, - fontSize: 18, - fontWeight: 600, - width: (props: any) => (props.showApproveFlow ? '48%' : '100%'), - backgroundImage: `linear-gradient(to bottom, ${palette.primary.main}, #004ce6)`, - '&.Mui-disabled': { - backgroundImage: `linear-gradient(to bottom, ${palette.secondary.dark}, #1d212c)`, - color: palette.text.secondary, - opacity: 0.5, - }, - '& .content': { - display: 'flex', - alignItems: 'center', - '& > div': { - color: 'white', - marginLeft: 6, - }, - }, - }, - }, - swapPrice: { - display: 'flex', - flexWrap: 'wrap', - justifyContent: 'space-between', - margin: '6px 24px 0', - [breakpoints.down('xs')]: { - margin: '6px 12px 0', - }, - '& p': { - display: 'flex', - alignItems: 'center', - color: palette.text.primary, - '& svg': { - marginLeft: 8, - width: 16, - height: 16, - cursor: 'pointer', - }, - }, - }, - approveButtons: { - display: 'flex', - justifyContent: 'space-between', - marginBottom: 16, - }, -})); - const AddLiquidity: React.FC<{ currency0?: Currency; currency1?: Currency; - currencyBg?: string; -}> = ({ currency0, currency1, currencyBg }) => { - const classes = useStyles({}); - const { palette } = useTheme(); + currencyBgClass?: string; +}> = ({ currency0, currency1, currencyBgClass }) => { const { t } = useTranslation(); const [addLiquidityErrorMessage, setAddLiquidityErrorMessage] = useState< string | null @@ -391,15 +329,15 @@ const AddLiquidity: React.FC<{ const modalHeader = () => { return ( - + - - + +
{t('supplyingTokens', liquidityTokenData)}
{t('receiveLPTokens', { @@ -407,14 +345,14 @@ const AddLiquidity: React.FC<{ symbolA: currencies[Field.CURRENCY_A]?.symbol, symbolB: currencies[Field.CURRENCY_B]?.symbol, })} - +
- - + + {t('outputEstimated', { slippage: allowedSlippage / 100 })} - + - + @@ -469,9 +407,9 @@ const AddLiquidity: React.FC<{ handleCurrencySelect={handleCurrencyASelect} amount={formattedAmounts[Field.CURRENCY_A]} setAmount={onFieldAInput} - bgColor={currencyBg} + bgClass={currencyBgClass} /> - + {currencies[Field.CURRENCY_A] && currencies[Field.CURRENCY_B] && pairState !== PairState.INVALID && price && ( - - + + 1 {currencies[Field.CURRENCY_A]?.symbol} ={' '} {price.toSignificant(3)} {currencies[Field.CURRENCY_B]?.symbol}{' '} - - + + 1 {currencies[Field.CURRENCY_B]?.symbol} ={' '} {price.invert().toSignificant(3)}{' '} {currencies[Field.CURRENCY_A]?.symbol}{' '} -
+
- - {t('yourPoolShare')}: - + + {t('yourPoolShare')}: + {poolTokenPercentage ? poolTokenPercentage.toSignificant(6) + '%' : '-'} - + - - {t('lpTokenReceived')}: - + + {t('lpTokenReceived')}: + {formatTokenAmount(userPoolBalance)} {t('lpTokens')} - +
)} - + {(approvalA === ApprovalState.NOT_APPROVED || approvalA === ApprovalState.PENDING || approvalB === ApprovalState.NOT_APPROVED || approvalB === ApprovalState.PENDING) && !error && ( - + {approvalA !== ApprovalState.APPROVED && ( + )} - + {trade.tradeType === TradeType.EXACT_INPUT ? ( - +

{`Output is estimated. You will receive at least `} {formatTokenAmount(slippageAdjustedAmounts[Field.OUTPUT])}{' '} {trade.outputAmount.currency.symbol} {' or the transaction will revert.'} - +

) : ( - +

{`Input is estimated. You will sell at most `} {formatTokenAmount(slippageAdjustedAmounts[Field.INPUT])}{' '} {trade.inputAmount.currency.symbol} {' or the transaction will revert.'} - +

)} -
diff --git a/src/components/CurrencyInput/CurrencyInput.tsx b/src/components/CurrencyInput/CurrencyInput.tsx index 679242e4b..0f8e64ebc 100755 --- a/src/components/CurrencyInput/CurrencyInput.tsx +++ b/src/components/CurrencyInput/CurrencyInput.tsx @@ -1,72 +1,12 @@ import React, { useCallback, useState } from 'react'; import { Currency } from '@uniswap/sdk'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { useCurrencyBalance } from 'state/wallet/hooks'; -import cx from 'classnames'; import { CurrencySearchModal, CurrencyLogo, NumericalInput } from 'components'; import { useActiveWeb3React } from 'hooks'; import useUSDCPrice from 'utils/useUSDCPrice'; import { formatTokenAmount } from 'utils'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - swapBox: { - padding: '16px 24px', - borderRadius: 10, - zIndex: 1, - position: 'relative', - textAlign: 'left', - '& > p': { - fontSize: 14, - marginBottom: 16, - }, - '& > div': { - display: 'flex', - alignItems: 'center', - '& .inputWrapper': { - flex: 1, - position: 'relative', - paddingLeft: 8, - }, - '& .maxWrapper': { - paddingLeft: 8, - cursor: 'pointer', - '& p': { - color: palette.primary.main, - fontWeight: 600, - }, - }, - }, - [breakpoints.down('xs')]: { - padding: 12, - }, - }, - priceShowBox: { - borderBottomLeftRadius: 0, - borderBottomRightRadius: 0, - }, - currencyButton: { - display: 'flex', - alignItems: 'center', - cursor: 'pointer', - padding: '6px 12px', - borderRadius: 38, - '& p': { - marginLeft: 4, - }, - }, - noCurrency: { - backgroundImage: `linear-gradient(105deg, ${palette.primary.main} 3%, #004ce6)`, - }, - currencySelected: { - backgroundColor: '#404557', - }, - balanceSection: { - '& p': { - color: palette.text.secondary, - }, - }, -})); +import 'components/styles/CurrencyInput.scss'; interface CurrencyInputProps { title?: string; @@ -80,7 +20,7 @@ interface CurrencyInputProps { showHalfButton?: boolean; showMaxButton?: boolean; showPrice?: boolean; - bgColor?: string; + bgClass?: string; id?: string; } @@ -96,11 +36,9 @@ const CurrencyInput: React.FC = ({ showHalfButton, title, showPrice, - bgColor, + bgClass, id, }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [modalOpen, setModalOpen] = useState(false); const { account } = useActiveWeb3React(); const selectedCurrencyBalance = useCurrencyBalance( @@ -116,48 +54,44 @@ const CurrencyInput: React.FC = ({ return ( - - {title || 'You Pay:'} + +

{title || 'You Pay:'}

{account && currency && showHalfButton && ( - 50% + 50% )} {account && currency && showMaxButton && ( - MAX + MAX )}
{currency ? ( <> - - {currency?.symbol} - +

{currency?.symbol}

) : ( - Select a token +

Select a token

)}
{ setAmount(val); @@ -165,17 +99,13 @@ const CurrencyInput: React.FC = ({ />
- - + + Balance: {formatTokenAmount(selectedCurrencyBalance)} - - + + ${(usdPrice * Number(amount)).toLocaleString()} - + {modalOpen && ( ({ - logoStyled: { - boxShadow: '0px 6px 10px rgba(0, 0, 0, 0.075)', - borderRadius: 24, - }, -})); +import 'components/styles/CurrencyLogo.scss'; interface CurrencyLogoProps { currency?: Currency; @@ -26,7 +19,6 @@ const CurrencyLogo: React.FC = ({ size = '24px', style, }) => { - const classes = useStyles(); const uriLocations = useHttpLocations( currency instanceof WrappedTokenInfo ? currency.logoURI : undefined, ); @@ -51,14 +43,9 @@ const CurrencyLogo: React.FC = ({ width={size} height={size} borderRadius={size} - overflow='hidden' + className='currencyLogo' > - Ethereum Logo + Ethereum Logo
); } @@ -68,11 +55,7 @@ const CurrencyLogo: React.FC = ({ width={size} height={size} borderRadius={size} - overflow='hidden' - bgcolor='white' - display='flex' - justifyContent='center' - alignItems='center' + className='currencyLogo bg-white' > ({ - baseWrapper: { - borderRadius: 18, - display: 'flex', - padding: '6px 10px', - margin: '4px 8px 4px 0', - alignItems: 'center', - backgroundColor: palette.secondary.dark, - '&:hover': { - cursor: 'pointer', - }, - '& p': { - marginLeft: 6, - }, - }, - title: { - '& span': { - marginRight: 4, - color: palette.text.secondary, - }, - }, -})); - interface CommonBasesProps { chainId?: ChainId; selectedCurrency?: Currency | null; @@ -39,16 +15,17 @@ const CommonBases: React.FC = ({ onSelect, selectedCurrency, }) => { - const classes = useStyles(); return ( - - Common bases + + + Common bases + - + { if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) { onSelect(ETHER); @@ -56,7 +33,7 @@ const CommonBases: React.FC = ({ }} > - MATIC + MATIC {(chainId ? GlobalData.bases.SUGGESTED_BASES[chainId] : []).map( (token: Token) => { @@ -65,12 +42,12 @@ const CommonBases: React.FC = ({ selectedCurrency.address === token.address; return ( !selected && onSelect(token)} > - {token.symbol} + {token.symbol} ); }, diff --git a/src/components/CurrencySearchModal/CurrencyRow.tsx b/src/components/CurrencySearchModal/CurrencyRow.tsx index 96b0f2982..be22ffb32 100644 --- a/src/components/CurrencySearchModal/CurrencyRow.tsx +++ b/src/components/CurrencySearchModal/CurrencyRow.tsx @@ -1,13 +1,6 @@ import { CurrencyAmount, ETHER, Token } from '@uniswap/sdk'; import React from 'react'; -import { - Box, - Tooltip, - Typography, - CircularProgress, - ListItem, -} from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Tooltip, CircularProgress, ListItem } from '@material-ui/core'; import { useActiveWeb3React } from 'hooks'; import { WrappedTokenInfo } from 'state/lists/hooks'; import { useAddUserToken, useRemoveUserAddedToken } from 'state/user/hooks'; @@ -28,61 +21,15 @@ function currencyKey(currency: Token): string { : ''; } -const useStyles = makeStyles(({ palette }) => ({ - tag: { - fontSize: 14, - borderRadius: 4, - padding: '0.25rem 0.3rem 0.25rem 0.3rem', - maxWidth: '6rem', - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - }, - currencyRow: { - width: '100%', - background: 'transparent', - display: 'flex', - alignItems: 'center', - '& > p': { - margin: '0 4px', - }, - '& button': { - background: 'transparent', - padding: 0, - minWidth: 'unset', - '& svg': { - fill: 'white', - stroke: 'black', - }, - '& div': { - background: 'transparent', - }, - }, - }, - currencySymbol: { - color: palette.text.primary, - lineHeight: 1, - }, - currencyName: { - color: palette.text.secondary, - }, -})); - function Balance({ balance }: { balance: CurrencyAmount }) { - const { palette } = useTheme(); return ( - +

{formatTokenAmount(balance)} - +

); } function TokenTags({ currency }: { currency: Token }) { - const classes = useStyles(); if (!(currency instanceof WrappedTokenInfo)) { return ; } @@ -95,7 +42,7 @@ function TokenTags({ currency }: { currency: Token }) { return ( - + {tag.name} @@ -106,7 +53,7 @@ function TokenTags({ currency }: { currency: Token }) { .map(({ name, description }) => `${name}: ${description}`) .join('; \n')} > - ... + ... ) : null} @@ -131,8 +78,6 @@ const CurrencyRow: React.FC = ({ isOnSelectedList, }) => { const { ethereum } = window as any; - const classes = useStyles(); - const { palette } = useTheme(); const { account, chainId } = useActiveWeb3React(); const key = currencyKey(currency); @@ -190,17 +135,16 @@ const CurrencyRow: React.FC = ({ if (!isSelected && !otherSelected) onSelect(); }} > - + {(otherSelected || isSelected) && } - + - - - {currency.symbol} - + + {currency.symbol} {isMetamask && currency !== ETHER && ( { addTokenToMetamask( currency.address, @@ -216,17 +160,13 @@ const CurrencyRow: React.FC = ({ )} {isOnSelectedList ? ( - - {currency.name} - + {currency.name} ) : ( - - - {customAdded ? 'Added by user' : 'Found by address'} - + + {customAdded ? 'Added by user' : 'Found by address'} { event.stopPropagation(); if (customAdded) { @@ -237,9 +177,7 @@ const CurrencyRow: React.FC = ({ } }} > - - {customAdded ? '(Remove)' : '(Add)'} - + {customAdded ? '(Remove)' : '(Add)'} )} @@ -251,16 +189,13 @@ const CurrencyRow: React.FC = ({ {balance ? ( <> - + $ {( Number(balance.toExact()) * (usdPrice ? Number(usdPrice.toSignificant()) : 0) ).toLocaleString()} - + ) : account ? ( diff --git a/src/components/CurrencySearchModal/CurrencySearch.tsx b/src/components/CurrencySearchModal/CurrencySearch.tsx index 9c67ec769..16996a1de 100755 --- a/src/components/CurrencySearchModal/CurrencySearch.tsx +++ b/src/components/CurrencySearchModal/CurrencySearch.tsx @@ -9,8 +9,7 @@ import React, { useState, } from 'react'; import ReactGA from 'react-ga'; -import { Box, Typography, Divider } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box, Divider } from '@material-ui/core'; import { useTranslation } from 'react-i18next'; import { useDispatch } from 'react-redux'; import { FixedSizeList } from 'react-window'; @@ -30,84 +29,6 @@ import { filterTokens } from 'utils/filtering'; import { useTokenComparator } from 'utils/sorting'; import useDebouncedChangeHandler from 'utils/useDebouncedChangeHandler'; -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - wrapper: { - padding: '32px 24px 0', - height: '90vh', - borderRadius: 20, - display: 'flex', - flexDirection: 'column', - background: palette.background.paper, - backdropFilter: 'blur(9.9px)', - border: `1px solid ${palette.grey.A400}`, - [breakpoints.down('xs')]: { - height: '90vh', - }, - }, - header: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - margin: '6px', - '& svg': { - fill: '#686c80', - cursor: 'pointer', - }, - '& h6': { - color: palette.text.primary, - fontWeight: 600, - }, - }, - searchInputWrapper: { - width: '100%', - height: 50, - display: 'flex', - alignItems: 'center', - padding: '0 12px', - margin: '12px 0', - fontSize: 16, - borderRadius: 12, - outline: 'none', - border: 'solid 2px rgba(105, 108, 128, 0.12)', - backgroundColor: palette.background.default, - '& svg': { - marginRight: 12, - }, - '& input': { - background: 'transparent', - flex: 1, - boxShadow: 'none', - border: 'none', - outline: 'none', - fontSize: 14, - fontWeight: 500, - color: palette.text.secondary, - fontFamily: "'Inter', sans-serif", - }, - }, - footer: { - backgroundImage: `linear-gradient(to bottom, rgba(27, 30, 41, 0), ${palette.background.paper} 64%)`, - width: '100%', - height: 64, - position: 'absolute', - bottom: 0, - left: 0, - zIndex: 2, - borderRadius: 20, - }, - currencyListWrapper: { - flex: 1, - overflowY: 'auto', - marginTop: 16, - '& .MuiListItem-root': { - padding: 6, - '&.Mui-selected, &:hover': { - background: 'none', - }, - }, - }, -})); - interface CurrencySearchProps { isOpen: boolean; onDismiss: () => void; @@ -126,7 +47,6 @@ const CurrencySearch: React.FC = ({ onDismiss, isOpen, }) => { - const classes = useStyles(); const { t } = useTranslation(); const { account, chainId } = useActiveWeb3React(); const dispatch = useDispatch(); @@ -237,12 +157,12 @@ const CurrencySearch: React.FC = ({ selectedListInfo = useSelectedListInfo(); return ( - - - Select a token + + +
Select a token
- + = ({ - + ); }; diff --git a/src/components/CurrencySearchModal/CurrencySearchModal.tsx b/src/components/CurrencySearchModal/CurrencySearchModal.tsx index a6e38369d..95d171cae 100755 --- a/src/components/CurrencySearchModal/CurrencySearchModal.tsx +++ b/src/components/CurrencySearchModal/CurrencySearchModal.tsx @@ -5,6 +5,7 @@ import { CustomModal } from 'components'; import useLast from 'hooks/useLast'; import CurrencySearch from './CurrencySearch'; import ListSelect from './ListSelect'; +import 'components/styles/CurrencySearchModal.scss'; interface CurrencySearchModalProps { isOpen: boolean; diff --git a/src/components/CurrencySearchModal/ListSelect.tsx b/src/components/CurrencySearchModal/ListSelect.tsx index be674910a..9307a3918 100755 --- a/src/components/CurrencySearchModal/ListSelect.tsx +++ b/src/components/CurrencySearchModal/ListSelect.tsx @@ -1,8 +1,7 @@ import React, { memo, useCallback, useMemo, useState } from 'react'; import { ArrowLeft } from 'react-feather'; import ReactGA from 'react-ga'; -import { Box, Typography, Button, Popover, Divider } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box, Button, Popover, Divider } from '@material-ui/core'; import { useDispatch, useSelector } from 'react-redux'; import { ReactComponent as DropDown } from 'assets/images/dropdown.svg'; import { useFetchListCallback } from 'hooks/useFetchListCallback'; @@ -16,126 +15,6 @@ import { parseENSAddress } from 'utils/parseENSAddress'; import uriToHttp from 'utils/uriToHttp'; import { QuestionHelper, ListLogo } from 'components'; -const useStyles = makeStyles(({ palette }) => ({ - popoverWrapper: { - zIndex: 100, - boxShadow: - '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)', - color: 'black', - borderRadius: 12, - padding: 16, - '& p': { - fontSize: 18, - marginBottom: 4, - }, - '& > div': { - display: 'flex', - flexDirection: 'column', - marginTop: 8, - '& a, & button': { - fontSize: 16, - fontWeight: 400, - }, - '& a': { - textDecoration: 'none', - color: palette.primary.main, - }, - '& button': { - background: 'transparent', - color: 'black', - padding: 0, - marginTop: 6, - }, - }, - }, - styledMenu: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - position: 'relative', - border: 'none', - '& > div:first-child': { - cursor: 'pointer', - width: 32, - height: 32, - borderRadius: 8, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - border: `1px solid ${palette.divider}`, - marginRight: 8, - }, - }, - styledListUrlText: { - maxWidth: 160, - opacity: 0.6, - marginRight: '0.5rem', - fontSize: 14, - overflow: 'hidden', - textOverflow: 'ellipsis', - }, - manageList: { - '& p': { - color: 'black', - }, - '& .header': { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - padding: '12px 16px', - '& svg': { - stroke: 'black', - width: 24, - height: 24, - }, - '& p': { - fontSize: 18, - }, - }, - '& .content': { - padding: '12px 16px', - '& > div': { - display: 'flex', - '&:first-child': { - alignItems: 'center', - '& p': { - marginRight: 8, - }, - }, - '&:nth-child(2)': { - marginTop: 8, - '& input': { - flex: 1, - marginRight: 8, - border: `1px solid ${palette.divider}`, - fontSize: 16, - outline: 'none', - }, - }, - '& > div': { - background: 'transparent', - }, - '& svg': { - fill: 'white', - stroke: 'black', - }, - }, - }, - }, - listRow: { - display: 'flex', - alignItems: 'center', - padding: '12px 16px', - '& .listname': { - flex: 1, - marginLeft: 8, - '& div': { - color: '#999', - }, - }, - }, -})); - function ListOrigin({ listUrl }: { listUrl: string }) { const ensName = useMemo(() => parseENSAddress(listUrl)?.ensName, [listUrl]); const host = useMemo(() => { @@ -168,7 +47,6 @@ const ListRow = memo(function ListRow({ listUrl: string; onBack: () => void; }) { - const classes = useStyles(); const listsByUrl = useSelector( (state) => state.lists.byUrl, ); @@ -224,23 +102,19 @@ const ListRow = memo(function ListRow({ if (!list) return null; return ( - + {list.logoURI ? ( ) : (
)} - {list.name} - +

{list.name}

+
-
+
{ setAnchorEl(evt.currentTarget); @@ -256,8 +130,8 @@ const ListRow = memo(function ListRow({ anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} transformOrigin={{ vertical: 'top', horizontal: 'center' }} > - - {list && listVersionLabel(list.version)} + +

{list && listVersionLabel(list.version)}

= ({ onDismiss, onBack }) => { - const classes = useStyles(); const [listUrlInput, setListUrlInput] = useState(''); const dispatch = useDispatch(); @@ -385,10 +258,10 @@ const ListSelect: React.FC = ({ onDismiss, onBack }) => { }, [lists]); return ( - + - Manage Lists +

Manage Lists

@@ -396,7 +269,7 @@ const ListSelect: React.FC = ({ onDismiss, onBack }) => { - Add a list +

Add a list

@@ -414,9 +287,9 @@ const ListSelect: React.FC = ({ onDismiss, onBack }) => { {addError ? ( - +

{addError} - +

) : null}
diff --git a/src/components/CurrencySearchModal/SortButton.tsx b/src/components/CurrencySearchModal/SortButton.tsx index abc6bff87..ba2ed04a6 100755 --- a/src/components/CurrencySearchModal/SortButton.tsx +++ b/src/components/CurrencySearchModal/SortButton.tsx @@ -1,25 +1,5 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - filterWrapper: { - backgroundColor: 'white', - color: palette.text.primary, - border: `1px solid ${palette.divider}`, - borderRadius: 8, - width: 32, - height: 32, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - cursor: 'pointer', - '& p': { - fontSize: 14, - fontWeight: 500, - }, - }, -})); +import { Box } from '@material-ui/core'; interface SortButtonProps { toggleSortOrder: () => void; @@ -30,10 +10,9 @@ const SortButton: React.FC = ({ toggleSortOrder, ascending, }) => { - const classes = useStyles(); return ( - - {ascending ? '↑' : '↓'} + +

{ascending ? '↑' : '↓'}

); }; diff --git a/src/components/CustomMenu/CustomMenu.tsx b/src/components/CustomMenu/CustomMenu.tsx index c8cc86846..395bccd5d 100644 --- a/src/components/CustomMenu/CustomMenu.tsx +++ b/src/components/CustomMenu/CustomMenu.tsx @@ -1,30 +1,7 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons'; - -const useStyles = makeStyles(({ palette }) => ({ - wrapper: { - borderRadius: 10, - border: `1px solid ${palette.secondary.dark}`, - height: '100%', - width: '100%', - padding: '0 8px 0 16px', - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - color: palette.text.secondary, - }, - menuContent: { - borderRadius: 10, - border: `1px solid ${palette.secondary.dark}`, - padding: 12, - background: palette.background.paper, - position: 'relative', - zIndex: 10, - marginTop: 8, - }, -})); +import 'components/styles/CustomMenu.scss'; interface CustomMenuItem { text: string; @@ -37,19 +14,18 @@ interface CustomMenuProps { } const CustomMenu: React.FC = ({ title, menuItems }) => { - const classes = useStyles(); const [openMenu, setOpenMenu] = React.useState(false); const [menuItem, setMenuItem] = React.useState(null); return ( <> - setOpenMenu(!openMenu)}> - + setOpenMenu(!openMenu)}> + {title} {menuItem?.text} - + {openMenu ? : } {openMenu && ( - + {menuItems.map((item, index) => ( = ({ title, menuItems }) => { setMenuItem(item); }} > - - {item.text} - + {item.text} ))} diff --git a/src/components/CustomModal/CustomModal.tsx b/src/components/CustomModal/CustomModal.tsx index d4e5a2617..99def1a9a 100755 --- a/src/components/CustomModal/CustomModal.tsx +++ b/src/components/CustomModal/CustomModal.tsx @@ -1,23 +1,6 @@ import React from 'react'; import { Modal, Box, Backdrop, Fade } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; - -const useStyles = makeStyles(({ palette }) => ({ - wrapper: { - margin: 0, - padding: 0, - maxWidth: 500, - width: '100%', - position: 'absolute', - top: '50%', - left: '50%', - borderRadius: 20, - transform: 'translate(-50%, -50%)', - outline: 'none', - background: (props: any) => props.background ?? palette.background.paper, - overflow: (props: any) => props.overflow, - }, -})); +import 'components/styles/CustomModal.scss'; interface CustomModalProps { open: boolean; @@ -34,7 +17,6 @@ const CustomModal: React.FC = ({ background, overflow, }) => { - const classes = useStyles({ background, overflow }); return ( = ({ BackdropProps={{ timeout: 500 }} > - {children} + + {children} + ); diff --git a/src/components/CustomSwitch/CustomSwitch.tsx b/src/components/CustomSwitch/CustomSwitch.tsx index ab52cbe9e..6809b553b 100644 --- a/src/components/CustomSwitch/CustomSwitch.tsx +++ b/src/components/CustomSwitch/CustomSwitch.tsx @@ -1,28 +1,6 @@ import React from 'react'; -import { Typography, Box } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; -import cx from 'classnames'; - -const useStyles = makeStyles(({ palette }) => ({ - switchItem: { - width: '50%', - height: '100%', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - cursor: 'pointer', - border: `1px solid ${palette.secondary.dark}`, - '& p': { - color: palette.text.secondary, - }, - }, - activeSwitchItem: { - background: palette.secondary.dark, - '& p': { - color: palette.text.primary, - }, - }, -})); +import { Box } from '@material-ui/core'; +import 'components/styles/CustomSwitch.scss'; interface SwitchItems { text: string; @@ -43,7 +21,6 @@ const CustomSwitch: React.FC = ({ items, isLarge, }) => { - const classes = useStyles(); return ( {items.map((item, index) => { @@ -53,10 +30,8 @@ const CustomSwitch: React.FC = ({ return ( = ({ }} onClick={item.onClick} > - - {item.text} - +

{item.text}

); })} diff --git a/src/components/CustomTable/CustomTable.tsx b/src/components/CustomTable/CustomTable.tsx index 8beddb26a..5a98590cf 100644 --- a/src/components/CustomTable/CustomTable.tsx +++ b/src/components/CustomTable/CustomTable.tsx @@ -1,93 +1,9 @@ import React, { ReactChild } from 'react'; import { Box, useMediaQuery, TableRow, TableCell } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import { ArrowUpward, ArrowDownward } from '@material-ui/icons'; import { DataTable } from 'components'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - tableContainer: { - '& .MuiTableContainer-root': { - overflow: 'unset', - }, - '& thead': { - height: 53, - }, - '& tbody tr': { - height: 57, - }, - '& thead tr th, & tbody tr td': { - fontSize: 14, - borderBottom: `1px solid ${palette.divider}`, - '&.buttonCell': { - width: 110, - padding: '6px 10px 6px 0', - '& button': { - padding: 0, - margin: 0, - width: '100%', - height: 40, - fontSize: 14, - fontWeight: 700, - }, - }, - }, - '& thead tr th': { - padding: '7px 6px', - cursor: 'pointer', - '&:first-child': { - padding: '7px 0px 7px 23px', - [breakpoints.down('sm')]: { - padding: '7px 6px 7px 13px', - }, - }, - '&.buttonCell': { - '& > div > div': { - width: '100%', - }, - '& button': { - color: palette.text.secondary, - }, - '& .removeAll': { - '& p': { - margin: 0, - fontSize: 12, - lineHeight: '16px', - fontWeight: 'normal', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - '& b': { - fontSize: 14, - }, - '& svg': { - width: 12, - height: 12, - marginTop: -1, - }, - }, - }, - }, - }, - '& tbody tr td': { - padding: '6px', - borderBottom: 'none', - '&:first-child': { - padding: '6px 0px 6px 15px', - [breakpoints.down('sm')]: { - padding: '6px', - }, - }, - '&.buttonCell.MuiButton-textPrimary': { - '& button': { - color: palette.common.white, - '&:hover': { - color: palette.primary.main, - }, - }, - }, - }, - }, -})); +import 'components/styles/CustomTable.scss'; export interface CustomTableProps { emptyMessage?: string; @@ -119,10 +35,9 @@ const CustomTable: React.FC> = ({ }) => { const theme = useTheme(); const mobileWindowSize = useMediaQuery(theme.breakpoints.down('xs')); - const classes = useStyles(); return ( - + {mobileWindowSize ? ( <> {data.map((item: any, index: number) => { diff --git a/src/components/CustomTooltip/CustomTooltip.tsx b/src/components/CustomTooltip/CustomTooltip.tsx index b507e1707..333586582 100755 --- a/src/components/CustomTooltip/CustomTooltip.tsx +++ b/src/components/CustomTooltip/CustomTooltip.tsx @@ -1,34 +1,8 @@ import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip'; -import { useIsDarkMode } from 'state/user/hooks'; - -const useStylesBootstrap = makeStyles(({ palette }) => ({ - arrow: { - fontSize: 16, - width: 17, - '&::before': { - color: (props: any) => - props.dark ? palette.secondary.dark : 'rgba(255, 255, 255, 0.9)', - border: `1px solid ${palette.divider}`, - boxSizing: 'border-box', - }, - }, - tooltip: { - backgroundColor: (props: any) => - props.dark ? palette.secondary.dark : 'rgba(255, 255, 255, 0.9)', - border: `1px solid ${palette.divider}`, - padding: '14px', - fontSize: '14px', - borderRadius: '14px', - color: palette.text.primary, - }, -})); const CustomTooltip: React.FC = (props: TooltipProps) => { - const dark = useIsDarkMode(); - const classes = useStylesBootstrap({ dark }); - return ; + return ; }; export default CustomTooltip; diff --git a/src/components/DataTable/DataTable.tsx b/src/components/DataTable/DataTable.tsx index 6aa34ade6..8c1988de1 100644 --- a/src/components/DataTable/DataTable.tsx +++ b/src/components/DataTable/DataTable.tsx @@ -1,8 +1,6 @@ import React, { useState } from 'react'; -import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import { Box, - Grid, Table, TableBody, TableCell, @@ -13,73 +11,9 @@ import { TableSortLabel, CircularProgress, } from '@material-ui/core'; - import { SortOrder, getComparator, stableSort } from './sort'; -import cx from 'classnames'; +import 'components/styles/DataTable.scss'; -const useStyles = makeStyles((theme: Theme) => - createStyles({ - table: { - width: '100%', - }, - visuallyHidden: { - border: 0, - clip: 'rect(0 0 0 0)', - height: 1, - margin: -1, - overflow: 'hidden', - padding: 0, - position: 'absolute', - top: 20, - width: 1, - }, - label: { - whiteSpace: (props: any) => { - return props.isSinglelineHeader ? 'nowrap' : 'initial'; - }, - }, - sortIcon: { - marginLeft: 4, - display: 'flex', - alignItems: 'center', - '& svg': { - width: 16, - '& path': { - stroke: theme.palette.text.secondary, - }, - }, - }, - headCellLabel: { - color: theme.palette.text.secondary, - display: 'flex', - alignItems: 'center', - fontSize: 14, - '& svg': { - marginLeft: 3, - width: 16, - '& path': { - fill: theme.palette.text.secondary, - }, - }, - }, - sortRequestedHeadLabel: { - color: theme.palette.primary.main, - '& svg path': { - fill: theme.palette.primary.main, - }, - }, - sortRequestedIcon: { - '& svg path': { - stroke: theme.palette.primary.main, - }, - }, - tablePagination: { - '& svg path': { - fill: theme.palette.primary.main, - }, - }, - }), -); export interface HeadCell { id: string; label: React.ReactNode | string; @@ -133,7 +67,6 @@ const DataTable: React.FC> = ({ showEmptyRows = true, showPagination, }) => { - const classes = useStyles({ isSinglelineHeader }); const [order, setOrder] = useState(defaultOrder); const [orderBy, setOrderBy] = useState>(defaultOrderBy); const [page, setPage] = useState(0); @@ -164,12 +97,12 @@ const DataTable: React.FC> = ({ rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage); return ( - + {toolbar} > = ({ > {headCell.element} {sortUpIcon && sortDownIcon ? ( - handleRequestSort(event, headCell) } > {headCell.label} {!headCell.sortDisabled && ( {order === 'asc' && orderBy.id === headCell.id ? sortUpIcon : sortDownIcon} )} - + ) : ( @@ -228,7 +164,7 @@ const DataTable: React.FC> = ({ > {headCell.label} {orderBy.id === headCell.id ? ( - + {order === 'desc' ? 'sorted descending' : 'sorted ascending'} @@ -245,9 +181,9 @@ const DataTable: React.FC> = ({ {loading && ( - + - + )} @@ -277,7 +213,7 @@ const DataTable: React.FC> = ({ {/* Todo: show captions */} {caption === false && ( - + {caption} )}
{caption}
@@ -285,7 +221,7 @@ const DataTable: React.FC> = ({ {showPagination && ( ({ - wrapper: { - position: 'relative', - display: 'flex', - '& > div:first-child': { - zIndex: 2, - marginRight: -4, - }, - }, -})); +import 'components/styles/DoubleCurrencyLogo.scss'; interface DoubleCurrencyLogoProps { - margin?: boolean; size?: number; currency0?: Currency; currency1?: Currency; @@ -25,11 +13,9 @@ const DoubleCurrencyLogo: React.FC = ({ currency0, currency1, size = 16, - margin = false, }: DoubleCurrencyLogoProps) => { - const classes = useStyles({ size, margin }); return ( - + diff --git a/src/components/FarmCard/FarmCard.tsx b/src/components/FarmCard/FarmCard.tsx index e47a651ca..af6dd2baf 100755 --- a/src/components/FarmCard/FarmCard.tsx +++ b/src/components/FarmCard/FarmCard.tsx @@ -1,7 +1,6 @@ import React, { useState } from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; -import cx from 'classnames'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { DualStakingInfo, StakingInfo } from 'types'; import { unwrappedToken } from 'utils/wrappedCurrency'; import { DoubleCurrencyLogo, CurrencyLogo } from 'components'; @@ -18,51 +17,14 @@ import { formatAPY, } from 'utils'; import { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - farmLPCard: { - background: palette.secondary.dark, - width: '100%', - borderRadius: 10, - marginTop: 24, - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - padding: '0 16px', - [breakpoints.down('xs')]: { - padding: 0, - }, - }, - highlightedCard: { - border: `1px solid ${palette.primary.main}`, - boxShadow: '0 0 5px 5px rgba(68, 138, 255, 0.3)', - }, - farmLPCardUp: { - background: palette.secondary.dark, - width: '100%', - borderRadius: 10, - display: 'flex', - alignItems: 'center', - padding: '16px 0', - cursor: 'pointer', - [breakpoints.down('xs')]: { - padding: 16, - }, - }, - farmLPText: { - fontSize: 14, - fontWeight: 600, - color: palette.text.secondary, - }, -})); +import 'components/styles/FarmCard.scss'; const FarmCard: React.FC<{ stakingInfo: StakingInfo | DualStakingInfo; stakingAPY: number; isLPFarm?: boolean; }> = ({ stakingInfo, stakingAPY, isLPFarm }) => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const [isExpandCard, setExpandCard] = useState(false); @@ -114,29 +76,24 @@ const FarmCard: React.FC<{ dualStakingInfo.rateB * dualStakingInfo.rewardTokenBPrice; const renderPool = (width: number) => ( - + - + {currency0.symbol} / {currency1.symbol} LP - + ); return ( - + setExpandCard(!isExpandCard)} > {isMobile ? ( @@ -144,25 +101,18 @@ const FarmCard: React.FC<{ {renderPool(isExpandCard ? 0.95 : 0.7)} {!isExpandCard && ( - - - APY - + + APY {'arrow - - {apyWithFee}% + + {apyWithFee}% )} - + {isExpandCard ? : } @@ -170,79 +120,64 @@ const FarmCard: React.FC<{ <> {renderPool(0.3)} - {tvl} + {tvl} - +

${(isLPFarm ? lpRewards : dualRewards).toLocaleString()} / day - +

{isLPFarm ? ( - {lpPoolRate} +

{lpPoolRate}

) : ( <> - {dualPoolRateA} - {dualPoolRateB} +

{dualPoolRateA}

+

{dualPoolRateB}

)}
- {apyWithFee}% + {apyWithFee}% {'arrow - {earnedUSDStr} + {earnedUSDStr} {isLPFarm ? ( - + - + {formatTokenAmount(lpStakingInfo.earnedAmount)} -  {lpStakingInfo.rewardToken.symbol} - +  {lpStakingInfo.rewardToken.symbol} + ) : ( <> - + - + {formatTokenAmount(dualStakingInfo.earnedAmountA)} -  {dualStakingInfo.rewardTokenA.symbol} - +  {dualStakingInfo.rewardTokenA.symbol} + - + - + {formatTokenAmount(dualStakingInfo.earnedAmountB)} -  {dualStakingInfo.rewardTokenB.symbol} - +  {dualStakingInfo.rewardTokenB.symbol} + )} diff --git a/src/components/FarmCard/FarmCardDetails.tsx b/src/components/FarmCard/FarmCardDetails.tsx index c88cb06a0..1da29ee4e 100644 --- a/src/components/FarmCard/FarmCardDetails.tsx +++ b/src/components/FarmCard/FarmCardDetails.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { TransactionResponse } from '@ethersproject/providers'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { useTranslation } from 'react-i18next'; import { StakingInfo, DualStakingInfo } from 'types'; import { TokenAmount, Pair } from '@uniswap/sdk'; @@ -33,75 +33,13 @@ import { } from 'utils'; import CircleInfoIcon from 'assets/images/circleinfo.svg'; -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - inputVal: { - backgroundColor: palette.background.paper, - borderRadius: '10px', - height: '50px', - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - '& p': { - cursor: 'pointer', - }, - }, - buttonToken: { - backgroundColor: palette.grey.A400, - borderRadius: '10px', - height: '50px', - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - cursor: 'pointer', - }, - buttonClaim: { - backgroundImage: - 'linear-gradient(280deg, #64fbd3 0%, #00cff3 0%, #0098ff 10%, #004ce6 100%)', - borderRadius: '10px', - height: '50px', - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - cursor: 'pointer', - color: 'white', - }, - buttonWrapper: { - minWidth: 250, - width: '30%', - color: palette.text.secondary, - borderRadius: 16, - [breakpoints.down('xs')]: { - width: '100%', - padding: 16, - border: `1px solid ${palette.divider}`, - }, - }, - dailyRateWrapper: { - display: 'flex', - alignItems: 'center', - flexWrap: 'wrap', - background: palette.secondary.contrastText, - width: '100%', - marginBottom: 16, - padding: '8px 16px', - borderRadius: 10, - [breakpoints.down('xs')]: { - margin: '0 16px 16px', - width: 'calc(100% - 32px)', - }, - }, -})); - const FarmCardDetails: React.FC<{ stakingInfo: StakingInfo | DualStakingInfo; stakingAPY: number; isLPFarm?: boolean; }> = ({ stakingInfo, stakingAPY, isLPFarm }) => { - const classes = useStyles(); const { t } = useTranslation(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const [stakeAmount, setStakeAmount] = useState(''); const [attemptStaking, setAttemptStaking] = useState(false); @@ -320,100 +258,67 @@ const FarmCardDetails: React.FC<{ return ( <> {stakingInfo && ( <> {isMobile && ( <> - - - {t('tvl')} - - {tvl} + + {t('tvl')} + {tvl} - - - {t('rewards')} - + + {t('rewards')} - + ${(isLPFarm ? lpRewards : dualRewards).toLocaleString()} / {t('day')} - + {isLPFarm ? ( - {lpPoolRate} + {lpPoolRate} ) : ( <> - {dualPoolRateA} - {dualPoolRateB} + {dualPoolRateA} + {dualPoolRateB} )} - - - - {t('apy')} - + + + {t('apy')} {'arrow - - {apyWithFee}% - + {apyWithFee}% )} {!stakingInfo.ended && ( - - - {t('inwallet')}: - - - {formatTokenAmount(userLiquidityUnstaked)} {t('lp')}{' '} - ({getUSDString(stakedAmounts?.unStakedUSD)}) - + + + {t('inwallet')}: + + + {formatTokenAmount(userLiquidityUnstaked)} {t('lp')} ( + {getUSDString(stakedAmounts?.unStakedUSD)}) + {t('get')} {currency0?.symbol} / {currency1?.symbol}{' '} {t('lp')} - + - { if ( userLiquidityUnstaked && @@ -443,12 +346,10 @@ const FarmCardDetails: React.FC<{ }} > {t('max')} - + { @@ -461,7 +362,7 @@ const FarmCardDetails: React.FC<{ } }} > - +

{attemptStaking ? t('stakingLPTokens') : approval === ApprovalState.APPROVED @@ -469,19 +370,19 @@ const FarmCardDetails: React.FC<{ : approving ? t('approving') : t('approve')} - +

)} - - - {t('mydeposits')}: - - {formatTokenAmount(stakingInfo.stakedAmount)} {t('lp')}{' '} - ({getUSDString(stakedAmounts?.myStakedUSD)}) - + + + {t('mydeposits')}: + + {formatTokenAmount(stakingInfo.stakedAmount)} {t('lp')} ( + {getUSDString(stakedAmounts?.myStakedUSD)}) + - + - { if ( stakingInfo.stakedAmount && @@ -511,12 +410,10 @@ const FarmCardDetails: React.FC<{ }} > {t('max')} - + { @@ -525,24 +422,17 @@ const FarmCardDetails: React.FC<{ } }} > - +

{attemptUnstaking ? t('unstakingLPTokens') : t('unstakeLPTokens')} - +

- - + + - - {t('unclaimedRewards')}: - + {t('unclaimedRewards')}: {isLPFarm ? ( <> @@ -550,11 +440,11 @@ const FarmCardDetails: React.FC<{ - +

{formatTokenAmount(lpStakingInfo.earnedAmount)} -  {lpStakingInfo.rewardToken.symbol} - - {earnedUSDStr} +  {lpStakingInfo.rewardToken.symbol} +

+ {earnedUSDStr}
) : ( @@ -568,23 +458,21 @@ const FarmCardDetails: React.FC<{ />
- {earnedUSDStr} - +

{earnedUSDStr}

+

{formatTokenAmount(dualStakingInfo.earnedAmountA)}  {dualStakingInfo.rewardTokenA.symbol} - - +

+

{formatTokenAmount(dualStakingInfo.earnedAmountB)}  {dualStakingInfo.rewardTokenB.symbol} - +

)}
{ if (claimEnabled) { @@ -592,34 +480,24 @@ const FarmCardDetails: React.FC<{ } }} > - - {attemptClaiming ? t('claiming') : t('claim')} - +

{attemptClaiming ? t('claiming') : t('claim')}

)}
{mainRewardRate?.greaterThan('0') && ( - - - - + + + + {t('yourRate', { symbol: isLPFarm ? '' : dualStakingInfo.rewardTokenA.symbol, })} : - + - + {formatMulDivTokenAmount( mainRewardRate, GlobalConst.utils.ONEDAYSECONDS, @@ -628,50 +506,34 @@ const FarmCardDetails: React.FC<{ ? lpStakingInfo.rewardToken.symbol : dualStakingInfo.rewardTokenA.symbol}{' '} / {t('day')} - + {!isLPFarm && ( - - - + + + {t('yourRate', { symbol: dualStakingInfo.rewardTokenB.symbol, })} : - + - + {formatMulDivTokenAmount( dualStakingInfo.rewardRateB, GlobalConst.utils.ONEDAYSECONDS, )}{' '} {dualStakingInfo.rewardTokenB.symbol} / {t('day')} - + )} - - - - {t('yourFees')}: - + + + {t('yourFees')}: - + ${formatNumber(stakingInfo.accountFee)} / {t('day')} - + )} diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index ebeae847c..b595d7e5c 100755 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,29 +1,15 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { ReactComponent as QuickIcon } from 'assets/images/quickIcon.svg'; - -const useStyles = makeStyles(({}) => ({ - footer: { - textAlign: 'center', - paddingBottom: 110, - position: 'relative', - '& p': { - fontSize: 14, - lineHeight: '24px', - marginTop: 20, - }, - }, -})); +import 'components/styles/Footer.scss'; const Footer: React.FC = () => { - const classes = useStyles(); const copyrightYear = new Date().getFullYear(); return ( - + - © {copyrightYear} QuickSwap. +

© {copyrightYear} QuickSwap.

); }; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index c2371d414..b86ee9e99 100755 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,8 +1,7 @@ import React, { useMemo, useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import cx from 'classnames'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { useWalletModalToggle } from 'state/application/hooks'; import { isTransactionRecent, @@ -18,235 +17,13 @@ import QuickLogo from 'assets/images/quickLogo.png'; import { ReactComponent as ThreeDotIcon } from 'assets/images/ThreeDot.svg'; import { ReactComponent as LightIcon } from 'assets/images/LightIcon.svg'; import WalletIcon from 'assets/images/WalletIcon.png'; -import styled from 'styled-components'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - header: { - padding: '0 24px', - position: 'relative', - display: 'flex', - flexWrap: 'wrap', - minHeight: 88, - zIndex: 3, - alignItems: 'center', - justifyContent: 'space-between', - '& a': { - display: 'flex', - }, - '& > div': { - display: 'flex', - alignItems: 'center', - zIndex: 2, - '&:last-child': { - '& button': { - height: 40, - borderRadius: 20, - '&:first-child': { - padding: '0 16px', - marginRight: 16, - '& svg': { - width: 20, - height: 20, - marginRight: 8, - }, - }, - '&:last-child': { - padding: '0 32px', - }, - '& p': { - fontSize: 16, - }, - }, - }, - }, - [breakpoints.down('sm')]: { - alignItems: 'center', - }, - [breakpoints.down('xs')]: { - padding: '0 16px', - }, - }, - networkWrapper: { - marginLeft: 16, - padding: '0 12px', - height: 26, - borderRadius: 13, - display: 'flex', - alignItems: 'center', - background: palette.primary.dark, - '& p': { - marginLeft: 6, - textTransform: 'uppercase', - fontSize: 13, - color: 'rgba(255, 255, 255, 0.87)', - }, - [breakpoints.down('xs')]: { - display: 'none', - }, - }, - mainMenu: { - position: 'absolute', - left: '50%', - transform: 'translateX(-50%)', - display: 'flex', - alignItems: 'center', - height: '100%', - '& .menuItem': { - borderRadius: 10, - cursor: 'pointer', - position: 'relative', - '& .subMenu': { - display: 'none', - position: 'absolute', - left: 0, - top: 14, - background: palette.background.paper, - borderRadius: 10, - padding: '14px 0', - '& > a': { - padding: '10px 24px', - '&:hover': { - color: 'white', - }, - }, - }, - '&:hover': { - background: palette.secondary.dark, - '& .subMenu': { - display: 'block', - }, - }, - }, - '& a': { - textDecoration: 'none', - padding: '7.5px 24px', - marginRight: 12, - color: palette.text.secondary, - borderRadius: 10, - '& p': { - letterSpacing: 'normal', - }, - '&.active': { - color: palette.text.primary, - background: palette.secondary.dark, - }, - '&:last-child': { - marginRight: 0, - }, - }, - }, - accountDetails: { - border: `solid 1px ${palette.grey.A400}`, - padding: '0 16px', - height: 36, - cursor: 'pointer', - borderRadius: 20, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - '& p': { - fontSize: 14, - fontWeight: 600, - }, - '& img': { - width: 20, - marginLeft: 8, - }, - }, - connectButton: { - width: 152, - height: 36, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - borderRadius: 20, - fontSize: 14, - fontWeight: 600, - color: 'white', - cursor: 'pointer', - position: 'relative', - '&:hover $wrongNetworkContent': { - display: 'block', - }, - }, - primary: { - backgroundColor: '#004ce6', - }, - danger: { - backgroundColor: palette.error.main, - }, - wrongNetworkContent: { - background: palette.background.paper, - borderRadius: 10, - padding: 24, - display: 'none', - '& p': { - color: '#b6b9cc', - fontSize: 14, - lineHeight: 1.57, - marginBottom: 20, - }, - '& div': { - width: '100%', - height: 36, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - borderRadius: 20, - border: `solid 1px ${palette.primary.main}`, - color: palette.primary.main, - fontSize: 14, - fontWeight: 600, - }, - }, - mobileMenuContainer: { - background: palette.secondary.dark, - position: 'fixed', - left: 0, - bottom: 0, - height: 64, - width: '100%', - borderTopLeftRadius: 20, - borderTopRightRadius: 20, - padding: '0 16px', - justifyContent: 'center', - }, - mobileMenu: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - maxWidth: 375, - width: '100%', - '& a': { - textDecoration: 'none', - padding: '8px 12px', - color: palette.text.secondary, - fontWeight: 'bold', - '&.active': { - color: palette.primary.main, - }, - }, - }, -})); - -const StyledPollingDot = styled.div` - width: 15px; - height: 15px; - min-height: 8px; - min-width: 8px; - margin-left: 0rem; - margin-top: 0px; - border-radius: 50%; - position: relative; - background-color: ${({ theme }) => theme.green1}; -`; +import 'components/styles/Header.scss'; const newTransactionsFirst = (a: TransactionDetails, b: TransactionDetails) => { return b.addedTime - a.addedTime; }; const Header: React.FC = () => { - const classes = useStyles(); const { pathname } = useLocation(); const { account } = useActiveWeb3React(); const { ethereum } = window as any; @@ -329,7 +106,7 @@ const Header: React.FC = () => { ]; return ( - + { /> {!tabletWindowSize && ( - + {menuItems.map((val, index) => ( { pathname.indexOf(val.link) > -1 ? 'active' : 'menuItem' } > - {val.text} + {val.text} ))} {/* @@ -368,7 +145,7 @@ const Header: React.FC = () => { {outLinks.map((item, ind) => (
- {item.text} + {item.text} ))} @@ -377,8 +154,8 @@ const Header: React.FC = () => { )} {tabletWindowSize && ( - - + + {menuItems.slice(0, 4).map((val, index) => ( { pathname.indexOf(val.link) > -1 ? 'active' : 'menuItem' } > - {val.text} + {val.text} ))} - + setOpenDetailMenu(!openDetailMenu)} /> {openDetailMenu && ( - + {menuItems.slice(4, menuItems.length).map((val, index) => ( { className='menuItem' onClick={() => setOpenDetailMenu(false)} > - {val.text} + {val.text} ))} {outLinks.map((item, ind) => ( @@ -422,7 +190,7 @@ const Header: React.FC = () => { key={ind} onClick={() => setOpenDetailMenu(false)} > - {item.text} + {item.text} ))} @@ -433,34 +201,26 @@ const Header: React.FC = () => { )} - - + + {account && (!ethereum || isSupportedNetwork(ethereum)) ? ( - {shortenAddress(account)} +

{shortenAddress(account)}

Wallet
) : ( { if (!ethereum || isSupportedNetwork(ethereum)) { toggleWalletModal(); @@ -471,18 +231,12 @@ const Header: React.FC = () => { ? 'Wrong Network' : 'Connect Wallet'} {ethereum && !isSupportedNetwork(ethereum) && ( - - - - Please switch your wallet to Polygon Network. - - Switch to Polygon + + + Please switch your wallet to Polygon Network. + + Switch to Polygon + )} diff --git a/src/components/NumericalInput/NumericalInput.tsx b/src/components/NumericalInput/NumericalInput.tsx index 6def0d7ae..a2fad69fe 100644 --- a/src/components/NumericalInput/NumericalInput.tsx +++ b/src/components/NumericalInput/NumericalInput.tsx @@ -1,41 +1,6 @@ import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; import { escapeRegExp } from 'utils'; - -const useStyles = makeStyles(({ palette }) => ({ - styledInput: { - width: '100%', - position: 'relative', - outline: 'none', - border: 'none', - whiteSpace: 'nowrap', - overflow: 'hidden', - textOverflow: 'ellipsis', - WebkitAppearance: 'textfield', - background: 'transparent', - boxShadow: 'none', - textAlign: (props: any) => props.align ?? 'left', - color: (props: any) => props.color ?? palette.text.primary, - fontSize: (props: any) => props.fontSize ?? 18, - fontWeight: (props: any) => props.fontWeight ?? 600, - - '&::placeholder': { - color: (props: any) => props.placeholderColor ?? palette.text.secondary, - }, - - '&::-webkit-search-decoration': { - WebkitAppearance: 'none', - }, - - '& [type="number"]': { - MozAppearance: 'textfield', - }, - - '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': { - WebkitAppearance: 'none', - }, - }, -})); +import 'components/styles/NumericalInput.scss'; const inputRegex = RegExp(`^\\d*(?:\\\\[.])?\\d*$`); // match escaped "." characters via in a non-capturing group @@ -46,7 +11,6 @@ export const Input = React.memo(function InnerInput({ fontSize, color, fontWeight, - placeholderColor, align, ...rest }: { @@ -55,16 +19,8 @@ export const Input = React.memo(function InnerInput({ error?: boolean; fontSize?: number; fontWeight?: string | number; - placeholderColor?: string; align?: 'right' | 'left'; } & Omit, 'ref' | 'onChange' | 'as'>) { - const classes = useStyles({ - fontSize, - color, - fontWeight, - placeholderColor, - align, - }); const enforcer = (nextUserInput: string) => { if (nextUserInput === '' || inputRegex.test(escapeRegExp(nextUserInput))) { onUserInput(nextUserInput); @@ -74,8 +30,9 @@ export const Input = React.memo(function InnerInput({ return ( { // replace commas with periods, because uniswap exclusively uses period as the decimal separator enforcer(event.target.value.replace(/,/g, '.')); diff --git a/src/components/PairsTable/PairsTable.tsx b/src/components/PairsTable/PairsTable.tsx index ba3ed5277..a9f90725c 100644 --- a/src/components/PairsTable/PairsTable.tsx +++ b/src/components/PairsTable/PairsTable.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Box, Typography, Divider } from '@material-ui/core'; +import { Box, Divider } from '@material-ui/core'; import { Link } from 'react-router-dom'; import { ChainId, Token } from '@uniswap/sdk'; import { getAddress } from '@ethersproject/address'; @@ -89,7 +89,7 @@ const PairTable: React.FC = ({ data }) => { ).toLocaleString(); return ( - + = ({ data }) => { )} - - + + - +

{token0.symbol} / {token1.symbol} - +

- - Liquidity - - ${Number(liquidity).toLocaleString()} - + +

Liquidity

+

${Number(liquidity).toLocaleString()}

- - 24h Volume - - ${Number(oneDayVolume).toLocaleString()} - + +

24h Volume

+

${Number(oneDayVolume).toLocaleString()}

- - 7d Volume - - ${Number(oneWeekVolume).toLocaleString()} - + +

7d Volume

+

${Number(oneWeekVolume).toLocaleString()}

- - 24h Fees - - ${Number(oneDayFee).toLocaleString()} - + +

24h Fees

+

${oneDayFee}

); @@ -209,7 +178,7 @@ const PairTable: React.FC = ({ data }) => { return [ { html: ( - + = ({ data }) => { )} - - + + - +

{token0.symbol} / {token1.symbol} - +

@@ -249,28 +215,16 @@ const PairTable: React.FC = ({ data }) => { ), }, { - html: ( - - ${Number(liquidity).toLocaleString()} - - ), + html:

${Number(liquidity).toLocaleString()}

, }, { - html: ( - - ${Number(oneDayVolume).toLocaleString()} - - ), + html:

${Number(oneDayVolume).toLocaleString()}

, }, { - html: ( - - ${Number(oneWeekVolume).toLocaleString()} - - ), + html:

${Number(oneWeekVolume).toLocaleString()}

, }, { - html: ${oneDayFee}, + html:

${oneDayFee}

, }, ]; }; diff --git a/src/components/PoolFinderModal/PoolFinderModal.tsx b/src/components/PoolFinderModal/PoolFinderModal.tsx index 820d162a5..4cb472837 100644 --- a/src/components/PoolFinderModal/PoolFinderModal.tsx +++ b/src/components/PoolFinderModal/PoolFinderModal.tsx @@ -1,8 +1,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { Currency, TokenAmount, ETHER, JSBI } from '@uniswap/sdk'; import { ArrowLeft, Plus } from 'react-feather'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { CustomModal, CurrencyLogo, @@ -16,18 +15,7 @@ import { useActiveWeb3React } from 'hooks'; import { currencyId } from 'utils'; import { ReactComponent as CloseIcon } from 'assets/images/CloseIcon.svg'; import { Link } from 'react-router-dom'; - -const useStyles = makeStyles(({ palette }) => ({ - borderedCard: { - border: `1px solid ${palette.divider}`, - padding: 8, - borderRadius: 10, - cursor: 'pointer', - '&:hover': { - border: `1px solid ${palette.text.primary}`, - }, - }, -})); +import 'components/styles/PoolFinderModal.scss'; enum Fields { TOKEN0 = 0, @@ -40,9 +28,6 @@ interface PoolFinderModalProps { } const PoolFinderModal: React.FC = ({ open, onClose }) => { - const classes = useStyles(); - const { palette } = useTheme(); - const { account } = useActiveWeb3React(); const [showSearch, setShowSearch] = useState(false); @@ -98,44 +83,38 @@ const PoolFinderModal: React.FC = ({ open, onClose }) => { return ( - + - - Import Pool - - +
Import Pool
+
{ setShowSearch(true); setActiveField(Fields.TOKEN0); }} > {currency0 ? ( - + - +

{currency0.symbol} - +

) : ( - Select a Token +

Select a Token

)}
- - + + { setShowSearch(true); setActiveField(Fields.TOKEN1); @@ -144,84 +123,65 @@ const PoolFinderModal: React.FC = ({ open, onClose }) => { {currency1 ? ( - +

{currency1.symbol} - +

) : ( - Select a Token +

Select a Token

)}
{hasPosition && ( - Pool Found! - +

Pool Found!

+

Manage this pool. - +

)} - + {currency0 && currency1 ? ( pairState === PairState.EXISTS ? ( hasPosition && pair ? ( ) : ( - - You don’t have liquidity in this pool yet. - +

You don’t have liquidity in this pool yet.

- Add liquidity. +

Add liquidity.

) ) : validPairNoLiquidity ? ( - No pool found. +

No pool found.

Create pool.
) : pairState === PairState.INVALID ? ( - Invalid pair. +

Invalid pair.

) : pairState === PairState.LOADING ? ( - Loading... +

Loading...

) : null ) : ( - +

{!account ? 'Connect to a wallet to find pools' : 'Select a token to find your liquidity.'} - +

)}
diff --git a/src/components/PoolPositionCard/PoolPositionCard.tsx b/src/components/PoolPositionCard/PoolPositionCard.tsx index c3f1493f9..d36b4d679 100755 --- a/src/components/PoolPositionCard/PoolPositionCard.tsx +++ b/src/components/PoolPositionCard/PoolPositionCard.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useMemo, useState } from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; +import { Box, useMediaQuery } from '@material-ui/core'; import { useTheme } from '@material-ui/core/styles'; import { ChevronDown, ChevronUp } from 'react-feather'; import { Pair } from '@uniswap/sdk'; @@ -12,10 +12,11 @@ import { import { DoubleCurrencyLogo } from 'components'; import { formatAPY, getAPYWithFee, getOneYearFee } from 'utils'; import PoolPositionCardDetails from './PoolPositionCardDetails'; +import 'components/styles/PoolPositionCard.scss'; const PoolPositionCard: React.FC<{ pair: Pair }> = ({ pair }) => { const [bulkPairData, setBulkPairData] = useState(null); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const currency0 = unwrappedToken(pair.token0); @@ -58,45 +59,35 @@ const PoolPositionCard: React.FC<{ pair: Pair }> = ({ pair }) => { return ( - + - +

{!currency0 || !currency1 ? 'Loading' : `${currency0.symbol}/${currency1.symbol}`} - +

setShowMore(!showMore)} > - - Manage - +

Manage

{showMore ? : }
@@ -104,14 +95,11 @@ const PoolPositionCard: React.FC<{ pair: Pair }> = ({ pair }) => { {showMore && } {stakingInfo && !stakingInfo.ended && apyWithFee && ( - - Earn{' '} - - {apyWithFee}% APY - {' '} - by staking your LP tokens in {currency0.symbol?.toUpperCase()} /{' '} + + Earn {apyWithFee}% APY by + staking your LP tokens in {currency0.symbol?.toUpperCase()} /{' '} {currency1.symbol?.toUpperCase()} Farm - + )}
diff --git a/src/components/PoolPositionCard/PoolPositionCardDetails.tsx b/src/components/PoolPositionCard/PoolPositionCardDetails.tsx index 512643f5a..f6970a485 100644 --- a/src/components/PoolPositionCard/PoolPositionCardDetails.tsx +++ b/src/components/PoolPositionCard/PoolPositionCardDetails.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { useHistory } from 'react-router-dom'; -import { Box, Typography, Button, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Button, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { Pair, JSBI, Percent } from '@uniswap/sdk'; import { useActiveWeb3React } from 'hooks'; import { unwrappedToken } from 'utils/wrappedCurrency'; @@ -10,50 +10,7 @@ import { useTotalSupply } from 'data/TotalSupply'; import { CurrencyLogo, RemoveLiquidityModal } from 'components'; import { currencyId, formatTokenAmount } from 'utils'; -const useStyles = makeStyles(({ palette }) => ({ - poolButtonRow: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - '& .MuiButton-root': { - height: 36, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - cursor: 'pointer', - borderRadius: 10, - '& a': { - textDecoration: 'none', - }, - '& p': { - color: palette.text.primary, - }, - }, - '& .MuiButton-outlined': { - width: '49%', - background: 'transparent', - border: '1px solid #404557', - }, - '& .MuiButton-contained': { - width: '24%', - border: '1px solid transparent', - backgroundImage: 'linear-gradient(286deg, #004ce6, #3d71ff)', - backgroundColor: 'transparent', - }, - }, - cardRow: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - marginBottom: 12, - '& p': { - color: palette.text.primary, - }, - }, -})); - const PoolPositionCardDetails: React.FC<{ pair: Pair }> = ({ pair }) => { - const classes = useStyles(); const history = useHistory(); const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); @@ -102,49 +59,43 @@ const PoolPositionCardDetails: React.FC<{ pair: Pair }> = ({ pair }) => { return ( <> - - Your pool tokens: - - {formatTokenAmount(userPoolBalance)} - + + Your pool tokens: + {formatTokenAmount(userPoolBalance)} - - Pooled {currency0.symbol}: - - - {formatTokenAmount(token0Deposited)} - + + Pooled {currency0.symbol}: + + {formatTokenAmount(token0Deposited)} - - Pooled {currency1.symbol}: - - - {formatTokenAmount(token1Deposited)} - + + Pooled {currency1.symbol}: + + {formatTokenAmount(token1Deposited)} - - Your pool share: - + + Your pool share: + {poolTokenPercentage ? poolTokenPercentage.toSignificant() + '%' : '-'} - + - + diff --git a/src/components/Popups/PopupItem.tsx b/src/components/Popups/PopupItem.tsx index b17aa8ed9..dceb76a22 100644 --- a/src/components/Popups/PopupItem.tsx +++ b/src/components/Popups/PopupItem.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useEffect } from 'react'; import { Box } from '@material-ui/core'; -import { useTheme } from '@material-ui/core/styles'; import { PopupContent } from 'state/application/actions'; import { useRemovePopup } from 'state/application/hooks'; import TransactionPopup from './TransactionPopup'; @@ -16,7 +15,6 @@ const PopupItem: React.FC = ({ content, popKey, }) => { - const { palette } = useTheme(); const removePopup = useRemovePopup(); const removeThisPopup = useCallback(() => removePopup(popKey), [ popKey, @@ -49,17 +47,7 @@ const PopupItem: React.FC = ({ ); } - return ( - - {popupContent} - - ); + return {popupContent}; }; export default PopupItem; diff --git a/src/components/Popups/TransactionPopup.tsx b/src/components/Popups/TransactionPopup.tsx index 0cebafa0c..5f9a0452b 100644 --- a/src/components/Popups/TransactionPopup.tsx +++ b/src/components/Popups/TransactionPopup.tsx @@ -1,25 +1,9 @@ import React, { useEffect } from 'react'; -import { Box, LinearProgress, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, LinearProgress } from '@material-ui/core'; import { useActiveWeb3React } from 'hooks'; import { getEtherscanLink } from 'utils/index'; import { ReactComponent as ArrowTopRight } from 'assets/images/ArrowTopRight.svg'; -const useStyles = makeStyles(({}) => ({ - pendingBar: { - position: 'absolute', - bottom: 0, - width: '100%', - left: 0, - '& .MuiLinearProgress-root': { - background: 'rgba(255, 160, 0, 0.3)', - '& .MuiLinearProgress-bar': { - background: '#ffa000', - }, - }, - }, -})); - interface TransactionPopupProps { hash: string; pending?: boolean; @@ -33,8 +17,6 @@ const TransactionPopup: React.FC = ({ success, summary, }) => { - const classes = useStyles(); - const { palette } = useTheme(); const { chainId } = useActiveWeb3React(); const [progress, setProgress] = React.useState(0); @@ -52,25 +34,14 @@ const TransactionPopup: React.FC = ({ return ( <> - - + {pending ? 'Processing…' : success ? 'Confirmed' : 'Failed'} - + {chainId && hash.length > 0 && ( = ({ )} - + {summary ?? 'Hash: ' + hash.slice(0, 8) + '...' + hash.slice(58, 65)} - + {pending && ( - + )} diff --git a/src/components/Popups/index.tsx b/src/components/Popups/index.tsx index 32c6a7400..6ef806c45 100644 --- a/src/components/Popups/index.tsx +++ b/src/components/Popups/index.tsx @@ -1,59 +1,21 @@ import React from 'react'; import { Box } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; import { useActivePopups } from 'state/application/hooks'; import { useURLWarningVisible } from 'state/user/hooks'; import PopupItem from './PopupItem'; - -const useStyles = makeStyles(({ breakpoints }) => ({ - mobilePopupWrapper: { - position: 'relative', - maxWidth: '100%', - height: (props: any) => props.height, - margin: (props: any) => (props.height ? '0 auto' : 0), - marginBottom: (props: any) => (props.height ? '20px' : 0), - display: 'none', - [breakpoints.down('xs')]: { - display: 'block', - }, - }, - mobilePopupInner: { - height: '99%', - overflowX: 'auto', - overflowY: 'hidden', - display: 'flex', - flexDirection: 'row', - WebkitOverflowScrolling: 'touch', - '&::-webkit-scrollbar': { - display: 'none', - }, - }, - fixedPopupColumn: { - position: 'fixed', - top: (props: any) => (props.extraPadding ? '108px' : '88px'), - right: 40, - maxWidth: '355px !important', - width: '100%', - zIndex: 3, - - [breakpoints.down('xs')]: { - display: 'none', - }, - }, -})); +import 'components/styles/Popups.scss'; const Popups: React.FC = () => { // get all popups const activePopups = useActivePopups(); const urlWarningActive = useURLWarningVisible(); - const classes = useStyles({ - extraPadding: urlWarningActive, - height: activePopups?.length > 0 ? 'fit-content' : 0, - }); return ( <> - + {activePopups.map((item) => ( { /> ))} - - + 0 ? 'fit-content' : 0} + margin={activePopups?.length > 0 ? '0 auto 20px' : 0} + > + {activePopups // reverse so new items up front .slice(0) .reverse() diff --git a/src/components/PositionCard/PositionCard.tsx b/src/components/PositionCard/PositionCard.tsx index f2c219661..26aba7924 100755 --- a/src/components/PositionCard/PositionCard.tsx +++ b/src/components/PositionCard/PositionCard.tsx @@ -1,27 +1,13 @@ import { JSBI, Pair, Percent } from '@uniswap/sdk'; import React, { useState } from 'react'; -import { Box, Typography, Button } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; -import { ChevronDown, ChevronUp } from 'react-feather'; -import { Link } from 'react-router-dom'; +import { Box } from '@material-ui/core'; import { useTotalSupply } from 'data/TotalSupply'; import { useActiveWeb3React } from 'hooks'; import { useTokenBalance } from 'state/wallet/hooks'; -import { currencyId, formatTokenAmount } from 'utils'; +import { formatTokenAmount } from 'utils'; import { unwrappedToken } from 'utils/wrappedCurrency'; -import { CurrencyLogo, DoubleCurrencyLogo } from 'components'; - -const useStyles = makeStyles(({ palette }) => ({ - minimalCardWrapper: { - width: '100%', - borderRadius: 16, - padding: 12, - '& p': { - fontSize: '16px !important', - lineHeight: '24px !important', - }, - }, -})); +import { DoubleCurrencyLogo } from 'components'; +import 'components/styles/PositionCard.scss'; interface PositionCardProps { pair: Pair; @@ -35,7 +21,6 @@ export const MinimalPositionCard: React.FC = ({ showUnwrapped = false, }) => { const { account } = useActiveWeb3React(); - const classes = useStyles(); const currency0 = showUnwrapped ? pair.token0 : unwrappedToken(pair.token0); const currency1 = showUnwrapped ? pair.token1 : unwrappedToken(pair.token1); @@ -78,220 +63,54 @@ export const MinimalPositionCard: React.FC = ({ : [undefined, undefined]; return ( - + {userPoolBalance && JSBI.greaterThan(userPoolBalance.raw, JSBI.BigInt(0)) ? ( - Your position +

Your position

setShowMore(!showMore)} > - + - +

{currency0.symbol}/{currency1.symbol} - +

- {formatTokenAmount(userPoolBalance)} +

{formatTokenAmount(userPoolBalance)}

- - Your pool share: - + +

Your pool share:

+

{poolTokenPercentage ? poolTokenPercentage.toFixed(6) + '%' : '-'} - +

- - {currency0.symbol}: - {formatTokenAmount(token0Deposited)} + +

{currency0.symbol}:

+

{formatTokenAmount(token0Deposited)}

- - {currency1.symbol}: - {formatTokenAmount(token1Deposited)} + +

{currency1.symbol}:

+

{formatTokenAmount(token1Deposited)}

) : ( - +

⭐️ {' '} By adding liquidity you'll earn 0.25% of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity. - - )} - - ); -}; - -const FullPositionCard: React.FC = ({ pair }) => { - const { account } = useActiveWeb3React(); - - const currency0 = unwrappedToken(pair.token0); - const currency1 = unwrappedToken(pair.token1); - - const [showMore, setShowMore] = useState(false); - - const userPoolBalance = useTokenBalance( - account ?? undefined, - pair.liquidityToken, - ); - const totalPoolTokens = useTotalSupply(pair.liquidityToken); - - const poolTokenPercentage = - !!userPoolBalance && - !!totalPoolTokens && - JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw) - ? new Percent(userPoolBalance.raw, totalPoolTokens.raw) - : undefined; - - const [token0Deposited, token1Deposited] = - !!pair && - !!totalPoolTokens && - !!userPoolBalance && - // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply - JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw) - ? [ - pair.getLiquidityValue( - pair.token0, - totalPoolTokens, - userPoolBalance, - false, - ), - pair.getLiquidityValue( - pair.token1, - totalPoolTokens, - userPoolBalance, - false, - ), - ] - : [undefined, undefined]; - - return ( - - - - - - {!currency0 || !currency1 ? ( - Loading - ) : ( - `${currency0.symbol}/${currency1.symbol}` - )} - - - - - - - {showMore && ( - - - Your pool tokens: - {formatTokenAmount(userPoolBalance)} - - - Pooled {currency0.symbol}: - - {formatTokenAmount(token0Deposited)} - - - - - - Pooled {currency1.symbol}: - - {formatTokenAmount(token1Deposited)} - - - - - - Your pool share: - - {poolTokenPercentage ? poolTokenPercentage.toFixed(2) + '%' : '-'} - - - - - - - - Add - - - - - Remove - - - - +

)}
); }; -export default FullPositionCard; +export default MinimalPositionCard; diff --git a/src/components/QuestionHelper/QuestionHelper.tsx b/src/components/QuestionHelper/QuestionHelper.tsx index dbf116fad..2f3ba0393 100755 --- a/src/components/QuestionHelper/QuestionHelper.tsx +++ b/src/components/QuestionHelper/QuestionHelper.tsx @@ -1,56 +1,17 @@ import React from 'react'; import { Box } from '@material-ui/core'; import { HelpCircle as Question, PlusCircle } from 'react-feather'; -import { makeStyles } from '@material-ui/core/styles'; import { CustomTooltip } from 'components'; - -const useStyles = makeStyles(({ palette }) => ({ - questionWrapper: { - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - padding: 0.2, - border: 'none', - background: 'none', - outline: 'none', - borderRadius: 36, - color: (props: any) => (props.color ? props.color : palette.text.primary), - '&:hover, &:focus': { - opacity: 0.7, - }, - }, - lightQuestionWrapper: { - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - padding: 0.2, - border: 'none', - background: 'none', - outline: 'none', - cursor: 'default', - borderRadius: 36, - width: 24, - height: 24, - color: (props: any) => (props.color ? props.color : 'white'), - '&:hover, &:focus': { - opacity: 0.7, - }, - }, - questionMark: { - fontSize: '1rem', - }, -})); +import 'components/styles/QuestionHelper.scss'; const QuestionHelper: React.FC<{ text: string; size?: number; - color?: string; -}> = ({ text, size = 16, color }) => { - const classes = useStyles({ color }); - + className?: string; +}> = ({ text, size = 16, className }) => { return ( - + @@ -63,11 +24,9 @@ export const PlusHelper: React.FC<{ text: string; color?: string }> = ({ text, color, }) => { - const classes = useStyles({ color }); - return ( - + @@ -78,12 +37,10 @@ export const LightQuestionHelper: React.FC<{ text: string; color: string }> = ({ text, color, }) => { - const classes = useStyles({ color }); - return ( - - ? + + ? ); diff --git a/src/components/RemoveLiquidityModal/RemoveLiquidityModal.tsx b/src/components/RemoveLiquidityModal/RemoveLiquidityModal.tsx index d755a4a0a..16be9ef79 100644 --- a/src/components/RemoveLiquidityModal/RemoveLiquidityModal.tsx +++ b/src/components/RemoveLiquidityModal/RemoveLiquidityModal.tsx @@ -1,8 +1,7 @@ import React, { useState, useMemo, useCallback } from 'react'; import { Contract } from '@ethersproject/contracts'; import { ArrowLeft, ArrowDown } from 'react-feather'; -import { Box, Typography, Button } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Button } from '@material-ui/core'; import { Currency, ETHER, JSBI, Percent } from '@uniswap/sdk'; import ReactGA from 'react-ga'; import { BigNumber } from '@ethersproject/bignumber'; @@ -44,25 +43,7 @@ import { useRouterContract } from 'hooks/useContract'; import { wrappedCurrency } from 'utils/wrappedCurrency'; import { useTotalSupply } from 'data/TotalSupply'; import { ReactComponent as CloseIcon } from 'assets/images/CloseIcon.svg'; - -const useStyles = makeStyles(({ palette }) => ({ - removeButton: { - backgroundImage: - 'linear-gradient(104deg, #004ce6 -32%, #0098ff 54%, #00cff3 120%, #64fbd3 198%)', - backgroundColor: 'transparent', - height: 48, - width: '48%', - borderRadius: 10, - '& span': { - fontSize: 16, - fontWeight: 600, - }, - '&.Mui-disabled': { - backgroundImage: 'none', - backgroundColor: palette.secondary.dark, - }, - }, -})); +import 'components/styles/RemoveLiquidityModal.scss'; interface RemoveLiquidityModalProps { currency0: Currency; @@ -77,8 +58,6 @@ const RemoveLiquidityModal: React.FC = ({ open, onClose, }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [showConfirm, setShowConfirm] = useState(false); const [txPending, setTxPending] = useState(false); const [approving, setApproving] = useState(false); @@ -365,15 +344,15 @@ const RemoveLiquidityModal: React.FC = ({ const modalHeader = () => { return ( - + - - + +

Removing {formattedAmounts[Field.LIQUIDITY]} {currency0.symbol} /{' '} {currency1.symbol} LP Tokens
@@ -383,20 +362,16 @@ const RemoveLiquidityModal: React.FC = ({ {currency0.symbol} and{' '} {parsedAmounts[Field.CURRENCY_B]?.toSignificant(2)}{' '} {currency1.symbol} - +

- - + + {`Output is estimated. If the price changes by more than ${allowedSlippage / 100}% your transaction will revert.`} - + - @@ -436,38 +411,20 @@ const RemoveLiquidityModal: React.FC = ({ } /> )} - + - - Remove Liquidity - - +
Remove Liquidity
+
- - - + + + {currency0.symbol} / {currency1.symbol} LP - - - Balance: {formatTokenAmount(userPoolBalance)} - + + Balance: {formatTokenAmount(userPoolBalance)} = ({ }} /> - + + handleChange={(event, value) => setInnerLiquidityPercentage(value as number) } /> - - {formattedAmounts[Field.LIQUIDITY_PERCENT]}% - + {formattedAmounts[Field.LIQUIDITY_PERCENT]}% - - + + - - - Pooled {currency0.symbol} - - - {formatTokenAmount(token0Deposited)} - + + +

Pooled {currency0.symbol}

+ +

{formatTokenAmount(token0Deposited)}

- - - - Withdraw {currency0.symbol} - - - {formattedAmounts[Field.CURRENCY_A]} - + +

- Withdraw {currency0.symbol}

+

{formattedAmounts[Field.CURRENCY_A]}

- - Pooled {currency1.symbol} - - - {formatTokenAmount(token1Deposited)} - + +

Pooled {currency1.symbol}

+ +

{formatTokenAmount(token1Deposited)}

- - - - Withdraw {currency1.symbol} - - - {formattedAmounts[Field.CURRENCY_B]} - + +

- Withdraw {currency1.symbol}

+

{formattedAmounts[Field.CURRENCY_B]}

- - Your Pool Share - + +

Your Pool Share

+

{poolTokenPercentage ? poolTokenPercentage.toSignificant() + '%' : '-'} - +

{pair && ( - - + + 1 {currency0.symbol} ={' '} {tokenA ? pair.priceOf(tokenA).toSignificant(6) : '-'}{' '} {currency1.symbol} - - + + 1 {currency1.symbol} ={' '} {tokenB ? pair.priceOf(tokenB).toSignificant(6) : '-'}{' '} {currency0.symbol} -
+
)} - + - - {errorMsg} - +

{errorMsg}

diff --git a/src/components/RewardSlider/RewardSlider.tsx b/src/components/RewardSlider/RewardSlider.tsx index b78c5df09..7ba9f814e 100755 --- a/src/components/RewardSlider/RewardSlider.tsx +++ b/src/components/RewardSlider/RewardSlider.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import Slider from 'react-slick'; import { useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import ChevronLeftIcon from '@material-ui/icons/ChevronLeft'; import { StakingInfo } from 'types'; @@ -9,38 +9,9 @@ import { useStakingInfo, getBulkPairData } from 'state/stake/hooks'; import RewardSliderItem from './RewardSliderItem'; import { useActiveWeb3React } from 'hooks'; import { getOneYearFee, returnStakingInfo } from 'utils'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - rewardsSlider: { - width: 1072, - display: 'flex', - justifyContent: 'space-between', - margin: '64px auto 56px', - '& .slick-slide': { - padding: '0 20px', - [breakpoints.down('xs')]: { - padding: '0 6px', - }, - }, - '& .slick-arrow': { - color: palette.success.dark, - width: 32, - height: 32, - }, - [breakpoints.down('md')]: { - width: 776, - }, - [breakpoints.down('sm')]: { - width: 360, - }, - [breakpoints.down('xs')]: { - width: 320, - }, - }, -})); +import 'components/styles/RewardSlider.scss'; const RewardSlider: React.FC = () => { - const classes = useStyles(); const theme = useTheme(); const { chainId } = useActiveWeb3React(); const tabletWindowSize = useMediaQuery(theme.breakpoints.down('md')); @@ -85,7 +56,7 @@ const RewardSlider: React.FC = () => { }; return ( - + {rewardItems.map((item, index) => ( ({ - rewardsSliderItem: { - borderRadius: 32, - background: palette.background.paper, - padding: '32px 22px', - position: 'relative', - '& .rewardIcon': { - position: 'absolute', - display: 'flex', - top: 32, - left: 22, - }, - '& h5': { - marginLeft: 70, - textAlign: 'left', - }, - '& .row': { - display: 'flex', - width: '100%', - justifyContent: 'space-between', - alignItems: 'center', - marginTop: 12, - '& p': { - color: 'rgba(255, 255, 255, 0.47)', - display: 'flex', - alignItems: 'center', - '& svg': { - marginLeft: 4, - }, - }, - '& h4': { - color: 'white', - }, - '& h5': { - background: 'rgba(15, 198, 121, 0.12)', - color: palette.success.main, - padding: '0 4px', - borderRadius: 5, - }, - }, - '& button': { - height: 40, - fontSize: 16, - marginTop: 12, - background: palette.primary.main, - borderRadius: 20, - }, - }, -})); - interface RewardSliderItemProps { info: StakingInfo; stakingAPY: number; @@ -71,7 +20,6 @@ const RewardSliderItem: React.FC = ({ info, stakingAPY, }) => { - const classes = useStyles(); const history = useHistory(); const stakedAmounts = getStakedAmountStakingInfo(info); @@ -90,7 +38,7 @@ const RewardSliderItem: React.FC = ({ } return ( - + = ({ size={32} /> - +
{info.tokens[0].symbol?.toUpperCase()}- {info.tokens[1].symbol?.toUpperCase()} - +
- 24h Fees - - ${(info?.oneDayFee ?? 0).toLocaleString()} - +

24h Fees

+

${(info?.oneDayFee ?? 0).toLocaleString()}

- Rewards - - ${rewards.toLocaleString()} / day - +

Rewards

+

${rewards.toLocaleString()} / day

- TVL - {tvl} +

TVL

+

{tvl}

- +

APR - - {apyWithFee}% +

+ +

{apyWithFee}%

+
+
+ + -
); }; diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 37faf890b..373fc2e46 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState, useRef, useMemo } from 'react'; -import { makeStyles } from '@material-ui/core/styles'; import { useHistory } from 'react-router-dom'; -import { Box, Typography } from '@material-ui/core'; +import { Box } from '@material-ui/core'; import { ReactComponent as SearchIcon } from 'assets/images/SearchIcon.svg'; import { client } from 'apollo/client'; import { TOKEN_SEARCH, PAIR_SEARCH } from 'apollo/queries'; @@ -10,40 +9,9 @@ import { GlobalConst } from 'constants/index'; import { CurrencyLogo, DoubleCurrencyLogo } from 'components'; import { ChainId, Token } from '@uniswap/sdk'; import { getAddress } from '@ethersproject/address'; - -const useStyles = makeStyles(({ palette }) => ({ - searchInput: { - display: 'flex', - alignItems: 'center', - padding: '0 16px', - background: palette.grey.A700, - height: 46, - borderRadius: 10, - margin: '12px 0', - '& input': { - background: 'transparent', - border: 'none', - outline: 'none', - fontSize: 15, - fontWeight: 500, - minWidth: 240, - color: palette.text.primary, - }, - }, - searchContent: { - position: 'absolute', - width: '100%', - background: palette.grey.A700, - borderRadius: 10, - padding: 12, - zIndex: 2, - height: 300, - overflowY: 'auto', - }, -})); +import 'components/styles/SearchWidget.scss'; const Search: React.FC = () => { - const classes = useStyles(); const history = useHistory(); const [searchVal, setSearchVal] = useState(''); const [menuOpen, setMenuOpen] = useState(false); @@ -241,7 +209,7 @@ const Search: React.FC = () => { return ( - + { {menuOpen && ( -
- Pairs +
+

Pairs

{filteredPairs.slice(0, pairsShown).map((val, ind) => { const currency0 = new Token( ChainId.MATIC, @@ -271,9 +239,7 @@ const Search: React.FC = () => { history.push(`/analytics/pair/${val.id}`)} > { currency1={currency1} size={28} /> - + {val.token0.symbol} - {val.token1.symbol} Pair - + ); })} - setPairsShown(pairsShown + 5)} + margin='8px 0' > - Show More - - Tokens + Show More + +

Tokens

{filteredTokens.slice(0, tokensShown).map((val, ind) => { const currency = new Token( ChainId.MATIC, @@ -305,25 +271,25 @@ const Search: React.FC = () => { history.push(`/analytics/token/${val.id}`)} > - - {val.name} {val.symbol} - + + + {val.name} {val.symbol} + + ); })} - setTokensShown(tokensShown + 5)} > - Show More - + Show More +
)} diff --git a/src/components/SearchInput/SearchInput.tsx b/src/components/SearchInput/SearchInput.tsx index 671341eac..860ab86c9 100644 --- a/src/components/SearchInput/SearchInput.tsx +++ b/src/components/SearchInput/SearchInput.tsx @@ -1,42 +1,7 @@ import React, { useState } from 'react'; import { Box } from '@material-ui/core'; import { ReactComponent as SearchIcon } from 'assets/images/SearchIcon.svg'; -import { makeStyles } from '@material-ui/core/styles'; -import cx from 'classnames'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - searchInput: { - height: 40, - border: `1px solid ${palette.secondary.dark}`, - borderRadius: 10, - minWidth: 300, - display: 'flex', - alignItems: 'center', - padding: '0 10px', - width: '100%', - '& input': { - background: 'transparent', - border: 'none', - boxShadow: 'none', - outline: 'none', - marginLeft: 8, - fontSize: 14, - fontWeight: 500, - color: palette.text.primary, - flex: 1, - }, - [breakpoints.down('xs')]: { - minWidth: 'unset', - marginRight: 0, - }, - }, - focusedSearchInput: { - border: `1px solid ${palette.primary.main}`, - '& svg path': { - fill: `${palette.text.primary} !important`, - }, - }, -})); +import 'components/styles/SearchInput.scss'; interface SearchInputProps { placeholder: string; @@ -49,15 +14,9 @@ const SearchInput: React.FC = ({ value, setValue, }) => { - const classes = useStyles(); const [searchFocused, setSearchFocused] = useState(false); return ( - + ({ - slippageButton: { - width: 62, - height: 40, - borderRadius: 10, - border: `solid 1px ${palette.secondary.light}`, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - cursor: 'pointer', - marginRight: 16, - }, - activeSlippageButton: { - background: palette.primary.main, - }, - settingsInput: { - background: 'transparent', - border: 'none', - outline: 'none', - textAlign: 'right', - flex: 1, - fontSize: 14, - color: 'rgba(212, 229, 255, 0.8)', - fontWeight: 500, - }, -})); - interface SettingsModalProps { open: boolean; onClose: () => void; } const SettingsModal: React.FC = ({ open, onClose }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [ userSlippageTolerance, setUserslippageTolerance, @@ -138,66 +109,48 @@ const SettingsModal: React.FC = ({ open, onClose }) => { setExpertConfirm(false)}> - - Are you sure? + +
Are you sure?
setExpertConfirm(false)} />
- +

Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result in bad rates and lost funds. - - - ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING. - - - Please type the word "confirm" to enable expert mode. - +

+ +

+ ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING. +

+
+ +

+ Please type the word "confirm" to enable expert mode. +

+
setExpertConfirmText(e.target.value)} /> { if (expertConfirmText === 'confirm') { toggleExpertMode(); @@ -205,81 +158,64 @@ const SettingsModal: React.FC = ({ open, onClose }) => { } }} > - Turn on Expert Mode +

Turn on Expert Mode

- - Settings + +
Settings
- - - Slippage Tolerance - + + +

Slippage Tolerance

+
- + { setSlippageInput(''); setUserslippageTolerance(10); }} > - 0.1% + 0.1% { setSlippageInput(''); setUserslippageTolerance(50); }} > - 0.5% + 0.5% { setSlippageInput(''); setUserslippageTolerance(100); }} > - 1% + 1% {slippageAlert && } = ({ open, onClose }) => { fontSize={14} fontWeight={500} align='right' - color='rgba(212, 229, 255, 0.8)' onBlur={() => { parseCustomSlippage((userSlippageTolerance / 100).toFixed(2)); }} onUserInput={(value) => parseCustomSlippage(value)} /> - % + % {slippageError && ( - - {slippageError === SlippageError.InvalidInput - ? 'Enter a valid slippage percentage' - : slippageError === SlippageError.RiskyLow - ? 'Your transaction may fail' - : 'Your transaction may be frontrun'} - + + + {slippageError === SlippageError.InvalidInput + ? 'Enter a valid slippage percentage' + : slippageError === SlippageError.RiskyLow + ? 'Your transaction may fail' + : 'Your transaction may be frontrun'} + + )} - - - Transaction Deadline - + + +

Transaction Deadline

+
- - + + { parseCustomDeadline((ttl / 60).toString()); }} onUserInput={(value) => parseCustomDeadline(value)} /> - - minutes - + + minutes + {deadlineError && ( - - Enter a valid deadline - + + Enter a valid deadline + )} - - - - Expert Mode - + + +

Expert Mode

= ({ open, onClose }) => { />
- - Language - - English (default) + +

Language

+ +

English (default)

diff --git a/src/components/StakeQuickModal/StakeQuickModal.tsx b/src/components/StakeQuickModal/StakeQuickModal.tsx index 0cb6ca8eb..92e84d288 100644 --- a/src/components/StakeQuickModal/StakeQuickModal.tsx +++ b/src/components/StakeQuickModal/StakeQuickModal.tsx @@ -1,6 +1,5 @@ import React, { useState } from 'react'; -import { Box, Typography, Button } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Button } from '@material-ui/core'; import { TransactionResponse } from '@ethersproject/providers'; import { CustomModal, ColoredSlider, NumericalInput } from 'components'; import { useDerivedLairInfo } from 'state/stake/hooks'; @@ -15,25 +14,7 @@ import { useTransactionFinalizer, } from 'state/transactions/hooks'; import { formatTokenAmount, returnTokenFromKey } from 'utils'; - -const useStyles = makeStyles(({ palette }) => ({ - stakeButton: { - backgroundImage: - 'linear-gradient(104deg, #004ce6 -32%, #0098ff 54%, #00cff3 120%, #64fbd3 198%)', - backgroundColor: 'transparent', - height: 48, - width: '48%', - borderRadius: 10, - '& span': { - fontSize: 16, - fontWeight: 600, - }, - '&.Mui-disabled': { - backgroundImage: 'none', - backgroundColor: palette.secondary.dark, - }, - }, -})); +import 'components/styles/StakeModal.scss'; interface StakeQuickModalProps { open: boolean; @@ -41,8 +22,6 @@ interface StakeQuickModalProps { } const StakeQuickModal: React.FC = ({ open, onClose }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [attempting, setAttempting] = useState(false); const { account } = useActiveWeb3React(); const addTransaction = useTransactionAdder(); @@ -114,28 +93,21 @@ const StakeQuickModal: React.FC = ({ open, onClose }) => { return ( - - Stake QUICK - + +
Stake QUICK
+
- - QUICK - - Balance: {formatTokenAmount(quickBalance)} - + + QUICK + Balance: {formatTokenAmount(quickBalance)} - + = ({ open, onClose }) => { ); }} /> - { setTypedValue(quickBalance ? quickBalance.toExact() : '0'); setStakePercent(100); }} > MAX - + - + { + handleChange={(evt: any, value) => { setStakePercent(value as number); setTypedValue( quickBalance @@ -187,41 +154,38 @@ const StakeQuickModal: React.FC = ({ open, onClose }) => { }} /> - - {Math.min(stakePercent, 100).toLocaleString()}% - + {Math.min(stakePercent, 100).toLocaleString()}% - - + + + - + onClick={onStake} + > + {attempting ? 'Staking...' : 'Stake'} + +
diff --git a/src/components/StakeSyrupModal/StakeSyrupModal.tsx b/src/components/StakeSyrupModal/StakeSyrupModal.tsx index b73642507..a02920539 100644 --- a/src/components/StakeSyrupModal/StakeSyrupModal.tsx +++ b/src/components/StakeSyrupModal/StakeSyrupModal.tsx @@ -1,6 +1,5 @@ import React, { useState } from 'react'; -import { Box, Typography, Button } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Button } from '@material-ui/core'; import { TokenAmount } from '@uniswap/sdk'; import { TransactionResponse } from '@ethersproject/providers'; import { CustomModal, ColoredSlider, NumericalInput } from 'components'; @@ -27,25 +26,6 @@ import { getPartialTokenAmount, } from 'utils'; -const useStyles = makeStyles(({ palette }) => ({ - stakeButton: { - backgroundImage: - 'linear-gradient(104deg, #004ce6 -32%, #0098ff 54%, #00cff3 120%, #64fbd3 198%)', - backgroundColor: 'transparent', - height: 48, - width: '48%', - borderRadius: 10, - '& span': { - fontSize: 16, - fontWeight: 600, - }, - '&.Mui-disabled': { - backgroundImage: 'none', - backgroundColor: palette.secondary.dark, - }, - }, -})); - interface StakeSyrupModalProps { open: boolean; onClose: () => void; @@ -57,8 +37,6 @@ const StakeSyrupModal: React.FC = ({ onClose, syrup, }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [attempting, setAttempting] = useState(false); const [hash, setHash] = useState(''); const { account, chainId, library } = useActiveWeb3React(); @@ -175,30 +153,21 @@ const StakeSyrupModal: React.FC = ({ return ( - - - Stake {syrup.stakingToken.symbol} - - + +
Stake {syrup.stakingToken.symbol}
+
- - {syrup.stakingToken.symbol} - - Balance: {formatTokenAmount(maxAmountInput)} - + + {syrup.stakingToken.symbol} + Balance: {formatTokenAmount(maxAmountInput)} - + = ({ } }} /> - { setTypedValue(maxAmountInput ? maxAmountInput.toExact() : '0'); setStakePercent(100); }} > MAX - + - + { + handleChange={(_, value) => { const percent = value as number; setStakePercent(percent); setTypedValue(getPartialTokenAmount(percent, maxAmountInput)); }} /> - - {Math.min(stakePercent, 100).toLocaleString()}% - + {Math.min(stakePercent, 100).toLocaleString()}% - - Daily Rewards - + +

Daily Rewards

+

{hypotheticalRewardRate ? formatNumber( Number(hypotheticalRewardRate.toExact()) * getSecondsOneDay(), ) : '-'}{' '} {syrup.token.symbol} / day - +

- - + + + - + onClick={onStake} + > + {attempting ? 'Staking...' : 'Stake'} + +
diff --git a/src/components/Swap/AdvancedSwapDetails.tsx b/src/components/Swap/AdvancedSwapDetails.tsx index 39464b12b..e35fa3dbe 100755 --- a/src/components/Swap/AdvancedSwapDetails.tsx +++ b/src/components/Swap/AdvancedSwapDetails.tsx @@ -1,7 +1,6 @@ import { Trade, TradeType } from '@uniswap/sdk'; import React, { useState } from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { useTranslation } from 'react-i18next'; import { Field } from 'state/swap/actions'; import { useUserSlippageTolerance } from 'state/user/hooks'; @@ -18,37 +17,6 @@ import { import { ReactComponent as EditIcon } from 'assets/images/EditIcon.svg'; import { formatTokenAmount } from 'utils'; -const useStyles = makeStyles(({ palette }) => ({ - summaryRow: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - margin: '8px 24px 0', - '& p': { - color: '#b6b9cc', - }, - '& > div': { - display: 'flex', - alignItems: 'center', - '& > div': { - marginLeft: 4, - }, - }, - }, - swapRoute: { - margin: '8px 0', - '& .header': { - display: 'flex', - alignItems: 'center', - '& p': { - fontSize: 16, - lineHeight: '28px', - marginRight: 4, - }, - }, - }, -})); - interface TradeSummaryProps { trade: Trade; allowedSlippage: number; @@ -59,7 +27,6 @@ export const TradeSummary: React.FC = ({ allowedSlippage, }) => { const [openSettingsModal, setOpenSettingsModal] = useState(false); - const { palette } = useTheme(); const { t } = useTranslation(); const { priceImpactWithoutFee, realizedLPFee } = computeTradePriceBreakdown( @@ -70,7 +37,6 @@ export const TradeSummary: React.FC = ({ trade, allowedSlippage, ); - const classes = useStyles(); const tradeAmount = isExactIn ? trade.outputAmount : trade.inputAmount; return ( @@ -81,82 +47,64 @@ export const TradeSummary: React.FC = ({ onClose={() => setOpenSettingsModal(false)} /> )} - - - Slippage: + + + Slippage: setOpenSettingsModal(true)} - style={{ cursor: 'pointer' }} + className='swapSlippage' > - - {allowedSlippage / 100}% - - + {allowedSlippage / 100}% + - - - - {isExactIn ? t('minReceived') : t('maxSold')}: - + + + {isExactIn ? t('minReceived') : t('maxSold')}: - - + + {formatTokenAmount( slippageAdjustedAmounts[isExactIn ? Field.OUTPUT : Field.INPUT], )}{' '} {tradeAmount.currency.symbol} - - - - + + - - - Price Impact: + + + Price Impact: - - - Liquidity Provider Fee: + + + Liquidity Provider Fee: - + {formatTokenAmount(realizedLPFee)} {trade.inputAmount.currency.symbol} - + - - - - Route - + + + Route: {trade.route.path.map((token, i, path) => { const isLastItem: boolean = i === path.length - 1; return ( - - - {token.symbol}{' '} - {// this is not to show the arrow at the end of the trade path - isLastItem ? '' : ' > '} - - + + {token.symbol}{' '} + {// this is not to show the arrow at the end of the trade path + isLastItem ? '' : ' > '} + ); })} diff --git a/src/components/Swap/Swap.tsx b/src/components/Swap/Swap.tsx index 14b206e37..1af4d8422 100755 --- a/src/components/Swap/Swap.tsx +++ b/src/components/Swap/Swap.tsx @@ -2,8 +2,7 @@ import React, { useState, useMemo, useCallback, useEffect } from 'react'; import { Currency, CurrencyAmount, JSBI, Token, Trade } from '@uniswap/sdk'; import ReactGA from 'react-ga'; import { ArrowDown } from 'react-feather'; -import { Box, Typography, Button, CircularProgress } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box, Button, CircularProgress } from '@material-ui/core'; import { useWalletModalToggle } from 'state/application/hooks'; import { useDerivedSwapInfo, @@ -42,82 +41,13 @@ import { import { computeTradePriceBreakdown, warningSeverity } from 'utils/prices'; import { ReactComponent as PriceExchangeIcon } from 'assets/images/PriceExchangeIcon.svg'; import { ReactComponent as ExchangeIcon } from 'assets/images/ExchangeIcon.svg'; - -const useStyles = makeStyles(({ palette }) => ({ - exchangeSwap: { - cursor: 'pointer', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - margin: '16px auto', - zIndex: 2, - position: 'relative', - }, - swapPrice: { - display: 'flex', - justifyContent: 'space-between', - background: 'rgb(43, 45, 59, 0.2)', - padding: '8px 24px', - borderBottomLeftRadius: 10, - borderBottomRightRadius: 10, - '& p': { - display: 'flex', - alignItems: 'center', - color: '#b6b9cc', - '& svg': { - marginLeft: 8, - width: 16, - height: 16, - cursor: 'pointer', - }, - }, - }, - swapButtonWrapper: { - display: 'flex', - justifyContent: 'space-between', - marginTop: 20, - width: '100%', - '& button': { - borderRadius: '10px', - height: 56, - fontSize: 18, - fontWeight: 600, - width: (props: any) => (props.showApproveFlow ? '48%' : '100%'), - backgroundImage: `linear-gradient(to bottom, ${palette.primary.main}, #004ce6)`, - '&.Mui-disabled': { - backgroundImage: `linear-gradient(to bottom, ${palette.secondary.dark}, #1d212c)`, - color: palette.text.secondary, - opacity: 0.5, - }, - '& .content': { - display: 'flex', - alignItems: 'center', - '& > div': { - color: 'white', - marginLeft: 6, - }, - }, - }, - }, - recipientInput: { - width: '100%', - '& .header': { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - padding: '8px 12px', - '& button': { - background: 'transparent', - }, - }, - }, -})); +import 'components/styles/Swap.scss'; const Swap: React.FC<{ currency0?: Currency; currency1?: Currency; - currencyBg?: string; -}> = ({ currency0, currency1, currencyBg }) => { + currencyBgClass?: string; +}> = ({ currency0, currency1, currencyBgClass }) => { const { account } = useActiveWeb3React(); const { independentField, typedValue, recipient } = useSwapState(); const { @@ -210,8 +140,6 @@ const Swap: React.FC<{ (approvalSubmitted && approval === ApprovalState.APPROVED)) && !(priceImpactSeverity > 3 && !isExpertMode); - const classes = useStyles({ showApproveFlow }); - const toggleWalletModal = useWalletModalToggle(); useEffect(() => { @@ -547,9 +475,9 @@ const Swap: React.FC<{ handleCurrencySelect={handleCurrencySelect} amount={formattedAmounts[Field.INPUT]} setAmount={handleTypeInput} - bgColor={currencyBg} + bgClass={currencyBgClass} /> - + {trade && trade.executionPrice && ( - - Price: - + + Price: + 1{' '} { (mainPrice ? currencies[Field.INPUT] : currencies[Field.OUTPUT]) @@ -587,12 +515,12 @@ const Swap: React.FC<{ setMainPrice(!mainPrice); }} /> - + )} {!showWrap && isExpertMode && ( - - + + {recipient !== null ? ( ) : ( @@ -615,42 +543,48 @@ const Swap: React.FC<{ )} - + {showApproveFlow && ( - + + )} + + - )} - + ); diff --git a/src/components/SwapTokenDetails/SwapTokenDetails.tsx b/src/components/SwapTokenDetails/SwapTokenDetails.tsx index ebee4f16e..5bbb8dec0 100755 --- a/src/components/SwapTokenDetails/SwapTokenDetails.tsx +++ b/src/components/SwapTokenDetails/SwapTokenDetails.tsx @@ -1,8 +1,8 @@ -import React, { useEffect, useMemo, useState } from 'react'; -import { Box, Grid, Typography } from '@material-ui/core'; +import React, { useEffect, useState } from 'react'; +import { Box, Grid } from '@material-ui/core'; import Skeleton from '@material-ui/lab/Skeleton'; import { ArrowDropUp, ArrowDropDown } from '@material-ui/icons'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import { CurrencyLogo } from 'components'; import { useBlockNumber, useTokenDetails } from 'state/application/hooks'; import useCopyClipboard from 'hooks/useCopyClipboard'; @@ -20,19 +20,9 @@ import { Token } from '@uniswap/sdk'; import dayjs from 'dayjs'; import { unwrappedToken } from 'utils/wrappedCurrency'; -const useStyles = makeStyles(({ palette }) => ({ - success: { - color: palette.success.main, - }, - danger: { - color: palette.error.main, - }, -})); - const SwapTokenDetails: React.FC<{ token: Token; }> = ({ token }) => { - const classes = useStyles(); const currency = unwrappedToken(token); const tokenAddress = token.address; const { palette } = useTheme(); @@ -84,30 +74,22 @@ const SwapTokenDetails: React.FC<{ return ( - - + + - {currency.symbol} + {currency.symbol} {tokenData ? ( - - - ${formatNumber(tokenData.priceUSD)} - + + ${formatNumber(tokenData.priceUSD)} {priceUp ? : } - {priceUpPercent}% + {priceUpPercent}% ) : ( @@ -132,21 +114,14 @@ const SwapTokenDetails: React.FC<{ )} - + - + {tokenData ? ( - + TVL: {formatCompact(tokenData?.totalLiquidityUSD)} - + ) : ( )} @@ -155,12 +130,9 @@ const SwapTokenDetails: React.FC<{ {tokenData ? ( - + 24h VOL: {formatCompact(tokenData?.oneDayVolumeUSD)} - + ) : ( )} @@ -168,26 +140,19 @@ const SwapTokenDetails: React.FC<{ - + - - {shortenAddress(tokenAddress)} - + {shortenAddress(tokenAddress)} { setCopied(tokenAddress); }} diff --git a/src/components/SyrupCard/SyrupAPR.tsx b/src/components/SyrupCard/SyrupAPR.tsx index 0a35305ec..923cd23e6 100644 --- a/src/components/SyrupCard/SyrupAPR.tsx +++ b/src/components/SyrupCard/SyrupAPR.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { SyrupInfo } from 'types'; import { CurrencyLogo } from 'components'; import { returnTokenFromKey, getTokenAPRSyrup } from 'utils'; @@ -9,31 +8,21 @@ const SyrupAPR: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ syrup, dQUICKAPY, }) => { - const { palette } = useTheme(); const isDQUICKStakingToken = syrup.stakingToken.equals( returnTokenFromKey('DQUICK'), ); return ( <> - + {getTokenAPRSyrup(syrup).toLocaleString()}% - + {isDQUICKStakingToken && ( - - - - - {dQUICKAPY}% APY - - + + + + {dQUICKAPY}% APY + )} diff --git a/src/components/SyrupCard/SyrupCard.tsx b/src/components/SyrupCard/SyrupCard.tsx index d07c3cd52..c549ca7ab 100755 --- a/src/components/SyrupCard/SyrupCard.tsx +++ b/src/components/SyrupCard/SyrupCard.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { SyrupInfo } from 'types'; import { unwrappedToken } from 'utils/wrappedCurrency'; import { CurrencyLogo } from 'components'; @@ -8,29 +8,15 @@ import { formatCompact, formatTokenAmount, getEarnedUSDSyrup } from 'utils'; import { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons'; import SyrupAPR from './SyrupAPR'; import SyrupCardDetails from './SyrupCardDetails'; - -const useStyles = makeStyles(({ palette }) => ({ - syrupCard: { - background: palette.secondary.dark, - width: '100%', - borderRadius: 10, - marginTop: 24, - }, - syrupText: { - fontSize: 14, - fontWeight: 600, - color: palette.text.secondary, - }, -})); +import 'components/styles/SyrupCard.scss'; const SyrupCard: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ syrup, dQUICKAPY, }) => { - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const [expanded, setExpanded] = useState(false); - const classes = useStyles(); const currency = unwrappedToken(syrup.token); @@ -41,26 +27,14 @@ const SyrupCard: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ }`; return ( - - setExpanded(!expanded)} - > + + setExpanded(!expanded)}> {isMobile ? ( <> - + - {currency.symbol} + {currency.symbol} {!expanded && ( @@ -68,69 +42,53 @@ const SyrupCard: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ )} - + {expanded ? : } ) : ( <> - + - {currency.symbol} - - + {currency.symbol} + + {syrup.rate >= 1000000 ? formatCompact(syrup.rate) : syrup.rate.toLocaleString()} - - {' '} - / day - - + / day + - - + + $ {syrup.rewardTokenPriceinUSD ? ( syrup.rate * syrup.rewardTokenPriceinUSD ).toLocaleString() : '-'}{' '} - / day - + / day + - {depositAmount} + {depositAmount} - + - + {formatTokenAmount(syrup.earnedAmount)} - + - + {getEarnedUSDSyrup(syrup)} - + )} diff --git a/src/components/SyrupCard/SyrupCardDetails.tsx b/src/components/SyrupCard/SyrupCardDetails.tsx index 0b95d129e..6b667e842 100755 --- a/src/components/SyrupCard/SyrupCardDetails.tsx +++ b/src/components/SyrupCard/SyrupCardDetails.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import { Box, Typography, Divider, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Divider, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { TransactionResponse } from '@ethersproject/providers'; import { useTranslation } from 'react-i18next'; import { SyrupInfo } from 'types'; @@ -25,48 +25,17 @@ import SyrupAPR from './SyrupAPR'; import { useUSDCPriceToken } from 'utils/useUSDCPrice'; import { GlobalConst } from 'constants/index'; -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - syrupButton: { - backgroundImage: - 'linear-gradient(280deg, #64fbd3 0%, #00cff3 0%, #0098ff 10%, #004ce6 100%)', - borderRadius: 10, - cursor: 'pointer', - width: 134, - height: 40, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - [breakpoints.down('xs')]: { - width: '49%', - }, - '& p': { - color: palette.text.primary, - }, - }, - dailyRateWrapper: { - display: 'flex', - alignItems: 'center', - flexWrap: 'wrap', - background: palette.secondary.contrastText, - width: '100%', - marginTop: 16, - padding: '8px 16px', - borderRadius: 10, - }, -})); - const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ syrup, dQUICKAPY, }) => { const syrupCurrency = unwrappedToken(syrup.token); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const { t } = useTranslation(); const isMobile = useMediaQuery(breakpoints.down('xs')); const [attemptingClaim, setAttemptingClaim] = useState(false); const [attemptingUnstake, setAttemptingUnstake] = useState(false); const [openStakeModal, setOpenStakeModal] = useState(false); - const classes = useStyles(); const stakingTokenPrice = useUSDCPriceToken(syrup.stakingToken); const stakingContract = useStakingContract(syrup?.stakingRewardAddress); @@ -143,43 +112,34 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ }; const StakeButton = () => ( - setOpenStakeModal(true)} - > - Stake + setOpenStakeModal(true)}> + Stake ); const UnstakeButton = () => ( { if (!attemptingUnstake) { onWithdraw(); } }} > - - {attemptingUnstake ? 'Unstaking...' : 'Unstake'} - + {attemptingUnstake ? 'Unstaking...' : 'Unstake'} ); const ClaimButton = () => ( { if (!attemptingClaim) { onClaimReward(); } }} > - - {attemptingClaim ? 'Claiming...' : 'Claim'} - + {attemptingClaim ? 'Claiming...' : 'Claim'} ); @@ -198,44 +158,28 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ {isMobile && ( - - + + {syrup.stakingToken.symbol} {t('deposits')}: - - {depositAmount} + + {depositAmount} - - - {t('dailyRewards')}: - - + + {t('dailyRewards')}: + {syrup.rate >= 1000000 ? formatCompact(syrup.rate) : syrup.rate.toLocaleString()}{' '} {syrup.token.symbol} - - {' '} - / {t('day')} - - + / {t('day')} + - - - - APR: - + + + APR: {'arrow @@ -247,26 +191,14 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ )} - - - {t('inwallet')} - - - - {userLiquidityUnstaked - ? formatTokenAmount(userLiquidityUnstaked) - : 0}{' '} - {syrup.stakingToken.symbol} - - + + {t('inwallet')} + + {userLiquidityUnstaked + ? formatTokenAmount(userLiquidityUnstaked) + : 0}{' '} + {syrup.stakingToken.symbol} + $ {userLiquidityUnstaked ? ( @@ -274,91 +206,56 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ Number(userLiquidityUnstaked.toExact()) ).toLocaleString() : 0} - - + + - - - {t('staked')} - - - - {formatTokenAmount(syrup.stakedAmount)}{' '} - {syrup.stakingToken.symbol} - - + + {t('staked')} + + {formatTokenAmount(syrup.stakedAmount)}{' '} + {syrup.stakingToken.symbol} + {syrup.stakedAmount ? `$${( stakingTokenPrice * Number(syrup.stakedAmount.toExact()) ).toLocaleString()}` : '-'} - - + + - - + + {t('earned')} {currency?.symbol} - - + + - - - {formatTokenAmount(syrup.earnedAmount)} - - + + {formatTokenAmount(syrup.earnedAmount)} + {getEarnedUSDSyrup(syrup)} - - + + - + {!isMobile && ( )} {isMobile ? ( <> {syrup.earnedAmount && syrup.earnedAmount.greaterThan('0') && ( - + )} {!syrup.ended && } {syrup.stakedAmount && @@ -366,7 +263,7 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ ) : ( - + {!syrup.ended && } {syrup.stakedAmount && syrup.stakedAmount.greaterThan('0') && ( @@ -382,26 +279,18 @@ const SyrupCardDetails: React.FC<{ syrup: SyrupInfo; dQUICKAPY: string }> = ({ )} {syrup.rewardRate?.greaterThan('0') && ( - - + + - - {t('yourRate')}: - + {t('yourRate')}: - + {formatMulDivTokenAmount( syrup.rewardRate, GlobalConst.utils.ONEDAYSECONDS, )}{' '} {syrupCurrency.symbol} / {t('day')} - + )} diff --git a/src/components/SyrupCard/SyrupTimerLabel.tsx b/src/components/SyrupCard/SyrupTimerLabel.tsx index 52e972ba0..6644b071e 100644 --- a/src/components/SyrupCard/SyrupTimerLabel.tsx +++ b/src/components/SyrupCard/SyrupTimerLabel.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; +import { Box, useMediaQuery } from '@material-ui/core'; import { useTheme } from '@material-ui/core/styles'; const SyrupTimerLabel: React.FC<{ exactEnd: number; isEnded: boolean }> = ({ @@ -7,7 +7,7 @@ const SyrupTimerLabel: React.FC<{ exactEnd: number; isEnded: boolean }> = ({ isEnded, }) => { const [currentTime, setCurrentTime] = useState(Math.floor(Date.now() / 1000)); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const MINUTE = 60; @@ -43,30 +43,20 @@ const SyrupTimerLabel: React.FC<{ exactEnd: number; isEnded: boolean }> = ({ alignItems='center' justifyContent='space-between' > - +

Time Remaining - - +

+ {`${days}d ${hours .toString() .padStart(2, '0')}h ${minutes .toString() .padStart(2, '0')}m ${timeRemaining}s`} -
+
)} {(isEnded || !Number.isFinite(timeRemaining)) && ( - - Rewards Ended - + Rewards Ended )} ); diff --git a/src/components/ToggleSwitch/ToggleSwitch.tsx b/src/components/ToggleSwitch/ToggleSwitch.tsx index 80bf49c87..73983b835 100755 --- a/src/components/ToggleSwitch/ToggleSwitch.tsx +++ b/src/components/ToggleSwitch/ToggleSwitch.tsx @@ -1,46 +1,17 @@ import React from 'react'; import { Box } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; - -const useStyles = makeStyles(({ palette }) => ({ - wrapper: { - width: 40, - height: 20, - position: 'relative', - cursor: 'pointer', - borderRadius: 10, - border: (props: any) => - props.toggled - ? '1px solid transparent' - : `1px solid ${palette.text.disabled}`, - }, - innerCircle: { - width: 14, - height: 14, - borderRadius: 8, - backgroundColor: (props: any) => - props.toggled ? palette.success.main : palette.text.disabled, - position: 'absolute', - top: 2, - }, -})); +import 'components/styles/ToggleSwitch.scss'; const ToggleSwitch: React.FC<{ toggled: boolean; onToggle: () => void }> = ({ toggled, onToggle, }) => { - const classes = useStyles({ toggled }); return ( - + ); }; diff --git a/src/components/TokensTable/TokensTable.tsx b/src/components/TokensTable/TokensTable.tsx index 86846ae18..6bee81106 100644 --- a/src/components/TokensTable/TokensTable.tsx +++ b/src/components/TokensTable/TokensTable.tsx @@ -1,33 +1,15 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import { Box, Typography, Divider } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Divider } from '@material-ui/core'; import { getAddress } from '@ethersproject/address'; import { ChainId, Token } from '@uniswap/sdk'; import { CurrencyLogo, CustomTable } from 'components'; import { GlobalConst } from 'constants/index'; -import { formatNumber, getFormattedPrice, getPriceColor } from 'utils'; +import { formatNumber, getFormattedPrice, getPriceClass } from 'utils'; import { useBookmarkTokens } from 'state/application/hooks'; import { ReactComponent as StarChecked } from 'assets/images/StarChecked.svg'; import { ReactComponent as StarUnchecked } from 'assets/images/StarUnchecked.svg'; - -const useStyles = makeStyles(({}) => ({ - priceChangeWrapper: { - height: 25, - padding: '0 12px', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - borderRadius: 16, - }, - mobileRow: { - width: '100%', - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - margin: '8px 0', - }, -})); +import 'components/styles/TokensTable.scss'; interface TokensTableProps { data: any[]; @@ -71,8 +53,6 @@ const liquidityHeadCellIndex = 4; const TokensTable: React.FC = ({ data }) => { const tokenHeadCells = headCells(); - const classes = useStyles(); - const { palette } = useTheme(); const { bookmarkTokens, addBookmarkToken, @@ -86,10 +66,10 @@ const TokensTable: React.FC = ({ data }) => { token.symbol, token.name, ); - const priceColor = getPriceColor(Number(token.priceChangeUSD), palette); + const priceClass = getPriceClass(Number(token.priceChangeUSD)); return ( - + = ({ data }) => { )} - + - +

{token.name}{' '} - - ({token.symbol}) - - + ({token.symbol}) +

- - Price - - ${formatNumber(token.priceUSD)} - + +

Price

+

${formatNumber(token.priceUSD)}

- - 24H % - - - {getFormattedPrice(Number(token.priceChangeUSD))}% - + +

24H %

+ + {getFormattedPrice(Number(token.priceChangeUSD))}%
- - 24H Volume - - ${Number(token.oneDayVolumeUSD).toLocaleString()} - + +

24H Volume

+

${Number(token.oneDayVolumeUSD).toLocaleString()}

- - Liquidity - - ${Number(token.totalLiquidityUSD).toLocaleString()} - + +

Liquidity

+

${Number(token.totalLiquidityUSD).toLocaleString()}

); @@ -171,12 +134,12 @@ const TokensTable: React.FC = ({ data }) => { token.symbol, token.name, ); - const priceColor = getPriceColor(Number(token.priceChangeUSD), palette); + const priceClass = getPriceClass(Number(token.priceChangeUSD)); return [ { html: ( - + = ({ data }) => { )} - + - +

{token.name}{' '} - - ({token.symbol}) - - + ({token.symbol}) +

@@ -220,41 +178,22 @@ const TokensTable: React.FC = ({ data }) => { { html: ( - ${Number(token.priceUSD).toLocaleString()} +

${Number(token.priceUSD).toLocaleString()}

), }, { html: ( - - - {getFormattedPrice(Number(token.priceChangeUSD))}% - + + {getFormattedPrice(Number(token.priceChangeUSD))}% ), }, { - html: ( - - - ${Number(token.oneDayVolumeUSD).toLocaleString()} - - - ), + html:

${Number(token.oneDayVolumeUSD).toLocaleString()}

, }, { - html: ( - - - ${Number(token.totalLiquidityUSD).toLocaleString()} - - - ), + html:

${Number(token.totalLiquidityUSD).toLocaleString()}

, }, ]; }; diff --git a/src/components/TopMovers/TopMovers.tsx b/src/components/TopMovers/TopMovers.tsx index 6f7d16af9..917508fd8 100755 --- a/src/components/TopMovers/TopMovers.tsx +++ b/src/components/TopMovers/TopMovers.tsx @@ -1,32 +1,19 @@ import React, { useEffect, useMemo, useState } from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { ArrowDropUp, ArrowDropDown } from '@material-ui/icons'; import Skeleton from '@material-ui/lab/Skeleton'; import { Token, ChainId } from '@uniswap/sdk'; import { getAddress } from '@ethersproject/address'; import { CurrencyLogo } from 'components'; -import { getEthPrice, getTopTokens, getPriceColor, formatNumber } from 'utils'; - -const useStyles = makeStyles(() => ({ - content: { - width: '100%', - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - }, -})); +import { getEthPrice, getTopTokens, getPriceClass, formatNumber } from 'utils'; +import 'components/styles/TopMovers.scss'; interface TopMoversProps { - background: string; hideArrow?: boolean; } -const TopMovers: React.FC = ({ - background, - hideArrow = false, -}) => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); +const TopMovers: React.FC = ({ hideArrow = false }) => { + const { breakpoints } = useTheme(); const [topTokens, updateTopTokens] = useState(null); const smallWindowSize = useMediaQuery(breakpoints.down('xs')); @@ -47,86 +34,35 @@ const TopMovers: React.FC = ({ }, [updateTopTokens]); return ( - - - 24h TOP MOVERS - - + +

24h TOP MOVERS

+ {topMoverTokens ? ( - - {topMoverTokens.map((token: any, index: number) => { + + {topMoverTokens.map((token: any) => { const currency = new Token( ChainId.MATIC, getAddress(token.id), token.decimals, ); - const priceColor = getPriceColor( - Number(token.priceChangeUSD), - palette, - ); + const priceClass = getPriceClass(Number(token.priceChangeUSD)); const priceUp = Number(token.priceChangeUSD) > 0; const priceDown = Number(token.priceChangeUSD) < 0; const priceUpPercent = Number(token.priceChangeUSD).toFixed(2); return ( - + - - {token.symbol} - - - - ${formatNumber(token.priceUSD)} - - + {token.symbol} + + ${formatNumber(token.priceUSD)} + {!hideArrow && priceUp && } {!hideArrow && priceDown && } - + {hideArrow && priceUp ? '+' : ''} {priceUpPercent}% - + diff --git a/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx b/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx index ccaa805e7..af5a1777d 100755 --- a/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx +++ b/src/components/TransactionConfirmationModal/TransactionConfirmationModal.tsx @@ -1,7 +1,6 @@ import { ChainId } from '@uniswap/sdk'; import React from 'react'; -import { Box, Typography, Button, CircularProgress } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box, Button, CircularProgress } from '@material-ui/core'; import { CustomModal } from 'components'; import { ReactComponent as CloseIcon } from 'assets/images/CloseIcon.svg'; import { ReactComponent as TransactionFailed } from 'assets/images/TransactionFailed.svg'; @@ -9,53 +8,7 @@ import { ReactComponent as TransactionSuccess } from 'assets/images/TransactionS import { getEtherscanLink } from 'utils'; import { useActiveWeb3React } from 'hooks'; import ModalBg from 'assets/images/ModalBG.svg'; - -const useStyles = makeStyles(({ palette }) => ({ - modalHeader: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-end', - position: 'relative', - marginBottom: 20, - '& h5': { - position: 'absolute', - width: '100%', - textAlign: 'center', - }, - '& svg': { - cursor: 'pointer', - position: 'relative', - zIndex: 3, - }, - }, - modalBG: { - position: 'absolute', - top: 100, - left: '50%', - transform: 'translateX(-50%)', - zIndex: 1, - }, - modalContent: { - marginTop: 20, - padding: '16px 0', - color: palette.text.primary, - textAlign: 'center', - '& p': { - margin: '16px 0', - }, - }, - submitButton: { - width: '100%', - height: 50, - fontSize: 14, - borderRadius: 10, - color: palette.text.primary, - background: palette.secondary.dark, - '&:hover': { - background: palette.secondary.dark, - }, - }, -})); +import 'components/styles/TransactionConfirmationModal.scss'; interface ConfirmationPendingContentProps { onDismiss: () => void; @@ -66,21 +19,18 @@ export const ConfirmationPendingContent: React.FC { - const classes = useStyles(); return ( - + - - + + - Waiting For Confirmation - {pendingText} - - Please confirm this transaction in your wallet. - +
Waiting For Confirmation
+

{pendingText}

+ Please confirm this transaction in your wallet.
); @@ -101,24 +51,21 @@ export const TransactionSubmittedContent: React.FC { - const classes = useStyles(); return ( - - - Transaction {txPending ? 'Submitted' : 'Completed'} - + +
Transaction {txPending ? 'Submitted' : 'Completed'}
{!txPending && ( - + )} - - {modalContent} + +

{modalContent}

- + {chainId && hash && ( - + )} @@ -219,14 +160,13 @@ const TransactionConfirmationModal: React.FC = ({ modalContent, }) => { const { chainId } = useActiveWeb3React(); - const classes = useStyles(); if (!chainId) return null; // confirmation screen return ( - Modal Back + Modal Back {attemptingTxn ? ( ({ - priceChangeWrapper: { - height: 25, - padding: '0 12px', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - borderRadius: 16, - }, - mobileRow: { - width: '100%', - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - margin: '8px 0', - }, -})); +import 'components/styles/TransactionsTable.scss'; interface TransactionsTableProps { data: any[]; @@ -40,38 +22,34 @@ const headCells = ( id: 'description', numeric: false, label: ( - - + setTxFilter(-1)} > All - - + setTxFilter(TxnType.SWAP)} style={{ marginLeft: 12 }} > Swap - - + setTxFilter(TxnType.ADD)} style={{ marginLeft: 12 }} > Add - - + setTxFilter(TxnType.REMOVE)} style={{ marginLeft: 12 }} > Remove - + ), sortDisabled: true, @@ -111,9 +89,8 @@ const headCells = ( const TransactionsTable: React.FC = ({ data }) => { const [txFilter, setTxFilter] = useState(-1); const txHeadCells = headCells(txFilter, setTxFilter); - const classes = useStyles(); const { chainId } = useActiveWeb3React(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const { t } = useTranslation(); const getTxString = (txn: any) => { @@ -143,42 +120,33 @@ const TransactionsTable: React.FC = ({ data }) => { )} target='_blank' rel='noopener noreferrer' - style={{ textDecoration: 'none' }} + className='no-decoration' > - - {getTxString(txn)} - +

{getTxString(txn)}

) : ( - - {getTxString(txn)} - +

{getTxString(txn)}

)}
- - Total Value - - ${Number(txn.amountUSD).toLocaleString()} - + +

Total Value

+

${Number(txn.amountUSD).toLocaleString()}

- - Token Amount - + +

Token Amount

+

{formatNumber(txn.amount0)} {txn.pair.token0.symbol} - +

- - Token Amount - + +

Token Amount

+

{formatNumber(txn.amount1)} {txn.pair.token1.symbol} - +

- - TXN + +

TXN

{chainId ? ( = ({ data }) => { )} target='_blank' rel='noopener noreferrer' - style={{ textDecoration: 'none' }} + className='no-decoration' > - - {shortenTx(txn.transaction.id)} - +

{shortenTx(txn.transaction.id)}

) : ( - - {shortenTx(txn.transaction.id)} - +

{shortenTx(txn.transaction.id)}

)}
- - Time - - {dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()} - + +

Time

+

{dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()}

); @@ -221,37 +180,29 @@ const TransactionsTable: React.FC = ({ data }) => { href={getEtherscanLink(chainId, txn.transaction.id, 'transaction')} target='_blank' rel='noopener noreferrer' - style={{ textDecoration: 'none' }} + className='no-decoration' > - - {getTxString(txn)} - +

{getTxString(txn)}

) : ( - - {getTxString(txn)} - +

{getTxString(txn)}

), }, { - html: ( - - ${Number(txn.amountUSD).toLocaleString()} - - ), + html:

${Number(txn.amountUSD).toLocaleString()}

, }, { html: ( - +

{formatNumber(txn.amount1)} {txn.pair.token1.symbol} - +

), }, { html: ( - +

{formatNumber(txn.amount0)} {txn.pair.token0.symbol} - +

), }, { @@ -260,23 +211,17 @@ const TransactionsTable: React.FC = ({ data }) => { href={getEtherscanLink(chainId, txn.transaction.id, 'transaction')} target='_blank' rel='noopener noreferrer' - style={{ textDecoration: 'none' }} + className='no-decoration' > - - {shortenTx(txn.transaction.id)} - +

{shortenTx(txn.transaction.id)}

) : ( - - {shortenTx(txn.transaction.id)} - +

{shortenTx(txn.transaction.id)}

), }, { html: ( - - {dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()} - +

{dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()}

), }, ]; @@ -285,48 +230,24 @@ const TransactionsTable: React.FC = ({ data }) => { return ( {isMobile && ( - - setTxFilter(-1)}> - - All - + + setTxFilter(-1)}> +

All

- setTxFilter(TxnType.SWAP)}> - + setTxFilter(TxnType.SWAP)}> +

Swap - +

- setTxFilter(TxnType.ADD)}> - + setTxFilter(TxnType.ADD)}> +

Add - +

- setTxFilter(TxnType.REMOVE)}> - + setTxFilter(TxnType.REMOVE)}> +

Remove - +

)} diff --git a/src/components/UnstakeQuickModal/UnstakeQuickModal.tsx b/src/components/UnstakeQuickModal/UnstakeQuickModal.tsx index c4934b9bb..674739097 100644 --- a/src/components/UnstakeQuickModal/UnstakeQuickModal.tsx +++ b/src/components/UnstakeQuickModal/UnstakeQuickModal.tsx @@ -1,6 +1,5 @@ import React, { useState } from 'react'; -import { Box, Typography, Button } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, Button } from '@material-ui/core'; import { CustomModal, ColoredSlider, NumericalInput } from 'components'; import { useLairInfo } from 'state/stake/hooks'; import { ReactComponent as CloseIcon } from 'assets/images/CloseIcon.svg'; @@ -12,38 +11,6 @@ import { formatTokenAmount } from 'utils'; const web3 = new Web3(); -const useStyles = makeStyles(({ palette }) => ({ - stakeButton: { - backgroundImage: - 'linear-gradient(104deg, #004ce6 -32%, #0098ff 54%, #00cff3 120%, #64fbd3 198%)', - backgroundColor: 'transparent', - height: 48, - width: '100%', - borderRadius: 10, - '& span': { - fontSize: 16, - fontWeight: 600, - }, - '&.Mui-disabled': { - backgroundImage: 'none', - backgroundColor: palette.secondary.dark, - }, - }, - addressLink: { - textDecoration: 'none', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - color: palette.text.primary, - '& p': { - marginLeft: 4, - }, - '&:hover': { - textDecoration: 'underline', - }, - }, -})); - interface UnstakeQuickModalProps { open: boolean; onClose: () => void; @@ -53,8 +20,6 @@ const UnstakeQuickModal: React.FC = ({ open, onClose, }) => { - const classes = useStyles(); - const { palette } = useTheme(); const [attempting, setAttempting] = useState(false); const addTransaction = useTransactionAdder(); const lairInfo = useLairInfo(); @@ -89,28 +54,21 @@ const UnstakeQuickModal: React.FC = ({ return ( - - Unstake dQUICK - + +
Unstake dQUICK
+
- - dQUICK - - Balance: {formatTokenAmount(dQuickBalance)} - + + dQUICK + Balance: {formatTokenAmount(dQuickBalance)} - + = ({ ); }} /> - { setTypedValue(dQuickBalance ? dQuickBalance.toExact() : '0'); setStakePercent(100); }} > MAX - + - + { + handleChange={(evt, value) => { setStakePercent(value as number); setTypedValue( dQuickBalance @@ -162,14 +115,12 @@ const UnstakeQuickModal: React.FC = ({ }} /> - - {Math.min(stakePercent, 100).toLocaleString()}% - + {Math.min(stakePercent, 100).toLocaleString()}% diff --git a/src/pages/LandingPage/HeroSection.tsx b/src/pages/LandingPage/HeroSection.tsx index 2b345815a..7d8c8d558 100644 --- a/src/pages/LandingPage/HeroSection.tsx +++ b/src/pages/LandingPage/HeroSection.tsx @@ -1,81 +1,44 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; -import { Typography, Button, Box } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Button, Box } from '@material-ui/core'; import { Skeleton } from '@material-ui/lab'; import { isSupportedNetwork, addMaticToMetamask } from 'utils'; import { useActiveWeb3React } from 'hooks'; import { useWalletModalToggle } from 'state/application/hooks'; - -const useStyles = makeStyles(({ palette }) => ({ - heroSection: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - position: 'relative', - textAlign: 'center', - zIndex: 2, - '& h3': { - textTransform: 'uppercase', - marginBottom: 20, - paddingTop: 9, - }, - '& h1': { - fontSize: '55px', - fontWeight: 700, - }, - '& h5': { - fontSize: '15px', - color: palette.text.secondary, - }, - '& > button': { - height: 56, - width: 194, - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - }, - }, -})); +import { useTranslation } from 'react-i18next'; export const HeroSection: React.FC<{ globalData: any }> = ({ globalData }) => { - const classes = useStyles(); const history = useHistory(); const { account } = useActiveWeb3React(); const { ethereum } = window as any; const toggleWalletModal = useWalletModalToggle(); + const { t } = useTranslation(); return ( - - - Total Value Locked - + + {t('totalValueLocked')} {globalData ? ( - $ - +

$

+

{Number(globalData.totalLiquidityUSD).toLocaleString(undefined, { maximumFractionDigits: 0, })} - +

) : ( )} - - Top Asset Exchange on the Polygon Network - +
{t('topAssetExchange')}
diff --git a/src/pages/LandingPage/LandingPage.tsx b/src/pages/LandingPage/LandingPage.tsx index 22134031c..d1bc6cd73 100755 --- a/src/pages/LandingPage/LandingPage.tsx +++ b/src/pages/LandingPage/LandingPage.tsx @@ -1,7 +1,6 @@ import React, { useEffect } from 'react'; -import { makeStyles } from '@material-ui/core/styles'; import { useHistory } from 'react-router-dom'; -import { Typography, Box, Grid, useMediaQuery } from '@material-ui/core'; +import { Box, Grid, useMediaQuery } from '@material-ui/core'; import { useTheme } from '@material-ui/core/styles'; import { useTranslation } from 'react-i18next'; import Motif from 'assets/images/Motif.svg'; @@ -21,146 +20,14 @@ import { ReactComponent as YouTubeIcon } from 'assets/images/social/YouTube.svg' import { RewardSlider, TopMovers } from 'components'; import { getEthPrice, getGlobalData } from 'utils'; import { useGlobalData } from 'state/application/hooks'; +import 'pages/styles/landing.scss'; import { HeroSection } from './HeroSection'; import { TradingInfo } from './TradingInfo'; import { SwapSection } from './SwapSection'; import { BuyFiatSection } from './BuyFiatSection'; -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - tradingInfo: { - width: '100%', - position: 'relative', - zIndex: 2, - justifyContent: 'center', - [breakpoints.down('md')]: { - flexWrap: 'wrap', - }, - }, - quickInfo: { - textAlign: 'center', - margin: '128px auto 30px', - width: '100%', - maxWidth: 800, - '& h2': { - marginBottom: 60, - }, - }, - rewardsContainer: { - textAlign: 'center', - margin: '172px 0 100px 0', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - [breakpoints.down('xs')]: { - margin: '32px 0 64px', - }, - }, - featureHeading: { - margin: 'auto', - textAlign: 'center', - '& h3': { - color: 'rgba(255, 255, 255, 0.87)', - marginBottom: 32, - }, - }, - featureDivider: { - width: 32, - height: 2, - background: palette.success.dark, - margin: 'auto', - }, - featureContainer: { - '& > div.MuiGrid-root': { - marginTop: 32, - '& > div': { - '& img': { - width: 150, - maxWidth: 240, - }, - '& > div': { - width: 'calc(100% - 270px)', - }, - [breakpoints.down('xs')]: { - flexDirection: 'column', - '& img, & > div': { - width: '100%', - textAlign: 'center', - }, - }, - }, - }, - '& .featureText': { - marginLeft: 8, - '& h3': { - color: 'white', - marginBottom: 8, - }, - }, - }, - communityContainer: { - margin: '100px 0', - '& .socialContent': { - display: 'flex', - flexWrap: 'wrap', - alignItems: 'center', - justifyContent: 'center', - marginTop: 48, - '& > div': { - margin: 16, - textAlign: 'center', - width: 120, - '& a': { - textDecoration: 'none', - color: palette.text.primary, - '&:hover': { - color: 'white', - '& svg path': { - fill: 'white', - }, - }, - }, - '& svg': { - width: 64, - height: 64, - '& path': { - fill: palette.text.primary, - }, - }, - }, - }, - }, - smallCommunityContainer: { - display: 'flex', - alignItems: 'center', - padding: '0 16px', - height: 56, - position: 'fixed', - bottom: 0, - right: 0, - borderTopLeftRadius: 24, - background: 'rgb(27, 32, 43, 0.9)', - backdropFilter: 'blur(30px)', - zIndex: 10, - '& svg': { - width: 32, - height: 32, - cursor: 'pointer', - '&:hover path': { - fill: palette.text.primary, - }, - '& path': { - fill: palette.text.secondary, - }, - }, - [breakpoints.down('sm')]: { - display: 'none', - }, - }, -})); - const LandingPage: React.FC = () => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const mobileWindowSize = useMediaQuery(breakpoints.down('sm')); const { t } = useTranslation(); @@ -254,10 +121,10 @@ const LandingPage: React.FC = () => { - + - + {socialicons.map((val, ind) => ( { ))} - + - - - {t('quickInfoTitle')} - + +

{t('quickInfoTitle')}

Motif
- + - {t('earnRewardsbyDeposit')} - - {t('depositLPTokensRewards')} - +

{t('earnRewardsbyDeposit')}

+

{t('depositLPTokensRewards')}

{ history.push('/farm'); }} > - {t('seeAllPairs')} +

{t('seeAllPairs')}

- - - {t('features')} - + + +

{t('features')}

+ {features.map((val, index) => ( {val.title} - {val.title} - {val.desc} +
{val.title}
+

{val.desc}

))}
- - - {t('joinCommunity')} - + + +

{t('joinCommunity')}

+ {socialicons.map((val, ind) => (
{val.icon} - {val.title} +

{val.title}

))} diff --git a/src/pages/LandingPage/SwapSection.tsx b/src/pages/LandingPage/SwapSection.tsx index 378958e94..64bbd8f49 100644 --- a/src/pages/LandingPage/SwapSection.tsx +++ b/src/pages/LandingPage/SwapSection.tsx @@ -1,166 +1,62 @@ import React, { useState } from 'react'; import { ButtonGroup, - Typography, Button, Box, Grid, useMediaQuery, } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import { Swap, AddLiquidity } from 'components'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - swapContainer: { - textAlign: 'center', - padding: '20px 0', - maxWidth: 1048, - margin: 'auto', - width: '100%', - '& > div': { - width: '100%', - }, - '& .MuiButtonGroup-root': { - marginBottom: 50, - '& button': { - maxWidth: 180, - width: '50%', - height: 48, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - background: 'transparent', - border: `1px solid ${palette.primary.dark}`, - color: 'white', - '&.active': { - background: '#FFFFFFDE', - border: `1px solid transparent`, - color: palette.background.default, - }, - '&:first-child': { - borderTopLeftRadius: 24, - borderBottomLeftRadius: 24, - }, - '&:last-child': { - borderTopRightRadius: 24, - borderBottomRightRadius: 24, - }, - }, - }, - [breakpoints.down('xs')]: { - '& .MuiGrid-item': { - width: '100%', - marginBottom: 32, - textAlign: 'center', - }, - }, - }, - buttonGroup: { - textAlign: 'center', - padding: '20px 0', - maxWidth: 1048, - margin: 'auto', - width: '100%', - '& > div': { - width: '100%', - }, - '& .MuiButtonGroup-root': { - display: 'flex', - flexDirection: 'row', - justifyContent: 'center', - marginBottom: 50, - '& button': { - maxWidth: 180, - width: '50%', - height: 48, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - background: 'transparent', - border: `1px solid ${palette.primary.dark}`, - color: palette.text.secondary, - '&.active': { - background: '#FFFFFFDE', - border: `1px solid transparent`, - color: palette.background.default, - }, - '&:first-child': { - borderTopLeftRadius: 24, - borderBottomLeftRadius: 24, - }, - '&:last-child': { - borderTopRightRadius: 24, - borderBottomRightRadius: 24, - }, - }, - }, - [breakpoints.down('xs')]: { - '& .MuiGrid-item': { - width: '100%', - marginBottom: 32, - textAlign: 'center', - }, - }, - }, - swapInfo: { - textAlign: 'left', - marginBottom: 60, - [breakpoints.down('sm')]: { - order: -1, - }, - '& h3': { - marginBottom: 16, - }, - }, -})); +import { useTranslation } from 'react-i18next'; const SWAP_TAB = 0; const LIQUIDITY_TAB = 1; export const SwapSection: React.FC = () => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const mobileWindowSize = useMediaQuery(breakpoints.down('sm')); const [tabIndex, setTabIndex] = useState(SWAP_TAB); + const { t } = useTranslation(); return ( <> - + - + {tabIndex === SWAP_TAB ? ( - + ) : ( - + )} - - + +

{tabIndex === SWAP_TAB - ? 'Swap tokens at near-zero gas fees' - : 'Let your crypto work for you'} - - + ? t('swapSectionShortDesc') + : t('liquiditySectionShortDesc')} +

+

{tabIndex === SWAP_TAB - ? 'Deposit your Liquidity Provider tokens to receive Rewards in $QUICK on top of LP Fees.' - : 'Provide Liquidity and earn 0.25% fee on all trades proportional to your share of the pool. Earn additional rewards by depositing your LP Tokens in Rewards Pools.'} - + ? t('swapSectionLongDesc') + : t('liquiditySectionLongDesc')} +

diff --git a/src/pages/LandingPage/TradingInfo.tsx b/src/pages/LandingPage/TradingInfo.tsx index 8d855961c..52b76815b 100644 --- a/src/pages/LandingPage/TradingInfo.tsx +++ b/src/pages/LandingPage/TradingInfo.tsx @@ -1,52 +1,19 @@ import React, { useState } from 'react'; -import { Typography, Box } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { Skeleton } from '@material-ui/lab'; import { StakeQuickModal } from 'components'; import { useLairInfo, useTotalRewardsDistributed } from 'state/stake/hooks'; import { formatCompact, useLairDQUICKAPY } from 'utils'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - tradingSection: { - background: palette.background.default, - width: 'calc(25% - 24px)', - maxWidth: 288, - minWidth: 220, - height: 133, - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center', - borderRadius: 20, - margin: 12, - '& h6': { - paddingTop: 2, - }, - '& p': { - fontSize: '12px', - color: palette.text.secondary, - paddingTop: '12px', - }, - '& h4': { - fontSize: 12, - cursor: 'pointer', - marginTop: 3, - color: palette.primary.main, - }, - [breakpoints.down('xs')]: { - height: 'unset', - }, - }, -})); +import { useTranslation } from 'react-i18next'; export const TradingInfo: React.FC<{ globalData: any }> = ({ globalData }) => { - const classes = useStyles(); const lairInfo = useLairInfo(); const [openStakeModal, setOpenStakeModal] = useState(false); const dQUICKAPY = useLairDQUICKAPY(lairInfo); const totalRewardsUSD = useTotalRewardsDistributed(); + const { t } = useTranslation(); return ( <> @@ -56,64 +23,58 @@ export const TradingInfo: React.FC<{ globalData: any }> = ({ globalData }) => { onClose={() => setOpenStakeModal(false)} /> )} - + {globalData ? ( - - {Number(globalData.oneDayTxns).toLocaleString()} - +

{Number(globalData.oneDayTxns).toLocaleString()}

) : ( )} - 24H TRANSACTIONS +

{t('24hTxs')}

- + {globalData ? ( - $ - - {formatCompact(globalData.oneDayVolumeUSD)} - +
$
+

{formatCompact(globalData.oneDayVolumeUSD)}

) : ( )} - 24H TRADING VOLUME +

{t('24hTradingVol')}

- + {totalRewardsUSD ? ( - $ - - {totalRewardsUSD.toLocaleString()} - +
$
+

{totalRewardsUSD.toLocaleString()}

) : ( )} - 24h REWARDS DISTRIBUTED +

{t('24hRewardsDistributed')}

- + {globalData ? ( - +

{Number(globalData.pairCount).toLocaleString(undefined, { maximumFractionDigits: 0, })} - +

) : ( )} - TOTAL TRADING PAIRS +

{t('totalTradingPairs')}

- + {dQUICKAPY ? ( - {dQUICKAPY.toLocaleString()}% +

{dQUICKAPY.toLocaleString()}%

) : ( )} - dQUICK APY - setOpenStakeModal(true)}> - stake {'>'} - +

dQUICK {t('apy')}

+

setOpenStakeModal(true)}> + {t('stake')} {'>'} +

); diff --git a/src/pages/PoolsPage/PoolsPage.tsx b/src/pages/PoolsPage/PoolsPage.tsx index afc7a7ab6..aa8cd3a0a 100755 --- a/src/pages/PoolsPage/PoolsPage.tsx +++ b/src/pages/PoolsPage/PoolsPage.tsx @@ -1,60 +1,30 @@ import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import { Box, Grid, Typography } from '@material-ui/core'; +import { Box, Grid } from '@material-ui/core'; import { ReactComponent as HelpIcon } from 'assets/images/HelpIcon1.svg'; import SupplyLiquidity from './SupplyLiquidity'; import YourLiquidityPools from './YourLiquidityPools'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - helpWrapper: { - display: 'flex', - alignItems: 'center', - padding: '8px 12px', - border: `1px solid ${palette.secondary.light}`, - borderRadius: 10, - '& p': { - color: palette.text.hint, - }, - '& svg': { - marginLeft: 8, - }, - }, - wrapper: { - padding: 24, - backgroundColor: palette.background.paper, - borderRadius: 20, - [breakpoints.down('xs')]: { - padding: '16px 12px', - }, - }, -})); +import { useTranslation } from 'react-i18next'; +import 'pages/styles/pools.scss'; const PoolsPage: React.FC = () => { - const classes = useStyles(); - + const { t } = useTranslation(); return ( - - Pool - - Help + +

{t('pool')}

+ + {t('help')}
- + - + diff --git a/src/pages/PoolsPage/SupplyLiquidity.tsx b/src/pages/PoolsPage/SupplyLiquidity.tsx index 73a19a797..cfc890521 100644 --- a/src/pages/PoolsPage/SupplyLiquidity.tsx +++ b/src/pages/PoolsPage/SupplyLiquidity.tsx @@ -1,21 +1,13 @@ import React, { useState } from 'react'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; -import { Box, Typography } from '@material-ui/core'; +import { Box } from '@material-ui/core'; import { ReactComponent as SettingsIcon } from 'assets/images/SettingsIcon.svg'; import { AddLiquidity, QuestionHelper, SettingsModal } from 'components'; import useParsedQueryString from 'hooks/useParsedQueryString'; import { useCurrency } from 'hooks/Tokens'; - -const useStyles = makeStyles(() => ({ - headingItem: { - cursor: 'pointer', - display: 'flex', - }, -})); +import { useTranslation } from 'react-i18next'; const SupplyLiquidity: React.FC = () => { - const classes = useStyles(); - const { palette } = useTheme(); + const { t } = useTranslation(); const [openSettingsModal, setOpenSettingsModal] = useState(false); const parsedQuery = useParsedQueryString(); const qCurrency0 = useCurrency( @@ -37,19 +29,17 @@ const SupplyLiquidity: React.FC = () => { onClose={() => setOpenSettingsModal(false)} /> )} - - - Supply Liquidity - - - + +

{t('supplyLiquidity')}

+ + - + setOpenSettingsModal(true)} /> diff --git a/src/pages/PoolsPage/YourLiquidityPools.tsx b/src/pages/PoolsPage/YourLiquidityPools.tsx index 31a1f7693..bcabdda7a 100644 --- a/src/pages/PoolsPage/YourLiquidityPools.tsx +++ b/src/pages/PoolsPage/YourLiquidityPools.tsx @@ -1,7 +1,6 @@ import React, { useMemo, useState } from 'react'; import { Pair } from '@uniswap/sdk'; -import { makeStyles } from '@material-ui/core/styles'; -import { Box, Typography } from '@material-ui/core'; +import { Box } from '@material-ui/core'; import Skeleton from '@material-ui/lab/Skeleton'; import NoLiquidity from 'assets/images/NoLiquidityPool.png'; import { PoolFinderModal, PoolPositionCard } from 'components'; @@ -9,24 +8,10 @@ import { useActiveWeb3React } from 'hooks'; import { usePairs } from 'data/Reserves'; import { toV2LiquidityToken, useTrackedTokenPairs } from 'state/user/hooks'; import { useTokenBalancesWithLoadingIndicator } from 'state/wallet/hooks'; - -const useStyles = makeStyles(({ palette }) => ({ - liquidityText: { - color: palette.text.secondary, - '& span': { - color: palette.primary.main, - cursor: 'pointer', - }, - }, - noLiquidityImage: { - maxWidth: 286, - width: '80%', - filter: 'grayscale(1)', - }, -})); +import { Trans, useTranslation } from 'react-i18next'; const YourLiquidityPools: React.FC = () => { - const classes = useStyles(); + const { t } = useTranslation(); const { account } = useActiveWeb3React(); const [openPoolFinder, setOpenPoolFinder] = useState(false); const trackedTokenPairs = useTrackedTokenPairs(); @@ -79,9 +64,7 @@ const YourLiquidityPools: React.FC = () => { onClose={() => setOpenPoolFinder(false)} /> )} - - Your Liquidity Pools - +

{t('yourliquidityPools')}

{v2IsLoading ? ( @@ -89,12 +72,14 @@ const YourLiquidityPools: React.FC = () => { ) : allV2PairsWithLiquidity.length > 0 ? ( - - Don’t see a pool you joined?{' '} - setOpenPoolFinder(true)}>Import it - .
- Unstake your LP Tokens from Farms to see them here. -
+ + setOpenPoolFinder(true)} />, + }} + /> + {allV2PairsWithLiquidity.map((pair, ind) => ( { No Liquidity - - Don’t see a pool you joined?{' '} - setOpenPoolFinder(true)}>Import it - .
- Unstake your LP Tokens from Farms to see them here. -
+

+ setOpenPoolFinder(true)} />, + }} + /> +

)}
diff --git a/src/pages/SwapPage/LiquidityPoolRow.tsx b/src/pages/SwapPage/LiquidityPoolRow.tsx index 83af746bf..9503bd584 100644 --- a/src/pages/SwapPage/LiquidityPoolRow.tsx +++ b/src/pages/SwapPage/LiquidityPoolRow.tsx @@ -1,31 +1,20 @@ import React from 'react'; -import { Box, Typography, useMediaQuery } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box, useMediaQuery } from '@material-ui/core'; +import { useTheme } from '@material-ui/core/styles'; import { GlobalConst } from 'constants/index'; import { DoubleCurrencyLogo } from 'components'; import { formatCompact, getDaysCurrentYear } from 'utils'; import { useCurrency } from 'hooks/Tokens'; - -const useStyles = makeStyles(({ palette }) => ({ - liquidityContent: { - border: `1px solid ${palette.secondary.dark}`, - borderRadius: '10px', - marginBottom: '20px', - '& p': { - color: palette.text.primary, - fontWeight: 600, - }, - }, -})); +import { useTranslation } from 'react-i18next'; const LiquidityPoolRow: React.FC<{ pair: any; key: number; }> = ({ pair, key }) => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const daysCurrentYear = getDaysCurrentYear(); const isMobile = useMediaQuery(breakpoints.down('xs')); + const { t } = useTranslation(); const dayVolumeUSD = Number( @@ -50,70 +39,45 @@ const LiquidityPoolRow: React.FC<{ const token0 = useCurrency(pair.token0.id); const token1 = useCurrency(pair.token1.id); return ( - - + + - + {pair.token0.symbol.toUpperCase()} /{' '} {pair.token1.symbol.toUpperCase()} - + - {isMobile && ( - - TVL - - )} - ${formatCompact(liquidity)} + {isMobile && {t('tvl')}} + ${formatCompact(liquidity)} - {isMobile && ( - - 24H Volume - - )} - ${formatCompact(volume)} + {isMobile && {t('24hVol')}} + ${formatCompact(volume)} - {isMobile && ( - - APY - - )} - {t('apy')}
} + {apy.toFixed(2)}% - +
); diff --git a/src/pages/SwapPage/LiquidityPools.tsx b/src/pages/SwapPage/LiquidityPools.tsx index 95c304a06..14451abdb 100644 --- a/src/pages/SwapPage/LiquidityPools.tsx +++ b/src/pages/SwapPage/LiquidityPools.tsx @@ -1,36 +1,18 @@ import React, { useEffect, useMemo, useState } from 'react'; -import { Box, Divider, Typography, useMediaQuery } from '@material-ui/core'; +import { Box, Divider, useMediaQuery } from '@material-ui/core'; import { KeyboardArrowUp, KeyboardArrowDown } from '@material-ui/icons'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { useTheme } from '@material-ui/core/styles'; import { getTokenPairs, getBulkPairData, getEthPrice } from 'utils'; import { Token } from '@uniswap/sdk'; import LiquidityPoolRow from './LiquidityPoolRow'; import { useAllTokens } from 'hooks/Tokens'; - -const useStyles = makeStyles(({ palette }) => ({ - liquidityMain: { - '& p': { - color: palette.text.secondary, - fontWeight: 600, - }, - }, - liquidityFilter: { - '& p': { - cursor: 'pointer', - marginRight: 20, - '&.active': { - color: palette.primary.main, - }, - }, - }, -})); +import { useTranslation } from 'react-i18next'; const LiquidityPools: React.FC<{ token1: Token; token2: Token; }> = ({ token1, token2 }) => { - const classes = useStyles(); - const { palette, breakpoints } = useTheme(); + const { breakpoints } = useTheme(); const isMobile = useMediaQuery(breakpoints.down('xs')); const [liquidityPoolClosed, setLiquidityPoolClosed] = useState(false); const [liquidityFilterIndex, setLiquidityFilterIndex] = useState(0); @@ -38,6 +20,7 @@ const LiquidityPools: React.FC<{ const token1Address = token1.address.toLowerCase(); const token2Address = token2.address.toLowerCase(); const allTokenList = useAllTokens(); + const { t } = useTranslation(); const liquidityPairs = useMemo( () => @@ -99,25 +82,19 @@ const LiquidityPools: React.FC<{ return ( <> - - - Liquidity Pools{' '} - - + +

+ {t('liquidityPools')} +

+ ({token1.symbol?.toUpperCase()}, {token2.symbol?.toUpperCase()}) -
+
setLiquidityPoolClosed(!liquidityPoolClosed)} > {liquidityPoolClosed ? : } @@ -127,50 +104,37 @@ const LiquidityPools: React.FC<{ <> - - - + + setLiquidityFilterIndex(0)} > - All - - + setLiquidityFilterIndex(1)} > {token1.symbol?.toUpperCase()} - - + setLiquidityFilterIndex(2)} > {token2.symbol?.toUpperCase()} - + {!isMobile && ( <> - - TVL - + {t('tvl')} - - 24h Volume - + {t('24hVol')} - - - APY - + + {t('apy')} )} diff --git a/src/pages/SwapPage/SwapInfoTx.tsx b/src/pages/SwapPage/SwapInfoTx.tsx new file mode 100644 index 000000000..36f7846d1 --- /dev/null +++ b/src/pages/SwapPage/SwapInfoTx.tsx @@ -0,0 +1,96 @@ +import React, { useState } from 'react'; +import { Box, Divider } from '@material-ui/core'; +import { ButtonSwitch } from 'components'; +import dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +import Skeleton from '@material-ui/lab/Skeleton'; +import { formatCompact, formatNumber } from 'utils'; +import { useTranslation } from 'react-i18next'; +dayjs.extend(utc); + +const SwapInfoTx: React.FC<{ + transactions?: any[]; +}> = ({ transactions }) => { + const [txFilter, setTxFilter] = useState('5_minute'); + const subtractTimeAmount = Number(txFilter.split('_')[0]); + const subtractTimeType = txFilter.split('_')[1]; + const currentTime = dayjs.utc(); + const firstTime = currentTime + .subtract(subtractTimeAmount, subtractTimeType) + .unix(); + + const filteredTxs = transactions?.filter( + (tx) => tx.transaction.timestamp >= firstTime, + ); + const filteredBuyTxs = filteredTxs?.filter((tx) => Number(tx.amount1In) > 0); + const filteredSellTxs = filteredTxs?.filter((tx) => Number(tx.amount0In) > 0); + const volume = filteredTxs + ? filteredTxs.reduce((total, tx) => total + Number(tx.amountUSD), 0) + : undefined; + const { t } = useTranslation(); + + return ( + <> + + + + {t('transactions')}: + {filteredTxs ? ( + {filteredTxs.length} + ) : ( + + )} + + + + {t('buys')}: + + {filteredBuyTxs ? ( + filteredBuyTxs.length + ) : ( + + )} + + + + + {t('sells')}: + + {filteredSellTxs ? ( + filteredSellTxs.length + ) : ( + + )} + + + + + {t('volume')}: + + {filteredTxs ? ( + volume > 1000 ? ( + formatCompact(volume) + ) : ( + formatNumber(volume) + ) + ) : ( + + )} + + + + + ); +}; + +export default React.memo(SwapInfoTx); diff --git a/src/pages/SwapPage/SwapMain.tsx b/src/pages/SwapPage/SwapMain.tsx index 9c856c47e..14557ffff 100644 --- a/src/pages/SwapPage/SwapMain.tsx +++ b/src/pages/SwapPage/SwapMain.tsx @@ -1,44 +1,23 @@ import React, { useState } from 'react'; -import { Box, Typography } from '@material-ui/core'; -import { makeStyles, useTheme } from '@material-ui/core/styles'; +import { Box } from '@material-ui/core'; import { ReactComponent as SettingsIcon } from 'assets/images/SettingsIcon.svg'; -import cx from 'classnames'; +import { useIsProMode } from 'state/application/hooks'; import useParsedQueryString from 'hooks/useParsedQueryString'; import { useCurrency } from 'hooks/Tokens'; -import { Swap, SettingsModal } from 'components'; +import { Swap, SettingsModal, ToggleSwitch } from 'components'; import { GelatoLimitOrderPanel, GelatoLimitOrdersHistoryPanel, } from '@gelatonetwork/limit-orders-react'; +import { Trans, useTranslation } from 'react-i18next'; -const useStyles = makeStyles(({ palette }) => ({ - swapItem: { - width: 100, - height: 40, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - borderRadius: 8, - '& p': { - color: palette.text.secondary, - }, - }, - activeSwap: { - background: palette.secondary.dark, - '& p': { - color: 'white', - }, - }, - headingItem: { - cursor: 'pointer', - }, -})); +const SWAP_NORMAL = 0; +const SWAP_LIMIT = 1; const SwapMain: React.FC = () => { - const classes = useStyles(); - const { palette } = useTheme(); - const [swapIndex, setSwapIndex] = useState(0); + const [swapIndex, setSwapIndex] = useState(SWAP_NORMAL); const [openSettingsModal, setOpenSettingsModal] = useState(false); + const { isProMode, updateIsProMode } = useIsProMode(); const parsedQuery = useParsedQueryString(); const currency0 = useCurrency( @@ -51,6 +30,7 @@ const SwapMain: React.FC = () => { ? (parsedQuery.currency1 as string) : undefined, ); + const { t } = useTranslation(); return ( <> @@ -60,59 +40,77 @@ const SwapMain: React.FC = () => { onClose={() => setOpenSettingsModal(false)} /> )} - + setSwapIndex(0)} + className={`${ + swapIndex === SWAP_NORMAL ? 'activeSwap' : '' + } swapItem headingItem + `} + onClick={() => setSwapIndex(SWAP_NORMAL)} > - Market +

{t('market')}

setSwapIndex(1)} + className={`${ + swapIndex === SWAP_LIMIT ? 'activeSwap' : '' + } swapItem headingItem ${isProMode ? 'border-right' : ''}`} + onClick={() => setSwapIndex(SWAP_LIMIT)} > - Limit +

{t('limit')}

- - setOpenSettingsModal(true)} /> + + {!isProMode && ( + + + {t('proMode')} + + updateIsProMode(!isProMode)} + /> + + )} + + setOpenSettingsModal(true)} /> + - - {swapIndex === 0 && ( + + {swapIndex === SWAP_NORMAL && ( )} - {swapIndex === 1 && ( + {swapIndex === SWAP_LIMIT && ( <> - - * Disclaimer: Limit Orders on QuickSwap are provided by - Gelato, a 3rd party protocol and should be considered in beta. - DYOR and use at your own risk. QuickSwap is not responsible. - More info can be found  - - here. - - + + , + alink: ( + + ), + }} + /> + )} diff --git a/src/pages/SwapPage/SwapPage.tsx b/src/pages/SwapPage/SwapPage.tsx index 1351731a1..8cdb36d14 100755 --- a/src/pages/SwapPage/SwapPage.tsx +++ b/src/pages/SwapPage/SwapPage.tsx @@ -1,51 +1,36 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import { Box, Typography, Grid } from '@material-ui/core'; +import React, { useState, useEffect } from 'react'; +import { useTheme } from '@material-ui/core/styles'; +import { Box, Grid, useMediaQuery } from '@material-ui/core'; import { ReactComponent as HelpIcon } from 'assets/images/HelpIcon1.svg'; -import { SwapTokenDetails } from 'components'; +import { SwapTokenDetails, ToggleSwitch } from 'components'; +import { useIsProMode } from 'state/application/hooks'; import { useDerivedSwapInfo } from 'state/swap/hooks'; import { Field } from 'state/swap/actions'; +import { getPairAddress, getSwapTransactions } from 'utils'; import { wrappedCurrency } from 'utils/wrappedCurrency'; import { useActiveWeb3React } from 'hooks'; import SwapMain from './SwapMain'; import LiquidityPools from './LiquidityPools'; - -const useStyles = makeStyles(({ palette, breakpoints }) => ({ - helpWrapper: { - display: 'flex', - alignItems: 'center', - padding: '8px 12px', - border: `1px solid ${palette.secondary.light}`, - borderRadius: 10, - '& p': { - color: palette.text.hint, - }, - '& svg': { - marginLeft: 8, - }, - }, - wrapper: { - padding: 24, - backgroundColor: palette.background.paper, - borderRadius: 20, - [breakpoints.down('xs')]: { - padding: '16px 12px', - }, - }, - swapTokenDetails: { - backgroundColor: palette.background.paper, - borderRadius: 16, - width: 'calc(50% - 16px)', - [breakpoints.down('xs')]: { - width: '100%', - marginTop: 16, - marginBottom: 16, - }, - }, -})); +import SwapProChartTrade from './SwapProChartTrade'; +import SwapProInfo from './SwapProInfo'; +import SwapProFilter from './SwapProFilter'; +import { useTranslation } from 'react-i18next'; +import 'pages/styles/swap.scss'; const SwapPage: React.FC = () => { - const classes = useStyles(); + const { isProMode, updateIsProMode } = useIsProMode(); + const { breakpoints } = useTheme(); + const isMobile = useMediaQuery(breakpoints.down('sm')); + const isTablet = useMediaQuery(breakpoints.down('md')); + const [showChart, setShowChart] = useState(true); + const [showTrades, setShowTrades] = useState(true); + const [pairId, setPairId] = useState(undefined); + const [pairTokenReversed, setPairTokenReversed] = useState(false); + const [transactions, setTransactions] = useState( + undefined, + ); + const [currentTime, setCurrentTime] = useState(Math.floor(Date.now() / 1000)); + const [infoPos, setInfoPos] = useState('right'); const { currencies } = useDerivedSwapInfo(); const { chainId } = useActiveWeb3React(); @@ -53,52 +38,156 @@ const SwapPage: React.FC = () => { const token1 = wrappedCurrency(currencies[Field.INPUT], chainId); const token2 = wrappedCurrency(currencies[Field.OUTPUT], chainId); + // this is for refreshing data of trades table every 30 seconds + useEffect(() => { + const interval = setInterval(() => { + const _currentTime = Math.floor(Date.now() / 1000); + setCurrentTime(_currentTime); + }, 30000); + return () => clearInterval(interval); + }, []); + + useEffect(() => { + async function getPairId(token1Address: string, token2Address: string) { + const pairData = await getPairAddress(token1Address, token2Address); + if (pairData) { + setPairTokenReversed(pairData.tokenReversed); + setPairId(pairData.pairId); + } + } + if (token1?.address && token2?.address) { + getPairId(token1?.address, token2?.address); + } + }, [token1?.address, token2?.address]); + + useEffect(() => { + async function getTradesData(pairId: string) { + const transactions = await getSwapTransactions(pairId); + setTransactions(transactions); + } + if (pairId) { + getTradesData(pairId); + } + }, [pairId, currentTime]); + + const { t } = useTranslation(); + return ( - - Swap - - Help - - - - - - - + {!isProMode && ( + +

{t('swap')}

+ + {t('help')} + +
+ )} + {!isProMode ? ( + + + + + + + + + {token1 && ( + + + + )} + {token2 && ( + + + + )} + + {token1 && token2 && ( + + + + )} + - + ) : ( + - {token1 && ( - - - - )} - {token2 && ( - - + +

{t('swap')}

+ + + {t('proMode')} + + updateIsProMode(!isProMode)} + /> +
+ +
+ {infoPos === 'left' && ( + + + + )} + + + {token1 && token2 && pairId && ( + )} - {token1 && token2 && ( - - + {infoPos === 'right' && ( + + )} -
-
+
+ )}
); }; diff --git a/src/pages/SwapPage/SwapProChart.tsx b/src/pages/SwapPage/SwapProChart.tsx new file mode 100644 index 000000000..62e2a1b56 --- /dev/null +++ b/src/pages/SwapPage/SwapProChart.tsx @@ -0,0 +1,18 @@ +import React from 'react'; + +const SwapProChart: React.FC<{ + pairName: string; + pairAddress: string; + pairTokenReversed: boolean; +}> = ({ pairAddress, pairName, pairTokenReversed }) => { + return ( +