Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tests/e2e/videos

coverage
tsconfig.tsbuildinfo

dist

.yarn/*
!.yarn/patches
Expand Down
10 changes: 5 additions & 5 deletions components/GlobalLoader/GlobalLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export function GlobalLoader() {
>
<defs>
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
<stop stop-color={Colors.blueHover} stop-opacity="0" offset="0%" />
<stop stop-color={Colors.blueHover} stop-opacity=".631" offset="63.146%" />
<stop stop-color={Colors.blueHover} offset="100%" />
<stop stopColor={Colors.blueHover} stopOpacity="0" offset="0%" />
<stop stopColor={Colors.blueHover} stopOpacity=".631" offset="63.146%" />
<stop stopColor={Colors.blueHover} offset="100%" />
</linearGradient>
</defs>
<g transform="translate(1 1)" fill="none" fill-rule="evenodd">
<path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#a)" stroke-width="2">
<g transform="translate(1 1)" fill="none" fillRule="evenodd">
<path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#a)" strokeWidth="2">
<animateTransform
attributeName="transform"
type="rotate"
Expand Down
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta content="initial-scale=1, width=device-width" name="viewport" />
<meta content="ie=edge" http-equiv="X-UA-Compatible" />
<link href="./public/images/favicon.ico" rel="icon" />
<title>No NEXT</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
12 changes: 12 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-nocheck

import { bootstrap } from './no-next/bootstrap';

bootstrap();

if (module.hot) {
module.hot.accept();
module.hot.dispose(() => {
// do nothing
});
}
132 changes: 132 additions & 0 deletions no-next/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import React from 'react';
import { useEffect } from 'react';
import Head from 'next/head';
import { RecoilRoot } from 'recoil';
import { useTranslation } from 'react-i18next';
import { ThemeProvider } from 'styled-components';

import WithAppContainers from 'containers';
import theme from 'styles/theme';
import Layout from 'sections/shared/Layout';
import AppLayout from 'sections/shared/Layout/AppLayout';
import { MediaContextProvider } from 'styles/media';
import { QueryClient, QueryClientProvider } from 'react-query';
import { ReactQueryDevtools } from 'react-query/devtools';
import { DEFAULT_REQUEST_REFRESH_INTERVAL } from 'constants/defaults';

import { SynthetixQueryContextProvider, createQueryContext } from '@synthetixio/queries';

import SystemStatus from 'sections/shared/SystemStatus';

import '../i18n';
import Connector from 'containers/Connector';

import DashboardPage from 'content/DashboardPage';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchInterval: DEFAULT_REQUEST_REFRESH_INTERVAL,
refetchOnWindowFocus: false,
},
},
});

function InnerApp() {
const { provider, signer, network, L1DefaultProvider } = Connector.useContainer();

useEffect(() => {
try {
document.querySelector('#global-loader')?.remove();
} catch (_e) {}
}, []);

return (
<>
<SynthetixQueryContextProvider
value={
provider && network?.id
? createQueryContext({
provider: provider,
signer: signer || undefined,
networkId: network.id,
})
: createQueryContext({
networkId: 1,
provider: L1DefaultProvider,
})
}
>
<Layout>
<SystemStatus>
<AppLayout>
<DashboardPage />
</AppLayout>
</SystemStatus>
</Layout>
<ReactQueryDevtools />
</SynthetixQueryContextProvider>
</>
);
}

function App() {
const { t } = useTranslation();

return (
<>
<Head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content={t('meta.description')} />
{/* open graph */}
<meta property="og:url" content="https://staking.synthetix.io/" />
<meta property="og:type" content="website" />
<meta property="og:title" content={t('meta.og.title')} />
<meta property="og:description" content={t('meta.description')} />
<meta property="og:image" content="/images/staking-facebook.jpg" />
<meta property="og:image:alt" content={t('meta.og.title')} />
<meta property="og:site_name" content={t('meta.og.site-name')} />
{/* twitter */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@synthetix_io" />
<meta name="twitter:creator" content="@synthetix_io" />
<meta name="twitter:image" content="/images/staking-twitter.jpg" />
<meta name="twitter:url" content="https://staking.synthetix.io" />
<link rel="icon" href="/images/favicon.ico" />

{/* matomo */}
<script
dangerouslySetInnerHTML={{
__html: `
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.synthetix.io/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '3']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
`,
}}
/>
</Head>
<ThemeProvider theme={theme}>
<RecoilRoot>
<QueryClientProvider client={queryClient} contextSharing={true}>
<WithAppContainers>
<MediaContextProvider>
<InnerApp />
</MediaContextProvider>
</WithAppContainers>
</QueryClientProvider>
</RecoilRoot>
</ThemeProvider>
</>
);
}

export default App;
94 changes: 94 additions & 0 deletions no-next/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
* {
box-sizing: border-box;
}

body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeSpeed;
margin: 0;
min-height: 100vh;
position: relative;
scroll-behavior: smooth;
padding-bottom: 50px;
}

ul {
list-style: none;
padding: 0;
margin: 0;
}

input[type='number'] {
-moz-appearance: textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}

