From ee25db733dfe12e5f682fe24f7b1ecef7f01da0f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 30 Nov 2020 16:01:37 +0100 Subject: [PATCH] Remove classes utility (#4106) * Remove classes utility * Update packages/react-components/src/InputNumber.tsx --- packages/react-components/src/AddressMini.tsx | 4 ++-- packages/react-components/src/Available.tsx | 4 +--- packages/react-components/src/Balance.tsx | 6 ++---- packages/react-components/src/Bonded.tsx | 3 +-- packages/react-components/src/Call.tsx | 3 +-- packages/react-components/src/Chart/Base.tsx | 4 +--- packages/react-components/src/CryptoType.tsx | 4 +--- packages/react-components/src/Dropdown.tsx | 3 +-- packages/react-components/src/Editor.tsx | 3 +-- packages/react-components/src/Event.tsx | 4 ++-- .../src/InputAddress/index.tsx | 4 ++-- .../src/InputConsts/SelectKey.tsx | 3 +-- .../src/InputConsts/SelectSection.tsx | 3 +-- packages/react-components/src/InputError.tsx | 4 +--- .../src/InputExtrinsic/SelectMethod.tsx | 3 +-- .../src/InputExtrinsic/SelectSection.tsx | 3 +-- packages/react-components/src/InputNumber.tsx | 3 +-- .../src/InputRpc/SelectMethod.tsx | 3 +-- .../src/InputRpc/SelectSection.tsx | 3 +-- .../src/InputStorage/SelectKey.tsx | 3 +-- .../src/InputStorage/SelectSection.tsx | 3 +-- packages/react-components/src/Inset.tsx | 18 +++--------------- packages/react-components/src/LabelHelp.tsx | 3 +-- packages/react-components/src/LockedVote.tsx | 8 ++------ packages/react-components/src/Nonce.tsx | 4 +--- packages/react-components/src/Output.tsx | 3 +-- packages/react-components/src/Row.tsx | 5 ++--- packages/react-components/src/Status/index.tsx | 5 ++--- packages/react-components/src/Tags.tsx | 5 ++--- packages/react-components/src/util/classes.ts | 8 -------- packages/react-components/src/util/index.ts | 1 - packages/react-params/src/Param/Bare.tsx | 3 +-- packages/react-params/src/Param/index.tsx | 3 +-- packages/react-params/src/valueToText.tsx | 3 +-- 34 files changed, 42 insertions(+), 100 deletions(-) delete mode 100644 packages/react-components/src/util/classes.ts diff --git a/packages/react-components/src/AddressMini.tsx b/packages/react-components/src/AddressMini.tsx index b6b6c41765..db9b247c9e 100644 --- a/packages/react-components/src/AddressMini.tsx +++ b/packages/react-components/src/AddressMini.tsx @@ -8,7 +8,7 @@ import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import { classes, toShortAddress } from './util'; +import { toShortAddress } from './util'; import AccountName from './AccountName'; import BalanceDisplay from './Balance'; import BondedDisplay from './Bonded'; @@ -44,7 +44,7 @@ function AddressMini ({ balance, bonded, children, className = '', iconInfo, isH } return ( -
+
{label && ( )} diff --git a/packages/react-components/src/Available.tsx b/packages/react-components/src/Available.tsx index 2966e878bd..0f2e17e8b5 100644 --- a/packages/react-components/src/Available.tsx +++ b/packages/react-components/src/Available.tsx @@ -6,8 +6,6 @@ import type { AccountId, AccountIndex, Address } from '@polkadot/types/interface import React from 'react'; import { Available } from '@polkadot/react-query'; -import { classes } from './util'; - export interface Props { className?: string; label?: React.ReactNode; @@ -21,7 +19,7 @@ function AvailableDisplay ({ className = '', label, params }: Props): React.Reac return ( diff --git a/packages/react-components/src/Balance.tsx b/packages/react-components/src/Balance.tsx index a6a78da07b..3c92bc663e 100644 --- a/packages/react-components/src/Balance.tsx +++ b/packages/react-components/src/Balance.tsx @@ -8,8 +8,6 @@ import React from 'react'; import { Balance, FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; -import { classes } from './util'; - export interface RenderProps { className?: string; label?: React.ReactNode; @@ -43,7 +41,7 @@ export function renderProvided ({ className = '', label, value }: RenderProps): return ( @@ -65,7 +63,7 @@ function BalanceDisplay (props: Props): React.ReactElement | null { ? <>{renderProvided({ className, label, value: balance })} : ( diff --git a/packages/react-components/src/Bonded.tsx b/packages/react-components/src/Bonded.tsx index 42ff0c5df7..5a924d3a8e 100644 --- a/packages/react-components/src/Bonded.tsx +++ b/packages/react-components/src/Bonded.tsx @@ -8,7 +8,6 @@ import React from 'react'; import { Bonded } from '@polkadot/react-query'; import { renderProvided } from './Balance'; -import { classes } from './util'; export interface Props { bonded?: BN | BN[]; @@ -29,7 +28,7 @@ function BondedDisplay (props: Props): React.ReactElement | null { ? <>{renderProvided({ className, label, value: bonded })} : ( diff --git a/packages/react-components/src/Call.tsx b/packages/react-components/src/Call.tsx index e9e10198a5..20b2e722eb 100644 --- a/packages/react-components/src/Call.tsx +++ b/packages/react-components/src/Call.tsx @@ -12,7 +12,6 @@ import { FormatBalance } from '@polkadot/react-query'; import { GenericCall, getTypeDef } from '@polkadot/types'; import Static from './Static'; -import { classes } from './util'; import { useTranslation } from './translate'; export interface Props { @@ -64,7 +63,7 @@ function Call ({ children, className = '', labelHash, mortality, onError, tip, v }, [value, withHash]); return ( -
+
{ return ( - + {children} ); diff --git a/packages/react-components/src/CryptoType.tsx b/packages/react-components/src/CryptoType.tsx index 7afc0871ef..2e9e3151c2 100644 --- a/packages/react-components/src/CryptoType.tsx +++ b/packages/react-components/src/CryptoType.tsx @@ -6,8 +6,6 @@ import type { AccountId, AccountIndex, Address } from '@polkadot/types/interface import React, { useEffect, useState } from 'react'; import keyring from '@polkadot/ui-keyring'; -import { classes } from './util'; - interface Props { accountId: AccountId | AccountIndex | Address | string | Uint8Array | null; className?: string; @@ -44,7 +42,7 @@ function CryptoType ({ accountId, className = '', label = '' }: Props): React.Re }, [accountId]); return ( -
+
{label}{type}
); diff --git a/packages/react-components/src/Dropdown.tsx b/packages/react-components/src/Dropdown.tsx index aaa43738e1..218fd18fb9 100644 --- a/packages/react-components/src/Dropdown.tsx +++ b/packages/react-components/src/Dropdown.tsx @@ -7,7 +7,6 @@ import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button'; import SUIDropdown, { DropdownProps } from 'semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown'; import { isUndefined } from '@polkadot/util'; -import { classes } from './util'; import Labelled from './Labelled'; interface Props