Skip to content

Commit

Permalink
Merge pull request #160 from QuickSwap/hotfix/preformance-improve
Browse files Browse the repository at this point in the history
Improve performance
  • Loading branch information
sameepsi authored May 25, 2022
2 parents 770cb94 + b29c15e commit 36ee4d4
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 44,498 deletions.
44,160 changes: 0 additions & 44,160 deletions package-lock.json

This file was deleted.

15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
"@types/react-window": "^1.8.5",
"@types/styled-components": "^5.1.15",
"@types/testing-library__cypress": "^5.0.5",
"@types/wcag-contrast": "^3.0.0",
"@types/workbox-core": "^4.3.1",
"@types/workbox-precaching": "^4.3.1",
"@types/workbox-routing": "^4.3.1",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"@uniswap/governance": "^1.0.2",
Expand Down Expand Up @@ -66,7 +62,6 @@
"lodash.flatmap": "^4.5.0",
"multicodec": "^3.0.1",
"multihashes": "^3.0.1",
"node-vibrant": "^3.1.5",
"polished": "^3.3.2",
"prettier": "^1.17.0",
"qs": "^6.9.4",
Expand All @@ -86,11 +81,7 @@
"source-map-explorer": "^2.5.2",
"start-server-and-test": "^1.11.0",
"typescript": "^4.1.2",
"wcag-contrast": "^3.0.0",
"web3": "^1.3.5",
"workbox-core": "^6.1.0",
"workbox-precaching": "^6.1.0",
"workbox-routing": "^6.1.0"
"web3": "^1.3.5"
},
"resolutions": {
"yargs-parser": "^13.1.2",
Expand All @@ -107,8 +98,7 @@
"glob-parent": "^5.1.2",
"browserslist": "^4.16.5",
"ajv": "^6.12.3",
"async": "^3.2.2",
"moment": "^2.29.2"
"async": "^3.2.2"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
Expand Down Expand Up @@ -144,7 +134,6 @@
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"apexcharts": "3.32.1",
"moment": "^2.29.2",
"react-apexcharts": "1.3.9",
"react-cool-inview": "^2.0.8",
"react-error-overlay": "^6.0.10",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/quickIcon.svg" />
<link rel="icon" href="%PUBLIC_URL%/logo_circle.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/quickIcon.svg" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_circle.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
Binary file added public/logo_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 8 additions & 11 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "QuickSwap",
"name": "QuickSwap Interface",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"src": "./logo_circle.png",
"sizes": "50x150",
"type": "image/png",
"sizes": "192x192"
"purpose": "any maskable"
},
{
"src": "logo512.png",
"src": "./logo_circle.png",
"sizes": "50x50",
"type": "image/png",
"sizes": "512x512"
"purpose": "any maskable"
}
],
"start_url": ".",
Expand Down
8 changes: 0 additions & 8 deletions public/quickIcon.svg

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { createStyles, makeStyles } from '@material-ui/core/styles';
import { Box, Typography } from '@material-ui/core';
import Chart from 'react-apexcharts';
import moment from 'moment';
import dayjs from 'dayjs';
import { useIsDarkMode } from 'state/user/hooks';
import { formatCompact, formatNumber } from 'utils';

