From 338cdce3e35a887981eab6c2b75fe8f2496314d7 Mon Sep 17 00:00:00 2001 From: web3max Date: Tue, 26 Mar 2024 16:37:23 +0800 Subject: [PATCH] fix: className optimize. --- src/lib/components/AddressItem.tsx | 2 +- src/lib/components/Button/index.tsx | 4 +-- src/lib/components/ChainItem.tsx | 4 +-- src/lib/components/Header/index.tsx | 8 +++--- src/lib/components/LoggedInButton/index.tsx | 2 +- src/lib/components/TorusList.tsx | 8 +++--- src/lib/ui/ChooseEmoji/index.tsx | 2 +- src/lib/ui/FinalConfirm/index.tsx | 2 +- src/lib/ui/InputSignature/index.tsx | 8 +++--- src/lib/ui/LoggedIn/AddressQrCode.tsx | 2 +- src/lib/ui/LoggedIn/DeviceList.tsx | 14 +++++----- src/lib/ui/LoggedIn/LoggedIn.tsx | 30 ++++++++++----------- src/lib/ui/Login/ChainList.tsx | 12 ++++----- src/lib/ui/Login/WalletConnectQrCode.tsx | 2 +- src/lib/ui/ShowQRCode/index.tsx | 2 +- src/lib/ui/TransactionFailed/index.tsx | 2 +- src/lib/ui/TransactionStatus/index.tsx | 2 +- src/lib/ui/TransactionSucceeded/index.tsx | 2 +- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/lib/components/AddressItem.tsx b/src/lib/components/AddressItem.tsx index d6b6165..690ed54 100644 --- a/src/lib/components/AddressItem.tsx +++ b/src/lib/components/AddressItem.tsx @@ -20,7 +20,7 @@ export function AddressItem(props: { address: string; isCurrent?: boolean; class {props.address} {props.isCurrent ? {t`Current`} : null} - + ) } diff --git a/src/lib/components/Button/index.tsx b/src/lib/components/Button/index.tsx index b56ca74..37fe9fd 100644 --- a/src/lib/components/Button/index.tsx +++ b/src/lib/components/Button/index.tsx @@ -114,11 +114,11 @@ export const Button = ({ > {loading ? ( - + ) : null} {props.children} - {outlink ? : null} + {outlink ? : null} ) } diff --git a/src/lib/components/ChainItem.tsx b/src/lib/components/ChainItem.tsx index 5a6b1d3..c58a946 100644 --- a/src/lib/components/ChainItem.tsx +++ b/src/lib/components/ChainItem.tsx @@ -30,9 +30,9 @@ export function ChainItem(props: { {props.name === props.currentLogin ? ( - + ) : ( - + )} ) diff --git a/src/lib/components/Header/index.tsx b/src/lib/components/Header/index.tsx index a857df0..958150c 100644 --- a/src/lib/components/Header/index.tsx +++ b/src/lib/components/Header/index.tsx @@ -23,11 +23,11 @@ export function Header({ title, className, goBack, onClose, style }: HeaderProps {goBack != null ? (
- +
) : null}
- +
) diff --git a/src/lib/components/LoggedInButton/index.tsx b/src/lib/components/LoggedInButton/index.tsx index 358e2da..3895aac 100644 --- a/src/lib/components/LoggedInButton/index.tsx +++ b/src/lib/components/LoggedInButton/index.tsx @@ -19,7 +19,7 @@ export const LoggedInButton = ({ loading = false, className, icon, ...props }: L > {loading ? ( - + ) : ( icon diff --git a/src/lib/components/TorusList.tsx b/src/lib/components/TorusList.tsx index ec6e3ce..0fe2665 100644 --- a/src/lib/components/TorusList.tsx +++ b/src/lib/components/TorusList.tsx @@ -14,11 +14,11 @@ export function TorusList({ className, onClick, currentLogin }: TorusListProps) const [name, setName] = useState('') const list = [ { - logo: Apple ID, + logo: Apple ID, name: 'Apple ID', }, { - logo: Google, + logo: Google, name: 'Google', }, ] @@ -45,9 +45,9 @@ export function TorusList({ className, onClick, currentLogin }: TorusListProps) {item.name} {item.name === name && currentLogin ? ( - + ) : ( - + )} ))} diff --git a/src/lib/ui/ChooseEmoji/index.tsx b/src/lib/ui/ChooseEmoji/index.tsx index 8e4ffd5..f030f05 100644 --- a/src/lib/ui/ChooseEmoji/index.tsx +++ b/src/lib/ui/ChooseEmoji/index.tsx @@ -96,7 +96,7 @@ export function ChooseEmoji({ transitionRef, transitionStyle }: SwapChildProps) onClick={onClick(k)} key={k} className={clsx( - 'relative box-border h-12 w-12 cursor-pointer select-none rounded-xl transition-none active:bg-slate-600/20', + 'relative box-border size-12 cursor-pointer select-none rounded-xl transition-none active:bg-slate-600/20', selected === k ? 'border-2 border-emerald-400 bg-white' : 'hover:bg-slate-600/10', )} > diff --git a/src/lib/ui/FinalConfirm/index.tsx b/src/lib/ui/FinalConfirm/index.tsx index e9ef73d..b5dc3fb 100644 --- a/src/lib/ui/FinalConfirm/index.tsx +++ b/src/lib/ui/FinalConfirm/index.tsx @@ -111,7 +111,7 @@ export function FinalConfirm({ transitionRef, transitionStyle }: SwapChildProps)
{ setChecked(e.target.checked) diff --git a/src/lib/ui/InputSignature/index.tsx b/src/lib/ui/InputSignature/index.tsx index 5f31837..2740a6e 100644 --- a/src/lib/ui/InputSignature/index.tsx +++ b/src/lib/ui/InputSignature/index.tsx @@ -53,7 +53,7 @@ function DomException({ err, className }: { err: DOMException; className?: strin className, )} > - +
{title}
@@ -160,15 +160,15 @@ export function InputSignature({ transitionRef, transitionStyle }: SwapChildProp onChange={onChange} />
-
+
{requiringPermission ? ( -
+
) : ( -
+
)} diff --git a/src/lib/ui/LoggedIn/AddressQrCode.tsx b/src/lib/ui/LoggedIn/AddressQrCode.tsx index bd7f0a2..533f8b5 100644 --- a/src/lib/ui/LoggedIn/AddressQrCode.tsx +++ b/src/lib/ui/LoggedIn/AddressQrCode.tsx @@ -30,7 +30,7 @@ export function AddressQRCode({ transitionRef, transitionStyle }: SwapChildProps ref={transitionRef} style={transitionStyle} > -
+
diff --git a/src/lib/ui/LoggedIn/DeviceList.tsx b/src/lib/ui/LoggedIn/DeviceList.tsx index c06c9fe..b9793de 100644 --- a/src/lib/ui/LoggedIn/DeviceList.tsx +++ b/src/lib/ui/LoggedIn/DeviceList.tsx @@ -22,7 +22,7 @@ function More({ address, onRevoke }: MoreProps) { return ( - + - +
{t`Revoke`}
@@ -249,13 +249,13 @@ function LeadingIcon({ name, emoji, address }: LeadingIconProps) { [address, walletSnap.deviceList], ) if (isMasterDevice) { - return + return } else if (selectedEmoji) { - return + return } else if (name) { - return + return } else { - return + return } } @@ -302,7 +302,7 @@ export function DeviceList({ onShowQRCode, className, onDisconnect }: DeviceList onClick={onShowQRCode} className="flex h-[48px] cursor-pointer items-center gap-4 pl-3 pr-4 hover:bg-secondary-5 active:bg-secondary" > - +
{t`Add New`}
diff --git a/src/lib/ui/LoggedIn/LoggedIn.tsx b/src/lib/ui/LoggedIn/LoggedIn.tsx index b1c132f..8e1428d 100644 --- a/src/lib/ui/LoggedIn/LoggedIn.tsx +++ b/src/lib/ui/LoggedIn/LoggedIn.tsx @@ -54,16 +54,16 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => } const icons: Record = { - [CoinType.btc]: , - [CoinType.ckb]: , - [CoinType.eth]: ETH, - [CoinType.bsc]: BSC, + [CoinType.btc]: , + [CoinType.ckb]: , + [CoinType.eth]: ETH, + [CoinType.bsc]: BSC, // eslint-disable-next-line lingui/no-unlocalized-strings - [CoinType.matic]: Polygon, + [CoinType.matic]: Polygon, // eslint-disable-next-line lingui/no-unlocalized-strings - [CoinType.trx]: Tron, + [CoinType.trx]: Tron, // eslint-disable-next-line lingui/no-unlocalized-strings - [CoinType.doge]: Dogecoin, + [CoinType.doge]: Dogecoin, } const bgImage: Record = { @@ -141,7 +141,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) =>
} + icon={} onClick={() => { walletSnap.address && onCopy(walletSnap.address) }} @@ -150,7 +150,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => } + icon={} onClick={onShowAddressQRCode} > {t`QR Code`} @@ -158,7 +158,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => {walletSnap.ckbAddresses && walletSnap.ckbAddresses?.length > 0 ? ( } + icon={} onClick={onSwitchAddress} > {t`Switch`} @@ -166,7 +166,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => ) : null} } + icon={} loading={disconnectLoading} onClick={disconnect} > @@ -194,7 +194,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) =>
} + icon={} onClick={() => { walletSnap.address && onCopy(walletSnap.address) }} @@ -203,7 +203,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => } + icon={} onClick={onShowAddressQRCode} > {t`QR Code`} @@ -211,7 +211,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => {showOpenTorusButton && ( } + icon={} onClick={openTorus} > {t`Open Torus`} @@ -219,7 +219,7 @@ export const LoggedIn = ({ transitionRef, transitionStyle }: SwapChildProps) => )} } + icon={} loading={disconnectLoading} onClick={disconnect} > diff --git a/src/lib/ui/Login/ChainList.tsx b/src/lib/ui/Login/ChainList.tsx index ec5d607..03b3b3b 100644 --- a/src/lib/ui/Login/ChainList.tsx +++ b/src/lib/ui/Login/ChainList.tsx @@ -23,41 +23,41 @@ interface IChain { } const eth: IChain = { - icon: ETH, + icon: ETH, name: CustomChain.eth, coinType: CoinType.eth, } const bsc: IChain = { - icon: BSC, + icon: BSC, name: CustomChain.bsc, coinType: CoinType.bsc, } const polygon: IChain = { // eslint-disable-next-line lingui/no-unlocalized-strings - icon: Polygon, + icon: Polygon, name: CustomChain.polygon, coinType: CoinType.matic, } const tron: IChain = { // eslint-disable-next-line lingui/no-unlocalized-strings - icon: Tron, + icon: Tron, name: CustomChain.tron, coinType: CoinType.trx, } const doge: IChain = { // eslint-disable-next-line lingui/no-unlocalized-strings - icon: Dogecoin, + icon: Dogecoin, name: CustomChain.doge, coinType: CoinType.doge, } const torus: IChain = { // eslint-disable-next-line lingui/no-unlocalized-strings - icon: Torus, + icon: Torus, name: CustomChain.torus, coinType: CoinType.eth, } diff --git a/src/lib/ui/Login/WalletConnectQrCode.tsx b/src/lib/ui/Login/WalletConnectQrCode.tsx index a95f8ef..24e92b0 100644 --- a/src/lib/ui/Login/WalletConnectQrCode.tsx +++ b/src/lib/ui/Login/WalletConnectQrCode.tsx @@ -39,7 +39,7 @@ export function WalletConnectQrCode({ transitionRef, transitionStyle }: SwapChil : // eslint-disable-next-line @typescript-eslint/restrict-template-expressions t`Scan with ${loginCacheSnap.walletName}`}
-
+
diff --git a/src/lib/ui/ShowQRCode/index.tsx b/src/lib/ui/ShowQRCode/index.tsx index 249313d..231fa82 100644 --- a/src/lib/ui/ShowQRCode/index.tsx +++ b/src/lib/ui/ShowQRCode/index.tsx @@ -42,7 +42,7 @@ export function ShowQRCode({ transitionRef, transitionStyle }: SwapChildProps) {
{t`Use the QR code or link below on your other trusted devices and follow the instructions inside.`}
-
+
- +
{t`Failed`}
{t`The contract verification failed.`}
diff --git a/src/lib/ui/TransactionStatus/index.tsx b/src/lib/ui/TransactionStatus/index.tsx index 7928d8d..dea9a90 100644 --- a/src/lib/ui/TransactionStatus/index.tsx +++ b/src/lib/ui/TransactionStatus/index.tsx @@ -62,7 +62,7 @@ export function TransactionStatus({ transitionRef, transitionStyle }: SwapChildP ref={transitionRef} style={transitionStyle} > - +
{t`Adding Trusted Device`}
{t`Approximately 3 minutes.`}
diff --git a/src/lib/ui/TransactionSucceeded/index.tsx b/src/lib/ui/TransactionSucceeded/index.tsx index 5c0527f..03b48d0 100644 --- a/src/lib/ui/TransactionSucceeded/index.tsx +++ b/src/lib/ui/TransactionSucceeded/index.tsx @@ -16,7 +16,7 @@ export function TransactionSucceeded({ transitionRef, transitionStyle }: SwapChi ref={transitionRef} style={transitionStyle} > - +
{t`New Trusted Device Added`}
{t`The new trusted device has full control over this address.`}