From 30f97c940d0d287bc5363f134063803842d33d23 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 20 Dec 2023 18:56:26 +0000 Subject: [PATCH] Minor updates to code style --- src/SkBottomNavigation.tsx | 4 ++-- src/components/ChainCard.tsx | 2 -- src/components/HelpZen.tsx | 8 ++++---- src/components/MonthSelector.tsx | 4 ++-- src/components/TermsModal.tsx | 4 ++-- src/components/Toggle.tsx | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/SkBottomNavigation.tsx b/src/SkBottomNavigation.tsx index 587e2c8..c2e3af6 100644 --- a/src/SkBottomNavigation.tsx +++ b/src/SkBottomNavigation.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import { useState, useEffect } from 'react' import { useLocation, useNavigate } from 'react-router-dom' import Box from '@mui/material/Box' @@ -9,7 +9,7 @@ import HelpOutlineOutlinedIcon from '@mui/icons-material/HelpOutlineOutlined' import AccountBalanceWalletOutlinedIcon from '@mui/icons-material/AccountBalanceWalletOutlined' export default function SkBottomNavigation() { - const [value, setValue] = React.useState(0) + const [value, setValue] = useState(0) const navigate = useNavigate() const location = useLocation() diff --git a/src/components/ChainCard.tsx b/src/components/ChainCard.tsx index 4e73752..7378243 100644 --- a/src/components/ChainCard.tsx +++ b/src/components/ChainCard.tsx @@ -37,8 +37,6 @@ import ChainLogo from './ChainLogo' import { MAINNET_CHAIN_LOGOS } from '../core/constants' export default function ChainCard(props: { skaleNetwork: interfaces.SkaleNetwork; schain: any[] }) { - // const explorerUrl = getExplorerUrl(BASE_EXPLORER_URLS[props.skaleNetwork], props.schain[0]) - function getChainShortAlias(meta: interfaces.ChainsMetadataMap, name: string): string { return meta[name] && meta[name].shortAlias !== undefined ? meta[name].shortAlias! : name } diff --git a/src/components/HelpZen.tsx b/src/components/HelpZen.tsx index 1e009f9..3db55ac 100644 --- a/src/components/HelpZen.tsx +++ b/src/components/HelpZen.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router-dom' -import React, { useEffect, useState, MouseEvent } from 'react' +import { useEffect, useState, MouseEvent } from 'react' import Box from '@mui/material/Box' import Tooltip from '@mui/material/Tooltip' import IconButton from '@mui/material/IconButton' @@ -13,7 +13,7 @@ import { cls, styles, cmn } from '@skalenetwork/metaport' export default function HelpZen() { const [anchorEl, setAnchorEl] = useState(null) - const [openZen, setOpenZen] = React.useState(false) + const [openZen, setOpenZen] = useState(false) const open = Boolean(anchorEl) @@ -39,7 +39,7 @@ export default function HelpZen() { }, []) return ( - +
- +
) } diff --git a/src/components/MonthSelector.tsx b/src/components/MonthSelector.tsx index a6ef837..d05f35c 100644 --- a/src/components/MonthSelector.tsx +++ b/src/components/MonthSelector.tsx @@ -29,7 +29,7 @@ import { cmn, cls } from '@skalenetwork/metaport' import { formatTimePeriod } from '../core/timeHelper' -const _MONTH_RECOMMENDATIONS = [1, 2, 3, 6, 12, 18, 24] +const MONTH_RECOMMENDATIONS = [1, 2, 3, 6, 12, 18, 24] export default function MonthSelector(props: { max: number @@ -38,7 +38,7 @@ export default function MonthSelector(props: { setErrorMsg: (errorMsg: string | undefined) => void className?: string }) { - const [monthRecommendations, setMonthRecommendations] = useState(_MONTH_RECOMMENDATIONS) + const [monthRecommendations, setMonthRecommendations] = useState(MONTH_RECOMMENDATIONS) const [openCustom, setOpenCustom] = useState(false) const [customPeriod, setCustomPeriod] = useState() const [textPeriod, setTextPeriod] = useState() diff --git a/src/components/TermsModal.tsx b/src/components/TermsModal.tsx index e6d5084..e018465 100644 --- a/src/components/TermsModal.tsx +++ b/src/components/TermsModal.tsx @@ -21,7 +21,7 @@ * @copyright SKALE Labs 2022-Present */ -import React, { type Dispatch, type SetStateAction } from 'react' +import { useState, type Dispatch, type SetStateAction } from 'react' import Container from '@mui/material/Container' import Button from '@mui/material/Button' @@ -42,7 +42,7 @@ export default function TermsModal(props: { termsAccepted: boolean setTermsAccepted: Dispatch> }) { - const [scrolled, setScrolled] = React.useState(false) + const [scrolled, setScrolled] = useState(false) const portalUrl = PORTAL_URLS[props.mpc.config.skaleNetwork] ?? PORTAL_URLS.mainnet diff --git a/src/components/Toggle.tsx b/src/components/Toggle.tsx index 4f40a55..6a5b0f8 100644 --- a/src/components/Toggle.tsx +++ b/src/components/Toggle.tsx @@ -1,9 +1,9 @@ -import * as React from 'react' +import { useState } from 'react' import ToggleButton from '@mui/material/ToggleButton' import ToggleButtonGroup from '@mui/material/ToggleButtonGroup' export default function ToggleButtons() { - const [alignment, setAlignment] = React.useState('left') + const [alignment, setAlignment] = useState('left') const handleAlignment = (_: React.MouseEvent, newAlignment: string | null) => { setAlignment(newAlignment)