Expand Down Expand Up @@ -155,7 +155,7 @@ const AreaChart: React.FC<AreaChartProps> = ({
}; border-radius: 12px 12px 0 0; background: ${
dark ? 'rgba(0, 0, 0, 0.91)' : 'rgba(255, 255, 255, 0.91)'
}; color: ${dark ? '#646464' : '#8D97A0'};">` +
moment(dates[dataPointIndex] * 1000).format('MMM DD, YYYY') +
dayjs(dates[dataPointIndex] * 1000).format('MMM DD, YYYY') +
'</span>' +
`<span style="padding: 0.5rem; border: 1px solid ${
dark ? 'rgba(255, 255, 255, 0.15)' : 'rgba(0, 0, 0, 0.15)'
Expand Down
8 changes: 5 additions & 3 deletions src/components/TransactionsTable/TransactionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import { useTranslation } from 'react-i18next';
import { CustomTable } from 'components';
import { formatNumber, getEtherscanLink, shortenTx } from 'utils';
import { useActiveWeb3React } from 'hooks';
import moment from 'moment';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { TxnType } from 'constants/index';
dayjs.extend(relativeTime);

const useStyles = makeStyles(({}) => ({
priceChangeWrapper: {
Expand Down Expand Up @@ -204,7 +206,7 @@ const TransactionsTable: React.FC<TransactionsTableProps> = ({ data }) => {
<Box className={classes.mobileRow}>
<Typography variant='body1'>Time</Typography>
<Typography variant='body1' color='textPrimary'>
{moment(Number(txn.transaction.timestamp) * 1000).fromNow()}
{dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()}
</Typography>
</Box>
</Box>
Expand Down Expand Up @@ -273,7 +275,7 @@ const TransactionsTable: React.FC<TransactionsTableProps> = ({ data }) => {
{
html: (
<Typography variant='body1' color='textPrimary'>
{moment(Number(txn.transaction.timestamp) * 1000).fromNow()}
{dayjs(Number(txn.transaction.timestamp) * 1000).fromNow()}
</Typography>
),
},
Expand Down
5 changes: 0 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import { HashRouter } from 'react-router-dom';

ReactDOM.render(
Expand All @@ -13,7 +12,3 @@ ReactDOM.render(
</React.StrictMode>,
document.getElementById('root'),
);

if (process.env.REACT_APP_SERVICE_WORKER !== 'false') {
serviceWorkerRegistration.register();
}
6 changes: 3 additions & 3 deletions src/pages/AnalyticsPage/AnalyticsLiquidityChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState, useMemo } from 'react';
import { Box, Typography } from '@material-ui/core';
import { useTheme } from '@material-ui/core/styles';
import Skeleton from '@material-ui/lab/Skeleton';
import moment from 'moment';
import dayjs from 'dayjs';
import { useGlobalData } from 'state/application/hooks';
import {
formatCompact,
Expand Down Expand Up @@ -112,7 +112,7 @@ const AnalyticsLiquidityChart: React.FC = () => {
)}
<Box>
<Typography style={{ color: palette.text.disabled }} variant='caption'>
{moment().format('MMM DD, YYYY')}
{dayjs().format('MMM DD, YYYY')}
</Typography>
</Box>
<Box mt={2}>
Expand All @@ -123,7 +123,7 @@ const AnalyticsLiquidityChart: React.FC = () => {
)}
yAxisValues={yAxisValues}
dates={globalChartData.map((value: any) =>
moment(value.date * 1000)
dayjs(value.date * 1000)
.add(1, 'day')
.unix(),
)}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/AnalyticsPairDetails/AnalyticsPairChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouteMatch } from 'react-router-dom';
import { Box, Typography } from '@material-ui/core';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import { Skeleton } from '@material-ui/lab';
import moment from 'moment';
import dayjs from 'dayjs';
import {
formatCompact,
getPairChartData,
Expand Down Expand Up @@ -162,7 +162,7 @@ const AnalyticsPairChart: React.FC<{ pairData: any }> = ({ pairData }) => {
</Box>
<Box>
<Typography variant='caption'>
{moment().format('MMM DD, YYYY')}
{dayjs().format('MMM DD, YYYY')}
</Typography>
</Box>
</>
Expand Down Expand Up @@ -196,7 +196,7 @@ const AnalyticsPairChart: React.FC<{ pairData: any }> = ({ pairData }) => {
data={chartData}
yAxisValues={getYAXISValuesAnalytics(chartData)}
dates={pairChartData.map((value: any) =>
moment(value.date * 1000)
dayjs(value.date * 1000)
.add(1, 'day')
.unix(),
)}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/AnalyticsTokenDetails/AnalyticsTokenChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouteMatch } from 'react-router-dom';
import { Box, Typography } from '@material-ui/core';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import { Skeleton } from '@material-ui/lab';
import moment from 'moment';
import dayjs from 'dayjs';
import {
formatCompact,
getFormattedPrice,
Expand Down Expand Up @@ -145,7 +145,7 @@ const AnalyticsTokenChart: React.FC<{ token: any }> = ({ token }) => {
</Box>
<Box>
<Typography variant='caption'>
{moment().format('MMM DD, YYYY')}
{dayjs().format('MMM DD, YYYY')}
</Typography>
</Box>
</>
Expand Down Expand Up @@ -179,7 +179,7 @@ const AnalyticsTokenChart: React.FC<{ token: any }> = ({ token }) => {
data={chartData}
yAxisValues={getYAXISValuesAnalytics(chartData)}
dates={tokenChartData.map((value: any) =>
moment(value.date * 1000)
dayjs(value.date * 1000)
.add(1, 'day')
.unix(),
)}
Expand Down
58 changes: 0 additions & 58 deletions src/service-worker.ts

This file was deleted.

Loading

0 comments on commit 36ee4d4

Please sign in to comment.