/* Inter */

@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Inter'), url('../public/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
font-family: 'Inter Semi Bold';
font-style: normal;
font-weight: 600;
font-display: swap;
src: local('Inter Semi Bold'), url('../public/fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
font-family: 'Inter Bold';
font-style: normal;
font-weight: 700;
font-display: swap;
src: local('Inter Bold'), url('../public/fonts/Inter-Bold.woff2') format('woff2');
}

/* GT America */

@font-face {
font-family: 'GT America Mono';
font-style: normal;
font-display: swap;
font-weight: 700;
src: local('GT America Mono'), url('../public/fonts/GT-America-Mono-Bold.woff2') format('woff2');
}

@font-face {
font-family: 'GT America Condensed-Medium';
font-style: normal;
font-display: swap;
font-weight: 500;
src: local('GT America Condensed-Medium'),
url('../public/fonts/GT-America-Condensed-Medium.woff2') format('woff2');
}

@font-face {
font-family: 'GT America Condensed-Bold';
font-display: swap;
font-style: normal;
font-weight: 700;
font-stretch: condensed;
src: local('GT America Condensed-Bold'),
url('../public/fonts/GT-America-Condensed-Bold.woff2') format('woff2');
}

@font-face {
font-family: 'GT America Extended Bold';
font-style: normal;
font-display: swap;
font-weight: 700;
src: local('GT America Extended Bold'),
url('../public/fonts/GT-America-Extended-Bold.woff2') format('woff2');
}
22 changes: 22 additions & 0 deletions no-next/bootstrap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as React from 'react';
import { Suspense } from 'react';
import ReactDOM from 'react-dom';
import { safeLazy } from '@synthetixio/safe-import';
import GlobalLoader from 'components/GlobalLoader';

import '@reach/dialog/styles.css';
import 'tippy.js/dist/tippy.css';
import './app.css';

const App = safeLazy(() => import(/* webpackChunkName: "app" */ './App'));

export async function bootstrap() {
ReactDOM.render(
<React.StrictMode>
<Suspense fallback={<GlobalLoader />}>
<App />
</Suspense>
</React.StrictMode>,
document.querySelector('#app')
);
}
4 changes: 4 additions & 0 deletions no-next/next-link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function Link({ ...props }) {
// eslint-disable-next-line jsx-a11y/anchor-has-content
return <a {...props} />;

Check warning

Code scanning / ESLint

Enforce all anchors to contain accessible content.

Anchors must have content and the content must be accessible by a screen reader.
}
10 changes: 10 additions & 0 deletions no-next/next-router.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const router = {
push: function push() {},
asPath: '',
};

export function useRouter() {
return router;
}

export default router;
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@synthetixio/optimism-networks": "^2.74.1",
"@synthetixio/providers": "^2.74.1",
"@synthetixio/queries": "^2.74.3",
"@synthetixio/safe-import": "^1.0.0",
"@synthetixio/transaction-notifier": "^2.74.1",
"@synthetixio/wei": "^2.74.1",
"@tippyjs/react": "^4.1.0",
Expand All @@ -59,6 +60,7 @@
"react-countdown": "^2.3.0",
"react-datepicker": "^4.1.1",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-i18next": "^11.7.0",
"react-outside-click-handler": "^1.3.0",
"react-query": "3.16.0",
Expand All @@ -80,6 +82,8 @@
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@next/bundle-analyzer": "^10.2.3",
"@svgr/webpack": "^6.2.1",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.2.213",
"@synthetixio/synpress": "^1.1.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
Expand All @@ -106,6 +110,7 @@
"@typescript-eslint/parser": "^5.28.0",
"browserslist": "^4.20.4",
"caniuse-lite": "^1.0.30001364",
"css-loader": "^6.7.1",
"csvtojson": "^2.0.10",
"env-cmd": "^10.1.0",
"eslint": "^8.18.0",
Expand All @@ -123,15 +128,21 @@
"ethereum-blockies-base64": "^1.0.2",
"file-loader": "^6.2.0",
"graph-results-pager": "^1.0.3",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1",
"jest": "^28.1.2",
"jest-environment-jsdom": "^28.1.2",
"lint-staged": "^13.0.2",
"prettier": "^2.7.1",
"react-test-renderer": "^17.0.2",
"remarkable-external-link": "^1.1.0",
"style-loader": "^3.3.1",
"swc-loader": "^0.2.3",
"typescript": "^4.7.4",
"url-loader": "^4.1.1"
"url-loader": "^4.1.1",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3"
},
"resolutions": {
"eslint-plugin-prettier": "^4.0.0",
Expand All @@ -158,6 +169,7 @@
"last 1 Chrome version",
"last 1 Firefox version",
"last 1 Edge version",
"last 1 Safari version",
"last 1 Opera version"
]
}
1 change: 1 addition & 0 deletions typings/missing-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ declare module '@ensdomains/ensjs';
declare module '@eth-optimism/watcher';
declare module 'remarkable/linkify';
declare module 'remarkable-external-link';
declare module '@synthetixio/safe-import';
Loading