run nx format (#295)

This commit is contained in:
Dexter Edwards 2022-04-25 15:03:58 +01:00 committed by GitHub
parent 037108b4d7
commit ce5d7bc15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
135 changed files with 868 additions and 864 deletions

View File

@ -1,8 +1,7 @@
--- ---
name: Auto Assign Issue to New Project name: Auto Assign Issue to New Project
"on": 'on':
issues: issues:
types: [opened] types: [opened]

View File

@ -1,16 +1,16 @@
import { ApolloClient, from, HttpLink, InMemoryCache } from "@apollo/client"; import { ApolloClient, from, HttpLink, InMemoryCache } from '@apollo/client';
import { onError } from "@apollo/client/link/error"; import { onError } from '@apollo/client/link/error';
import { RetryLink } from "@apollo/client/link/retry"; import { RetryLink } from '@apollo/client/link/retry';
export function createClient(base?: string) { export function createClient(base?: string) {
if (!base) { if (!base) {
throw new Error("Base must be passed into createClient!"); throw new Error('Base must be passed into createClient!');
} }
const gqlPath = "query"; const gqlPath = 'query';
const urlHTTP = new URL(gqlPath, base); const urlHTTP = new URL(gqlPath, base);
const urlWS = new URL(gqlPath, base); const urlWS = new URL(gqlPath, base);
// Replace http with ws, preserving if its a secure connection eg. https => wss // Replace http with ws, preserving if its a secure connection eg. https => wss
urlWS.protocol = urlWS.protocol.replace("http", "ws"); urlWS.protocol = urlWS.protocol.replace('http', 'ws');
const cache = new InMemoryCache({ const cache = new InMemoryCache({
typePolicies: { typePolicies: {
@ -37,7 +37,7 @@ export function createClient(base?: string) {
const httpLink = new HttpLink({ const httpLink = new HttpLink({
uri: urlHTTP.href, uri: urlHTTP.href,
credentials: "same-origin", credentials: 'same-origin',
}); });
const errorLink = onError(({ graphQLErrors, networkError }) => { const errorLink = onError(({ graphQLErrors, networkError }) => {
@ -46,7 +46,7 @@ export function createClient(base?: string) {
}); });
return new ApolloClient({ return new ApolloClient({
connectToDevTools: process.env["NODE_ENV"] === "development", connectToDevTools: process.env['NODE_ENV'] === 'development',
link: from([errorLink, retryLink, httpLink]), link: from([errorLink, retryLink, httpLink]),
cache, cache,
}); });

View File

@ -1,4 +1,4 @@
@import "./styles/colors"; @import './styles/colors';
.app { .app {
max-width: 1300px; max-width: 1300px;

View File

@ -1 +1 @@
export { AddLockedTokenAddress } from "./add-locked-token"; export { AddLockedTokenAddress } from './add-locked-token';

View File

@ -1 +1 @@
export { AddTokenButton, AddTokenButtonLink } from "./add-token-button"; export { AddTokenButton, AddTokenButtonLink } from './add-token-button';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.app-banner { .app-banner {
background: $white; background: $white;

View File

@ -1,7 +1,7 @@
import "./app-banner.scss"; import './app-banner.scss';
import { useAppState } from "../../contexts/app-state/app-state-context"; import { useAppState } from '../../contexts/app-state/app-state-context';
import { Error } from "../icons"; import { Error } from '../icons';
export const AppBanner = () => { export const AppBanner = () => {
const { const {

View File

@ -1 +1 @@
export * from "./app-banner"; export * from './app-banner';

View File

@ -1 +1 @@
export * from "./app-footer"; export * from './app-footer';

View File

@ -1 +1 @@
export * from "./balance-manager"; export * from './balance-manager';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.bullet-header { .bullet-header {
font-size: 16px; font-size: 16px;
@ -10,7 +10,7 @@
width: 100%; width: 100%;
&::before { &::before {
content: ""; content: '';
display: inline-block; display: inline-block;
width: 12px; width: 12px;
height: 12px; height: 12px;

View File

@ -1,9 +1,9 @@
import "./bullet-header.scss"; import './bullet-header.scss';
import React from "react"; import React from 'react';
interface BulletHeaderProps { interface BulletHeaderProps {
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
children: React.ReactNode; children: React.ReactNode;
style?: React.CSSProperties; style?: React.CSSProperties;
} }
@ -11,7 +11,7 @@ interface BulletHeaderProps {
export const BulletHeader = ({ tag, children, style }: BulletHeaderProps) => { export const BulletHeader = ({ tag, children, style }: BulletHeaderProps) => {
return React.createElement( return React.createElement(
tag, tag,
{ className: "bullet-header", style }, { className: 'bullet-header', style },
children children
); );
}; };

View File

@ -1 +1 @@
export * from "./bullet-header"; export * from './bullet-header';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.connected-vega-key { .connected-vega-key {
color: $white; color: $white;

View File

@ -1,15 +1,15 @@
import "./connected-vega-key.scss"; import './connected-vega-key.scss';
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
import { ConnectToVega } from "../../routes/staking/connect-to-vega"; import { ConnectToVega } from '../../routes/staking/connect-to-vega';
export const ConnectedVegaKey = ({ pubKey }: { pubKey: string | null }) => { export const ConnectedVegaKey = ({ pubKey }: { pubKey: string | null }) => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<section className="connected-vega-key"> <section className="connected-vega-key">
<strong data-testid="connected-vega-key-label"> <strong data-testid="connected-vega-key-label">
{pubKey ? t("Connected Vega key") : <ConnectToVega />} {pubKey ? t('Connected Vega key') : <ConnectToVega />}
</strong> </strong>
<p data-testid="connected-vega-key">{pubKey}</p> <p data-testid="connected-vega-key">{pubKey}</p>
</section> </section>

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
export { CountrySelector } from "./country-selector"; export { CountrySelector } from './country-selector';

View File

@ -1 +1 @@
export * from "./epoch-countdown"; export * from './epoch-countdown';

View File

@ -1 +1 @@
export * from "./eth-connect-promp"; export * from './eth-connect-promp';

View File

@ -1 +1 @@
export * from "./eth-wallet-container"; export * from './eth-wallet-container';

View File

@ -1,5 +1,5 @@
@import "../../styles/colors"; @import '../../styles/colors';
@import "../../styles/fonts"; @import '../../styles/fonts';
.eth-wallet { .eth-wallet {
&__pending-tx-button { &__pending-tx-button {

View File

@ -1 +1 @@
export * from "./eth-wallet"; export * from './eth-wallet';

View File

@ -1,7 +1,7 @@
import { ApolloProvider } from "@apollo/client"; import { ApolloProvider } from '@apollo/client';
import React from "react"; import React from 'react';
import { client } from "../../lib/apollo-client"; import { client } from '../../lib/apollo-client';
export const GraphQlProvider = ({ export const GraphQlProvider = ({
children, children,

View File

@ -1 +1 @@
export * from "./graphql-provider"; export * from './graphql-provider';

View File

@ -1 +1 @@
export { Heading } from "./heading"; export { Heading } from './heading';

View File

@ -1,6 +1,6 @@
import "./icons.scss"; import './icons.scss';
export * from "./error"; export * from './error';
export * from "./tick"; export * from './tick';
export * from "./hand-up"; export * from './hand-up';
export * from "./ethereum"; export * from './ethereum';

View File

@ -1 +1 @@
export { KeyValueTable, KeyValueTableRow } from './key-value-table' export { KeyValueTable, KeyValueTableRow } from './key-value-table';

View File

@ -1,7 +1,7 @@
@import "../../styles/colors"; @import '../../styles/colors';
@import "../../styles/fonts"; @import '../../styles/fonts';
$ns: "key-value-table"; $ns: 'key-value-table';
.#{$ns}__header, .#{$ns}__header,
.#{$ns}__footer { .#{$ns}__footer {

View File

@ -1,12 +1,12 @@
import { render, screen } from "@testing-library/react"; import { render, screen } from '@testing-library/react';
import { KeyValueTable, KeyValueTableRow } from "./key-value-table"; import { KeyValueTable, KeyValueTableRow } from './key-value-table';
const props = { const props = {
title: "Title", title: 'Title',
}; };
it("Renders the correct elements", () => { it('Renders the correct elements', () => {
const { container } = render( const { container } = render(
<KeyValueTable {...props}> <KeyValueTable {...props}>
<KeyValueTableRow> <KeyValueTableRow>
@ -22,20 +22,20 @@ it("Renders the correct elements", () => {
expect(screen.getByText(props.title)).toBeInTheDocument(); expect(screen.getByText(props.title)).toBeInTheDocument();
expect(container.querySelector(".key-value-table")).toBeInTheDocument(); expect(container.querySelector('.key-value-table')).toBeInTheDocument();
expect(container.querySelectorAll(".key-value-table__row")).toHaveLength(2); expect(container.querySelectorAll('.key-value-table__row')).toHaveLength(2);
const rows = container.querySelectorAll(".key-value-table__row"); const rows = container.querySelectorAll('.key-value-table__row');
// Row 1 // Row 1
expect(rows[0].firstChild).toHaveTextContent("My label"); expect(rows[0].firstChild).toHaveTextContent('My label');
expect(rows[0].children[1]).toHaveTextContent("My value"); expect(rows[0].children[1]).toHaveTextContent('My value');
// Row 2 // Row 2
expect(rows[1].firstChild).toHaveTextContent("My label 2"); expect(rows[1].firstChild).toHaveTextContent('My label 2');
expect(rows[1].children[1]).toHaveTextContent("My value 2"); expect(rows[1].children[1]).toHaveTextContent('My value 2');
}); });
it("Applies numeric class if prop is passed", () => { it('Applies numeric class if prop is passed', () => {
render( render(
<KeyValueTable numerical={true} {...props}> <KeyValueTable numerical={true} {...props}>
<KeyValueTableRow> <KeyValueTableRow>
@ -45,12 +45,12 @@ it("Applies numeric class if prop is passed", () => {
</KeyValueTable> </KeyValueTable>
); );
expect(screen.getByTestId("key-value-table")).toHaveClass( expect(screen.getByTestId('key-value-table')).toHaveClass(
"key-value-table--numerical" 'key-value-table--numerical'
); );
}); });
it("Applies muted class if prop is passed", () => { it('Applies muted class if prop is passed', () => {
render( render(
<KeyValueTable muted={true} {...props}> <KeyValueTable muted={true} {...props}>
<KeyValueTableRow> <KeyValueTableRow>
@ -60,7 +60,7 @@ it("Applies muted class if prop is passed", () => {
</KeyValueTable> </KeyValueTable>
); );
expect(screen.getByTestId("key-value-table")).toHaveClass( expect(screen.getByTestId('key-value-table')).toHaveClass(
"key-value-table--muted" 'key-value-table--muted'
); );
}); });

View File

@ -1,6 +1,6 @@
import "./key-value-table.scss"; import './key-value-table.scss';
import * as React from "react"; import * as React from 'react';
export interface KeyValueTableProps export interface KeyValueTableProps
extends React.HTMLAttributes<HTMLTableElement> { extends React.HTMLAttributes<HTMLTableElement> {
@ -24,10 +24,10 @@ export const KeyValueTable = ({
<table <table
data-testid="key-value-table" data-testid="key-value-table"
{...rest} {...rest}
className={`key-value-table ${className ? className : ""} ${ className={`key-value-table ${className ? className : ''} ${
numerical ? "key-value-table--numerical" : "" numerical ? 'key-value-table--numerical' : ''
} }
${muted ? "key-value-table--muted" : ""}`} ${muted ? 'key-value-table--muted' : ''}`}
> >
<tbody>{children}</tbody> <tbody>{children}</tbody>
</table> </table>
@ -49,7 +49,7 @@ export const KeyValueTableRow = ({
return ( return (
<tr <tr
{...rest} {...rest}
className={`key-value-table__row ${className ? className : ""}`} className={`key-value-table__row ${className ? className : ''}`}
> >
{children[0]} {children[0]}
{children[1]} {children[1]}

View File

@ -1 +1 @@
export * from "./loader"; export * from './loader';

View File

@ -1,6 +1,6 @@
import "./loader.scss"; import './loader.scss';
import React from "react"; import React from 'react';
interface LoaderProps { interface LoaderProps {
invert?: boolean; invert?: boolean;
@ -8,7 +8,7 @@ interface LoaderProps {
export const Loader = ({ invert = false }: LoaderProps) => { export const Loader = ({ invert = false }: LoaderProps) => {
const [, forceRender] = React.useState(false); const [, forceRender] = React.useState(false);
const className = ["loader", invert ? "loader--dark" : ""].join(" "); const className = ['loader', invert ? 'loader--dark' : ''].join(' ');
React.useEffect(() => { React.useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {

View File

@ -1 +1 @@
export { LockedProgress } from "./locked-progress"; export { LockedProgress } from './locked-progress';

View File

@ -1,5 +1,5 @@
@import "../../styles/colors"; @import '../../styles/colors';
@import "../../styles/fonts"; @import '../../styles/fonts';
.tranche-item { .tranche-item {
&__progress { &__progress {

View File

@ -1 +1 @@
export * from "./modal"; export * from './modal';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.modal { .modal {
left: calc(50vw - 200px); left: calc(50vw - 200px);

View File

@ -1,6 +1,6 @@
import "./modal.scss"; import './modal.scss';
import React from "react"; import React from 'react';
interface ModalProps { interface ModalProps {
children: React.ReactNode; children: React.ReactNode;

View File

@ -1 +1 @@
export * from "./nav"; export * from './nav';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.nav { .nav {
padding: 20px; padding: 20px;
@ -28,7 +28,7 @@
&--inverted { &--inverted {
border-bottom: none; border-bottom: none;
background: $vega-yellow3 url("../../images/clouds.png"); background: $vega-yellow3 url('../../images/clouds.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-position: 0 -300px; background-position: 0 -300px;
@ -85,7 +85,7 @@
} }
&__drawer { &__drawer {
background-image: url("../../images/banner.png"); background-image: url('../../images/banner.png');
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: space-between; justify-content: space-between;

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.template-sidebar { .template-sidebar {
border-bottom: 1px solid $white; border-bottom: 1px solid $white;
@ -15,7 +15,7 @@
aside { aside {
padding: 20px; padding: 20px;
background-image: url("../../images/banner.png"); background-image: url('../../images/banner.png');
background-size: 100% auto; background-size: 100% auto;
} }

View File

@ -1,8 +1,8 @@
import "./template-sidebar.scss"; import './template-sidebar.scss';
import React from "react"; import React from 'react';
import { Nav } from "../nav"; import { Nav } from '../nav';
export interface TemplateSidebarProps { export interface TemplateSidebarProps {
children: React.ReactNode; children: React.ReactNode;

View File

@ -1 +1 @@
export * from "./splash-error"; export * from './splash-error';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.splash-error__icon { .splash-error__icon {
display: flex; display: flex;

View File

@ -1,6 +1,6 @@
import "./splash-error.scss"; import './splash-error.scss';
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
export const SplashError = () => { export const SplashError = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -10,7 +10,7 @@ export const SplashError = () => {
<span /> <span />
<span /> <span />
</div> </div>
{t("networkDown")} {t('networkDown')}
</div> </div>
); );
}; };

View File

@ -1 +1 @@
export * from "./splash-loader"; export * from './splash-loader';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.loading { .loading {
display: flex; display: flex;

View File

@ -1,8 +1,8 @@
import "./splash-loader.scss"; import './splash-loader.scss';
import React from "react"; import React from 'react';
export const SplashLoader = ({ text = "Loading" }: { text?: string }) => { export const SplashLoader = ({ text = 'Loading' }: { text?: string }) => {
const [, forceRender] = React.useState(false); const [, forceRender] = React.useState(false);
React.useEffect(() => { React.useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {

View File

@ -1 +1 @@
export * from "./stateful-button"; export * from './stateful-button';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.stateful-button { .stateful-button {
display: flex; display: flex;

View File

@ -1 +1 @@
export { SyntaxHighlighter } from "./syntax-highlighter"; export { SyntaxHighlighter } from './syntax-highlighter';

View File

@ -1,11 +1,11 @@
import { render, screen } from "@testing-library/react"; import { render, screen } from '@testing-library/react';
import { SyntaxHighlighter } from "./syntax-highlighter"; import { SyntaxHighlighter } from './syntax-highlighter';
it("Renders test id and content", () => { it('Renders test id and content', () => {
const data = {}; const data = {};
render(<SyntaxHighlighter data={data} />); render(<SyntaxHighlighter data={data} />);
expect(screen.getByTestId("syntax-highlighter")).toHaveTextContent( expect(screen.getByTestId('syntax-highlighter')).toHaveTextContent(
JSON.stringify(data, null, 2) JSON.stringify(data, null, 2)
); );
}); });

View File

@ -1 +1 @@
export * from "./token-input"; export * from './token-input';

View File

@ -1 +1 @@
export * from "./transaction-button"; export * from './transaction-button';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.transaction-button { .transaction-button {
margin-bottom: 20px; margin-bottom: 20px;

View File

@ -1 +1 @@
export { TransactionCallout } from "./transaction-callout"; export { TransactionCallout } from './transaction-callout';

View File

@ -1 +1 @@
export * from "./transactions-modal"; export * from './transactions-modal';

View File

@ -1,4 +1,4 @@
@import "../../styles/colors"; @import '../../styles/colors';
.transactions-modal { .transactions-modal {
&__table { &__table {

View File

@ -1 +1 @@
export * from "./vega-wallet-container"; export * from './vega-wallet-container';

View File

@ -1,12 +1,12 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
import { Colors, Links } from "../../config"; import { Colors, Links } from '../../config';
export const DownloadWalletPrompt = () => { export const DownloadWalletPrompt = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<> <>
<h3>{t("getWallet")}</h3> <h3>{t('getWallet')}</h3>
<p style={{ margin: 0 }}> <p style={{ margin: 0 }}>
<a <a
style={{ color: Colors.DEEMPHASISE }} style={{ color: Colors.DEEMPHASISE }}
@ -14,7 +14,7 @@ export const DownloadWalletPrompt = () => {
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
{t("readGuide")} {t('readGuide')}
</a> </a>
</p> </p>
<p style={{ margin: 0 }}> <p style={{ margin: 0 }}>
@ -24,7 +24,7 @@ export const DownloadWalletPrompt = () => {
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
{t("downloadWallet")} {t('downloadWallet')}
</a> </a>
</p> </p>
</> </>

View File

@ -1 +1 @@
export * from "./vega-wallet"; export * from './vega-wallet';

View File

@ -1,5 +1,5 @@
@import "../../styles/colors"; @import '../../styles/colors';
@import "../../styles/fonts"; @import '../../styles/fonts';
.vega-wallet { .vega-wallet {
&__connect { &__connect {

View File

@ -1 +1 @@
export * from "./wallet-card"; export * from './wallet-card';

View File

@ -1 +1 @@
export * from "./web3-connector"; export * from './web3-connector';

View File

@ -1,24 +1,24 @@
export const Colors = { export const Colors = {
WHITE: "#FFF", WHITE: '#FFF',
RED: "#ED1515", RED: '#ED1515',
PINK: "#ff2d5e", PINK: '#ff2d5e',
GREEN: "#26ff8a", GREEN: '#26ff8a',
TEXT: "#c7c7c7", TEXT: '#c7c7c7',
BLACK: "#000", BLACK: '#000',
DEEMPHASISE: "#8a9ba8", DEEMPHASISE: '#8a9ba8',
GRAY_DARK_1: "#292929", GRAY_DARK_1: '#292929',
GRAY_DARK_2: "#333", GRAY_DARK_2: '#333',
GRAY: "#494949", GRAY: '#494949',
GRAY_LIGHT: "#ccc", GRAY_LIGHT: '#ccc',
GRAY_LIGHT_1: "#6e6e6e", GRAY_LIGHT_1: '#6e6e6e',
GREEN_DARK: "#246340", // Same as GREEN_TRANSPARENT given a background of #1f1f1f GREEN_DARK: '#246340', // Same as GREEN_TRANSPARENT given a background of #1f1f1f
GREEN_TRANSPARENT: "rgba(38, 255, 138, 0.3)", GREEN_TRANSPARENT: 'rgba(38, 255, 138, 0.3)',
RED_TRANSPARENT: "rgba(255, 38, 65, 0.3)", RED_TRANSPARENT: 'rgba(255, 38, 65, 0.3)',
TRANSPARENT: "rgba(0,0,0,0)", TRANSPARENT: 'rgba(0,0,0,0)',
VEGA_RED: "#ff261a", VEGA_RED: '#ff261a',
VEGA_ORANGE: "#d9822b", VEGA_ORANGE: '#d9822b',
VEGA_GREEN: "#26ff8a", VEGA_GREEN: '#26ff8a',
VEGA_YELLOW: "#daff0d", VEGA_YELLOW: '#daff0d',
}; };

View File

@ -1,6 +1,6 @@
export * from "./colors"; export * from './colors';
export * from "./flags"; export * from './flags';
export * from "./ethereum"; export * from './ethereum';
export * from "./links"; export * from './links';
export * from "./network-params"; export * from './network-params';
export * from "./vega"; export * from './vega';

View File

@ -1,15 +1,15 @@
export const Links = { export const Links = {
WALLET_RELEASES: "https://github.com/vegaprotocol/vegawallet-desktop/releases", WALLET_RELEASES:
WALLET_GUIDE: 'https://github.com/vegaprotocol/vegawallet-desktop/releases',
"https://docs.vega.xyz/docs/tools/vega-wallet", WALLET_GUIDE: 'https://docs.vega.xyz/docs/tools/vega-wallet',
SUSHI_PAIRS: "https://analytics.sushi.com/pairs/", SUSHI_PAIRS: 'https://analytics.sushi.com/pairs/',
SUSHI_ONSEN_MENU: "https://app.sushi.com/farm", SUSHI_ONSEN_MENU: 'https://app.sushi.com/farm',
SUSHI_ONSEN_WHAT_IS: SUSHI_ONSEN_WHAT_IS:
"https://docs.sushi.com/products/yield-farming/what-is-onsen", 'https://docs.sushi.com/products/yield-farming/what-is-onsen',
SUSHI_ONSEN_FAQ: "https://docs.sushi.com/faq-1/onsen-faq", SUSHI_ONSEN_FAQ: 'https://docs.sushi.com/faq-1/onsen-faq',
FEEDBACK: "https://github.com/vegaprotocol/feedback/discussions", FEEDBACK: 'https://github.com/vegaprotocol/feedback/discussions',
GITHUB: "https://github.com/vegaprotocol/token-frontend", GITHUB: 'https://github.com/vegaprotocol/token-frontend',
DISCORD: "https://vega.xyz/discord", DISCORD: 'https://vega.xyz/discord',
STAKING_GUIDE: STAKING_GUIDE:
"https://docs.vega.xyz/docs/concepts/vega-chain/#staking-on-vega", 'https://docs.vega.xyz/docs/concepts/vega-chain/#staking-on-vega',
}; };

View File

@ -1,21 +1,21 @@
export const NetworkParams = { export const NetworkParams = {
ETHEREUM_CONFIG: "blockchains.ethereumConfig", ETHEREUM_CONFIG: 'blockchains.ethereumConfig',
REWARD_ASSET: "reward.asset", REWARD_ASSET: 'reward.asset',
REWARD_PAYOUT_DURATION: "reward.staking.delegation.payoutDelay", REWARD_PAYOUT_DURATION: 'reward.staking.delegation.payoutDelay',
GOV_UPDATE_MARKET_REQUIRED_MAJORITY: GOV_UPDATE_MARKET_REQUIRED_MAJORITY:
"governance.proposal.updateMarket.requiredMajority", 'governance.proposal.updateMarket.requiredMajority',
GOV_UPDATE_MARKET_REQUIRED_PARTICIPATION: GOV_UPDATE_MARKET_REQUIRED_PARTICIPATION:
"governance.proposal.updateMarket.requiredParticipation", 'governance.proposal.updateMarket.requiredParticipation',
GOV_NEW_MARKET_REQUIRED_MAJORITY: GOV_NEW_MARKET_REQUIRED_MAJORITY:
"governance.proposal.market.requiredMajority", 'governance.proposal.market.requiredMajority',
GOV_NEW_MARKET_REQUIRED_PARTICIPATION: GOV_NEW_MARKET_REQUIRED_PARTICIPATION:
"governance.proposal.market.requiredParticipation", 'governance.proposal.market.requiredParticipation',
GOV_ASSET_REQUIRED_MAJORITY: "governance.proposal.asset.requiredMajority", GOV_ASSET_REQUIRED_MAJORITY: 'governance.proposal.asset.requiredMajority',
GOV_ASSET_REQUIRED_PARTICIPATION: GOV_ASSET_REQUIRED_PARTICIPATION:
"governance.proposal.asset.requiredParticipation", 'governance.proposal.asset.requiredParticipation',
GOV_UPDATE_NET_PARAM_REQUIRED_MAJORITY: GOV_UPDATE_NET_PARAM_REQUIRED_MAJORITY:
"governance.proposal.updateNetParam.requiredMajority", 'governance.proposal.updateNetParam.requiredMajority',
GOV_UPDATE_NET_PARAM_REQUIRED_PARTICIPATION: GOV_UPDATE_NET_PARAM_REQUIRED_PARTICIPATION:
"governance.proposal.updateNetParam.requiredParticipation", 'governance.proposal.updateNetParam.requiredParticipation',
VALIDATOR_DELEGATION_MIN_AMOUNT: "validators.delegation.minAmount", VALIDATOR_DELEGATION_MIN_AMOUNT: 'validators.delegation.minAmount',
}; };

View File

@ -1,7 +1,7 @@
import React from "react"; import React from 'react';
export function useDocumentTitle(name?: string) { export function useDocumentTitle(name?: string) {
const base = "VEGA token"; const base = 'VEGA token';
React.useEffect(() => { React.useEffect(() => {
if (name) { if (name) {

View File

@ -1,8 +1,8 @@
import * as Sentry from "@sentry/react"; import * as Sentry from '@sentry/react';
import React from "react"; import React from 'react';
import { NetworkParams } from "../config"; import { NetworkParams } from '../config';
import { useNetworkParam } from "./use-network-param"; import { useNetworkParam } from './use-network-param';
export const useEthereumConfig = () => { export const useEthereumConfig = () => {
const { data: ethereumConfigJSON, loading } = useNetworkParam([ const { data: ethereumConfigJSON, loading } = useNetworkParam([
@ -22,7 +22,7 @@ export const useEthereumConfig = () => {
const config = JSON.parse(configJson); const config = JSON.parse(configJson);
return config; return config;
} catch { } catch {
Sentry.captureMessage("Ethereum config JSON is invalid"); Sentry.captureMessage('Ethereum config JSON is invalid');
return null; return null;
} }
}, [ethereumConfigJSON, loading]); }, [ethereumConfigJSON, loading]);

View File

@ -1,4 +1,4 @@
import { useCallback, useEffect, useReducer, useRef } from "react"; import { useCallback, useEffect, useReducer, useRef } from 'react';
interface State<T> { interface State<T> {
data?: T; data?: T;
@ -7,9 +7,9 @@ interface State<T> {
} }
enum ActionType { enum ActionType {
LOADING = "LOADING", LOADING = 'LOADING',
ERROR = "ERROR", ERROR = 'ERROR',
FETCHED = "FETCHED", FETCHED = 'FETCHED',
} }
// discriminated union type // discriminated union type
@ -57,7 +57,7 @@ function useFetch<T = unknown>(
} }
const data = (await response.json()) as T; const data = (await response.json()) as T;
if ("error" in data) { if ('error' in data) {
// @ts-ignore - data.error // @ts-ignore - data.error
throw new Error(data.error); throw new Error(data.error);
} }

View File

@ -1,7 +1,7 @@
import { useQuery } from "@apollo/client"; import { useQuery } from '@apollo/client';
import { gql } from "@apollo/client"; import { gql } from '@apollo/client';
import type { NetworkParams } from "./__generated__/NetworkParams"; import type { NetworkParams } from './__generated__/NetworkParams';
export const NETWORK_PARAMS_QUERY = gql` export const NETWORK_PARAMS_QUERY = gql`
query NetworkParams { query NetworkParams {

View File

@ -1,6 +1,6 @@
import React from "react"; import React from 'react';
import { useContracts } from "../contexts/contracts/contracts-context"; import { useContracts } from '../contexts/contracts/contracts-context';
export const usePendingTransactions = () => { export const usePendingTransactions = () => {
const { transactions } = useContracts(); const { transactions } = useContracts();

View File

@ -1,4 +1,4 @@
import React from "react"; import React from 'react';
export function usePrevious<T>(value: T): T | undefined { export function usePrevious<T>(value: T): T | undefined {
const ref = React.useRef<T | undefined>(value); const ref = React.useRef<T | undefined>(value);

View File

@ -1,10 +1,10 @@
import React from "react"; import React from 'react';
import { import {
AppStateActionType, AppStateActionType,
useAppState, useAppState,
} from "../contexts/app-state/app-state-context"; } from '../contexts/app-state/app-state-context';
import { useContracts } from "../contexts/contracts/contracts-context"; import { useContracts } from '../contexts/contracts/contracts-context';
export function useRefreshAssociatedBalances() { export function useRefreshAssociatedBalances() {
const { appDispatch } = useAppState(); const { appDispatch } = useAppState();

View File

@ -1,4 +1,4 @@
import BigNumber from "bignumber.js"; import BigNumber from 'bignumber.js';
BigNumber.config({ EXPONENTIAL_AT: 20000 }); BigNumber.config({ EXPONENTIAL_AT: 20000 });

View File

@ -1,2 +1,2 @@
export const DATE_FORMAT_DETAILED = "dd MMMM yyyy HH:mm"; export const DATE_FORMAT_DETAILED = 'dd MMMM yyyy HH:mm';
export const DATE_FORMAT_LONG = "dd MMM yyyy"; export const DATE_FORMAT_LONG = 'dd MMM yyyy';

View File

@ -1,20 +1,25 @@
import { BigNumber } from "./bignumber"; import { BigNumber } from './bignumber';
import {addDecimal, removeDecimal} from "./decimals"; import { addDecimal, removeDecimal } from './decimals';
test('Do not pad numbers with 0s when the number length is less than the specified DPs', () => { test('Do not pad numbers with 0s when the number length is less than the specified DPs', () => {
expect(addDecimal(new BigNumber(10000), 10)).toEqual("0.000001"); expect(addDecimal(new BigNumber(10000), 10)).toEqual('0.000001');
}) });
test('Handles large numbers correctly', () => { test('Handles large numbers correctly', () => {
const claimCode = new BigNumber("20000000000000000000000000") const claimCode = new BigNumber('20000000000000000000000000');
const decimals = 18 const decimals = 18;
const decimalised = addDecimal(claimCode, decimals) const decimalised = addDecimal(claimCode, decimals);
expect(decimalised.toString()).toEqual("20000000"); expect(decimalised.toString()).toEqual('20000000');
const undecimalised = removeDecimal(claimCode, decimals) const undecimalised = removeDecimal(claimCode, decimals);
expect(undecimalised.toString()).toEqual("20000000000000000000000000000000000000000000"); expect(undecimalised.toString()).toEqual(
'20000000000000000000000000000000000000000000'
);
const mangled = removeDecimal(new BigNumber(addDecimal(claimCode, decimals)), decimals) const mangled = removeDecimal(
expect(mangled.toString()).toEqual("20000000000000000000000000") new BigNumber(addDecimal(claimCode, decimals)),
}) decimals
);
expect(mangled.toString()).toEqual('20000000000000000000000000');
});

View File

@ -1,9 +1,9 @@
import { sigToId } from "./sig-to-id"; import { sigToId } from './sig-to-id';
test("creating an id from a signature", () => { test('creating an id from a signature', () => {
const sig = const sig =
"3594b7f4e1c078aaa65b3efac57e1436da64d60c2961bf432dc62daa36f8b0b2602ed9c990ee46dd8ab5181e19c19b06587f080d22fc4543c1869970e678f20f"; '3594b7f4e1c078aaa65b3efac57e1436da64d60c2961bf432dc62daa36f8b0b2602ed9c990ee46dd8ab5181e19c19b06587f080d22fc4543c1869970e678f20f';
const expected = const expected =
"9ebd2c424a9426bf5f38112878eb2f99bfdf5ec17b5782b944e6be8177084327"; '9ebd2c424a9426bf5f38112878eb2f99bfdf5ec17b5782b944e6be8177084327';
expect(sigToId(sig)).toEqual(expected); expect(sigToId(sig)).toEqual(expected);
}); });

View File

@ -1,10 +1,10 @@
import { ethers } from "ethers"; import { ethers } from 'ethers';
import { SHA3 } from "sha3"; import { SHA3 } from 'sha3';
export const sigToId = (sig: string) => { export const sigToId = (sig: string) => {
// Prepend 0x // Prepend 0x
if (sig.slice(0, 2) !== "0x") { if (sig.slice(0, 2) !== '0x') {
sig = "0x" + sig; sig = '0x' + sig;
} }
// Create the ID // Create the ID

View File

@ -1,7 +1,7 @@
export function truncateMiddle(address: string) { export function truncateMiddle(address: string) {
return ( return (
address.slice(0, 6) + address.slice(0, 6) +
"\u2026" + '\u2026' +
address.slice(address.length - 4, address.length) address.slice(address.length - 4, address.length)
); );
} }

View File

@ -17,7 +17,7 @@ const IgnoreCodes = {
* and thus not capture in Sentry * and thus not capture in Sentry
*/ */
export const isUnexpectedError = (error: Error | TxError) => { export const isUnexpectedError = (error: Error | TxError) => {
if ("code" in error && Object.values(IgnoreCodes).includes(error.code)) { if ('code' in error && Object.values(IgnoreCodes).includes(error.code)) {
return false; return false;
} }
return true; return true;
@ -28,7 +28,7 @@ export const isUnexpectedError = (error: Error | TxError) => {
* a transaction confirmation prompt * a transaction confirmation prompt
*/ */
export const isUserRejection = (error: Error | TxError) => { export const isUserRejection = (error: Error | TxError) => {
if ("code" in error && error.code === IgnoreCodes.USER_REJECTED) { if ('code' in error && error.code === IgnoreCodes.USER_REJECTED) {
return true; return true;
} }
return false; return false;
@ -39,7 +39,7 @@ export const isUserRejection = (error: Error | TxError) => {
* a transaction confirmation prompt * a transaction confirmation prompt
*/ */
export const isAlreadyProcessing = (error: Error | TxError) => { export const isAlreadyProcessing = (error: Error | TxError) => {
if ("code" in error && error.code === IgnoreCodes.ALREADY_PROCESSING) { if ('code' in error && error.code === IgnoreCodes.ALREADY_PROCESSING) {
return true; return true;
} }
return false; return false;

View File

@ -1,12 +1,16 @@
import React from "react"; import React from 'react';
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
export const ClaimError = () => { export const ClaimError = () => {
const { t } = useTranslation() const { t } = useTranslation();
return ( return (
<section> <section>
<h1 data-testid="invalid-claim-code-error-msg">{t("Something doesn't look right")}</h1> <h1 data-testid="invalid-claim-code-error-msg">
<p>{t("If you have been given a link please double check and try again")}</p> {t("Something doesn't look right")}
</h1>
<p>
{t('If you have been given a link please double check and try again')}
</p>
</section> </section>
); );
}; };

View File

@ -1 +1 @@
export * from "./claim-form"; export * from './claim-form';

View File

@ -1,11 +1,11 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
export const ClaimRestricted = () => { export const ClaimRestricted = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<section> <section>
<h1>{t("Service unavailable")}</h1> <h1>{t('Service unavailable')}</h1>
<p>{t("This service is not available in your country")}</p> <p>{t('This service is not available in your country')}</p>
</section> </section>
); );
}; };

View File

@ -1 +1 @@
export { ClaimStep1 } from "./claim-step-1"; export { ClaimStep1 } from './claim-step-1';

View File

@ -1 +1 @@
export { ClaimStep2 } from "./claim-step-2"; export { ClaimStep2 } from './claim-step-2';

View File

@ -1,29 +1,29 @@
import { isRestricted } from "./is-restricted"; import { isRestricted } from './is-restricted';
afterEach(() => { afterEach(() => {
document.cookie = ""; document.cookie = '';
}) });
test("Returns false on no cookie", () => { test('Returns false on no cookie', () => {
expect(isRestricted()).toEqual(false); expect(isRestricted()).toEqual(false);
}) });
test("Returns false on no restricted cookie", () => { test('Returns false on no restricted cookie', () => {
document.cookie = "one=a;two=b" document.cookie = 'one=a;two=b';
expect(isRestricted()).toEqual(false); expect(isRestricted()).toEqual(false);
}) });
test("Returns true if a cookie called restricted is set but false", () => { test('Returns true if a cookie called restricted is set but false', () => {
document.cookie = "restricted=false" document.cookie = 'restricted=false';
expect(isRestricted()).toEqual(false); expect(isRestricted()).toEqual(false);
}) });
test("Returns true if a cookie called restricted is set and true", () => { test('Returns true if a cookie called restricted is set and true', () => {
document.cookie = "restricted=true" document.cookie = 'restricted=true';
expect(isRestricted()).toEqual(true); expect(isRestricted()).toEqual(true);
}) });
test("Handle weird data", () => { test('Handle weird data', () => {
document.cookie = ";🍪;;;;;🍪=🍪;;;;;;;;;🍪" document.cookie = ';🍪;;;;;🍪=🍪;;;;;;;;;🍪';
expect(isRestricted()).toEqual(true); expect(isRestricted()).toEqual(true);
}) });

View File

@ -1,6 +1,6 @@
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from 'react-i18next';
import { Colors } from "../../config/colors"; import { Colors } from '../../config/colors';
interface TargetAddressMismatchProps { interface TargetAddressMismatchProps {
connectedAddress: string; connectedAddress: string;
@ -15,7 +15,7 @@ export const TargetAddressMismatch = ({
return ( return (
<> <>
<p> <p>
{t("connectedAddress", { {t('connectedAddress', {
address: connectedAddress, address: connectedAddress,
})} })}
</p> </p>

View File

@ -1 +1 @@
export { TargetedClaim } from "./targeted-claim"; export { TargetedClaim } from './targeted-claim';

View File

@ -1 +1 @@
export { UntargetedClaim } from "./untargeted-claim"; export { UntargetedClaim } from './untargeted-claim';

View File

@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from 'react-i18next';
import { SplashLoader } from "../../components/splash-loader"; import { SplashLoader } from '../../components/splash-loader';
export const Verifying = () => { export const Verifying = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -8,12 +8,12 @@ export const Verifying = () => {
<div <div
style={{ style={{
minHeight: 260, minHeight: 260,
display: "flex", display: 'flex',
justifyContent: "center", justifyContent: 'center',
alignItems: "center", alignItems: 'center',
}} }}
> >
<SplashLoader text={t("Verifying your claim")} /> <SplashLoader text={t('Verifying your claim')} />
</div> </div>
); );
}; };

View File

@ -1,4 +1,4 @@
@import "../../../../styles/colors"; @import '../../../../styles/colors';
.current-proposal-state { .current-proposal-state {
&__pass { &__pass {

View File

@ -1 +1 @@
export { CurrentProposalState } from "./current-proposal-state"; export { CurrentProposalState } from './current-proposal-state';

View File

@ -1,4 +1,4 @@
@import "../../../../styles/colors"; @import '../../../../styles/colors';
.current-proposal-status { .current-proposal-status {
&__pass { &__pass {

View File

@ -1 +1 @@
export { CurrentProposalStatus } from "./current-proposal-status"; export { CurrentProposalStatus } from './current-proposal-status';

View File

@ -1 +1 @@
export { ProposalChangeTable } from "./proposal-change-table"; export { ProposalChangeTable } from './proposal-change-table';

View File

@ -1 +1 @@
export { ProposalTermsJson } from "./proposal-terms-json"; export { ProposalTermsJson } from './proposal-terms-json';

View File

@ -1 +1 @@
export { ProposalVotesTable } from "./proposal-votes-table"; export { ProposalVotesTable } from './proposal-votes-table';

View File

@ -1 +1 @@
export { Proposal } from "./proposal"; export { Proposal } from './proposal';

View File

@ -1 +1 @@
export { ProposalsList } from "./proposals-list"; export { ProposalsList } from './proposals-list';

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