diff --git a/apps/explorer/src/components/footer/Footer.tsx b/apps/explorer/src/components/footer/Footer.tsx index 8779d6cc52f..93a2f629ed1 100644 --- a/apps/explorer/src/components/footer/Footer.tsx +++ b/apps/explorer/src/components/footer/Footer.tsx @@ -28,7 +28,7 @@ function FooterLinks(): JSX.Element { ); } -function Footer(): JSX.Element { +export function Footer(): JSX.Element { return ( ); } - -export default Footer; diff --git a/apps/explorer/src/components/header/Header.tsx b/apps/explorer/src/components/header/Header.tsx index a2f95b165d5..9d1d428f7cd 100644 --- a/apps/explorer/src/components/header/Header.tsx +++ b/apps/explorer/src/components/header/Header.tsx @@ -3,12 +3,12 @@ // SPDX-License-Identifier: Apache-2.0 import { NetworkSelector } from '../network'; -import Search from '../search/Search'; +import { Search } from '../search'; import { LinkWithQuery } from '~/components/ui'; import { ThemedIotaLogo } from '~/components'; import { ThemeSwitcher } from '@iota/core'; -function Header(): JSX.Element { +export function Header(): JSX.Element { return (
@@ -30,5 +30,3 @@ function Header(): JSX.Element {
); } - -export default Header; diff --git a/apps/explorer/src/components/layout/PageLayout.tsx b/apps/explorer/src/components/layout/PageLayout.tsx index 8b8192d799e..81de420252f 100644 --- a/apps/explorer/src/components/layout/PageLayout.tsx +++ b/apps/explorer/src/components/layout/PageLayout.tsx @@ -7,8 +7,8 @@ import { useAppsBackend, Feature } from '@iota/core'; import { Network } from '@iota/iota-sdk/client'; import { useQuery } from '@tanstack/react-query'; import { type ReactNode, useRef } from 'react'; -import Footer from '../footer/Footer'; -import Header from '../header/Header'; +import { Footer } from '../footer'; +import { Header } from '../header'; import { useNetworkContext } from '~/contexts'; import { InfoBox, InfoBoxStyle, InfoBoxType, LoadingIndicator } from '@iota/apps-ui-kit'; import { Info } from '@iota/ui-icons'; diff --git a/apps/explorer/src/components/owned-coins/CoinItem.tsx b/apps/explorer/src/components/owned-coins/CoinItem.tsx index d745b9202c3..c06e2d6def5 100644 --- a/apps/explorer/src/components/owned-coins/CoinItem.tsx +++ b/apps/explorer/src/components/owned-coins/CoinItem.tsx @@ -12,7 +12,7 @@ interface CoinItemProps { coin: CoinStruct; } -export default function CoinItem({ coin }: CoinItemProps): JSX.Element { +export function CoinItem({ coin }: CoinItemProps): JSX.Element { const [formattedBalance, symbol] = useFormatCoin(coin.balance, coin.coinType); return ( (isIotaCoin); const [formattedTotalBalance, symbol] = useFormatCoin(coin.totalBalance, coin.coinType); diff --git a/apps/explorer/src/components/owned-coins/OwnedCoins.tsx b/apps/explorer/src/components/owned-coins/OwnedCoins.tsx index 619fd8e9864..e6f4d2059d6 100644 --- a/apps/explorer/src/components/owned-coins/OwnedCoins.tsx +++ b/apps/explorer/src/components/owned-coins/OwnedCoins.tsx @@ -9,7 +9,7 @@ import { useNetwork } from '~/hooks'; import { normalizeIotaAddress } from '@iota/iota-sdk/utils'; import { FilterList, Warning } from '@iota/ui-icons'; import { useMemo, useState } from 'react'; -import OwnedCoinView from './OwnedCoinView'; +import { OwnedCoinView } from './OwnedCoinView'; import { Button, ButtonType, diff --git a/apps/explorer/src/components/owned-coins/OwnedCoinsPanel.tsx b/apps/explorer/src/components/owned-coins/OwnedCoinsPanel.tsx index 2f2895ab885..5d9fd09d144 100644 --- a/apps/explorer/src/components/owned-coins/OwnedCoinsPanel.tsx +++ b/apps/explorer/src/components/owned-coins/OwnedCoinsPanel.tsx @@ -5,7 +5,7 @@ import { useElementDimensions, useGetCoins, useOnScreen } from '@iota/core'; import clsx from 'clsx'; import { useEffect, useRef } from 'react'; -import CoinItem from './CoinItem'; +import { CoinItem } from './CoinItem'; import { LoadingIndicator } from '@iota/apps-ui-kit'; const MIN_CONTAINER_WIDTH_SIZE = 500; @@ -15,7 +15,7 @@ type CoinsPanelProps = { id: string; }; -export default function CoinsPanel({ coinType, id }: CoinsPanelProps): JSX.Element { +export function CoinsPanel({ coinType, id }: CoinsPanelProps): JSX.Element { const containerRef = useRef(null); const coinsSectionRef = useRef(null); const { isIntersecting } = useOnScreen(containerRef); diff --git a/apps/explorer/src/components/search/Search.tsx b/apps/explorer/src/components/search/Search.tsx index d2a0f41eebf..61a5bfaa2d4 100644 --- a/apps/explorer/src/components/search/Search.tsx +++ b/apps/explorer/src/components/search/Search.tsx @@ -10,7 +10,7 @@ import { useDebouncedValue } from '~/hooks/useDebouncedValue'; import { useSearch } from '~/hooks/useSearch'; import { ampli } from '~/lib/utils'; -function Search(): JSX.Element { +export function Search(): JSX.Element { const [query, setQuery] = useState(''); const debouncedQuery = useDebouncedValue(query); const { isPending, data: results } = useSearch(debouncedQuery); @@ -58,5 +58,3 @@ function Search(): JSX.Element { /> ); } - -export default Search; diff --git a/apps/explorer/src/components/ui/image/Image.tsx b/apps/explorer/src/components/ui/image/Image.tsx index 63e18775839..0f277a86298 100644 --- a/apps/explorer/src/components/ui/image/Image.tsx +++ b/apps/explorer/src/components/ui/image/Image.tsx @@ -8,8 +8,7 @@ import { cva, cx, type VariantProps } from 'class-variance-authority'; import clsx from 'clsx'; import { useAnimate } from 'framer-motion'; import { type ImgHTMLAttributes, useEffect, useState } from 'react'; - -import useImage from '~/hooks/useImage'; +import { useImage } from '~/hooks'; import { ImageVisibility } from '~/lib/enums'; const imageStyles = cva(null, { diff --git a/apps/explorer/src/hooks/useImage.ts b/apps/explorer/src/hooks/useImage.ts index f750e4ac715..50018b6568f 100644 --- a/apps/explorer/src/hooks/useImage.ts +++ b/apps/explorer/src/hooks/useImage.ts @@ -47,5 +47,3 @@ export function useImage({ src = '', moderate = true }: UseImageProps) { return { moderation, url: formatted, status, ref }; } - -export default useImage; diff --git a/apps/explorer/src/pages/address-result/AddressResult.tsx b/apps/explorer/src/pages/address-result/AddressResult.tsx index 32808a8d796..7f55716dbaf 100644 --- a/apps/explorer/src/pages/address-result/AddressResult.tsx +++ b/apps/explorer/src/pages/address-result/AddressResult.tsx @@ -47,7 +47,7 @@ function AddressResult({ address }: { address: string }): JSX.Element { ); } -export default function AddressResultPage(): JSX.Element { +export function AddressResultPage(): JSX.Element { const { id } = useParams(); return ( diff --git a/apps/explorer/src/pages/checkpoints/CheckpointDetail.tsx b/apps/explorer/src/pages/checkpoints/CheckpointDetail.tsx index 7b23c9054b1..454232d3591 100644 --- a/apps/explorer/src/pages/checkpoints/CheckpointDetail.tsx +++ b/apps/explorer/src/pages/checkpoints/CheckpointDetail.tsx @@ -37,7 +37,7 @@ enum NestedTabs { Aggregated = 'aggregated', } -export default function CheckpointDetail(): JSX.Element { +export function CheckpointDetail(): JSX.Element { const [activeFeesTabId, setActiveFeesTabId] = useState(FeesTabs.GasAndStorageFees); const [activeDetailsTabId, setActiveDetailsTabId] = useState(DetailsTabs.Details); const [activeNestedTabId, setActiveNestedTabId] = useState(NestedTabs.Aggregated); diff --git a/apps/explorer/src/pages/epochs/EpochDetail.tsx b/apps/explorer/src/pages/epochs/EpochDetail.tsx index cf6b074838d..35c091262d2 100644 --- a/apps/explorer/src/pages/epochs/EpochDetail.tsx +++ b/apps/explorer/src/pages/epochs/EpochDetail.tsx @@ -35,7 +35,7 @@ enum EpochTabs { Validators = 'validators', } -export default function EpochDetail() { +export function EpochDetail() { const [activeTabId, setActiveTabId] = useState(EpochTabs.Checkpoints); const { id } = useParams(); const enhancedRpc = useEnhancedRpcClient(); diff --git a/apps/explorer/src/pages/home/Home.tsx b/apps/explorer/src/pages/home/Home.tsx index 1cee4ba88ab..d89625da7b0 100644 --- a/apps/explorer/src/pages/home/Home.tsx +++ b/apps/explorer/src/pages/home/Home.tsx @@ -21,7 +21,7 @@ import { useNetwork } from '~/hooks'; const TRANSACTIONS_LIMIT = 15; -function Home(): JSX.Element { +export function Home(): JSX.Element { const [network] = useNetwork(); const isIotaTokenCardEnabled = network === Network.Mainnet; return ( @@ -77,5 +77,3 @@ function Home(): JSX.Element { /> ); } - -export default Home; diff --git a/apps/explorer/src/pages/index.tsx b/apps/explorer/src/pages/index.tsx index c1e40edb438..d2bd6722775 100644 --- a/apps/explorer/src/pages/index.tsx +++ b/apps/explorer/src/pages/index.tsx @@ -4,13 +4,13 @@ import { wrapCreateBrowserRouter } from '@sentry/react'; import { createBrowserRouter, Navigate, useLocation, useParams } from 'react-router-dom'; -import AddressResult from './address-result/AddressResult'; -import CheckpointDetail from './checkpoints/CheckpointDetail'; -import EpochDetail from './epochs/EpochDetail'; -import Home from './home/Home'; +import { AddressResultPage } from './address-result/AddressResult'; +import { CheckpointDetail } from './checkpoints/CheckpointDetail'; +import { EpochDetail } from './epochs/EpochDetail'; +import { Home } from './home/Home'; import { ObjectResult } from './object-result/ObjectResult'; import { Recent } from './recent'; -import TransactionResult from './transaction-result/TransactionResult'; +import { TransactionResult } from './transaction-result/TransactionResult'; import { ValidatorDetails } from './validator/ValidatorDetails'; import { ValidatorPageResult } from './validators/Validators'; import { Layout } from '~/components'; @@ -39,7 +39,7 @@ export const router = sentryCreateBrowserRouter([ { path: 'epoch/current', element: }, { path: 'txblock/:id', element: }, { path: 'epoch/:id', element: }, - { path: 'address/:id', element: }, + { path: 'address/:id', element: }, { path: 'validators', element: }, { path: 'validator/:id', element: }, ], diff --git a/apps/explorer/src/pages/object-result/ObjectResult.tsx b/apps/explorer/src/pages/object-result/ObjectResult.tsx index 147ba0fc4d5..b933c96f1e2 100644 --- a/apps/explorer/src/pages/object-result/ObjectResult.tsx +++ b/apps/explorer/src/pages/object-result/ObjectResult.tsx @@ -8,8 +8,7 @@ import { ErrorBoundary, PageLayout } from '~/components'; import { PageHeader } from '~/components/ui'; import { ObjectView } from '~/pages/object-result/views/ObjectView'; import { translate, type DataType } from './ObjectResultType'; -import PkgView from './views/PkgView'; -import { TokenView } from './views/TokenView'; +import { PkgView, TokenView } from './views'; import { InfoBox, InfoBoxStyle, InfoBoxType, LoadingIndicator } from '@iota/apps-ui-kit'; import { Warning } from '@iota/ui-icons'; diff --git a/apps/explorer/src/pages/object-result/views/PkgView.tsx b/apps/explorer/src/pages/object-result/views/PkgView.tsx index 7710894489a..56beb84b038 100644 --- a/apps/explorer/src/pages/object-result/views/PkgView.tsx +++ b/apps/explorer/src/pages/object-result/views/PkgView.tsx @@ -39,7 +39,7 @@ interface PkgViewProps { data: DataType; } -function PkgView({ data }: PkgViewProps): JSX.Element { +export function PkgView({ data }: PkgViewProps): JSX.Element { const [selectedSplitPanelOrientation, setSplitPanelOrientation] = useState( SPLIT_PANELS_ORIENTATION[1].value, ); @@ -145,5 +145,3 @@ function PkgView({ data }: PkgViewProps): JSX.Element { ); } - -export default PkgView; diff --git a/apps/explorer/src/pages/object-result/views/index.ts b/apps/explorer/src/pages/object-result/views/index.ts new file mode 100644 index 00000000000..08b740d5988 --- /dev/null +++ b/apps/explorer/src/pages/object-result/views/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +export * from './PkgView'; +export * from './TokenView'; diff --git a/apps/explorer/src/pages/transaction-result/TransactionResult.tsx b/apps/explorer/src/pages/transaction-result/TransactionResult.tsx index 2abdd1770a9..62e6cf4ab45 100644 --- a/apps/explorer/src/pages/transaction-result/TransactionResult.tsx +++ b/apps/explorer/src/pages/transaction-result/TransactionResult.tsx @@ -40,7 +40,7 @@ function TransactionResultPageHeader({ ); } -export default function TransactionResult(): JSX.Element { +export function TransactionResult(): JSX.Element { const { id } = useParams(); const { isPending, diff --git a/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx b/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx index d15da2af5de..0b7ece824cf 100644 --- a/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +++ b/apps/ui-kit/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx @@ -154,5 +154,3 @@ export function KeyValueInfo({ ); } - -export default KeyValueInfo; diff --git a/apps/wallet-dashboard/components/AmountBox.tsx b/apps/wallet-dashboard/components/AmountBox.tsx index 8db7bb609d0..a59926b1357 100644 --- a/apps/wallet-dashboard/components/AmountBox.tsx +++ b/apps/wallet-dashboard/components/AmountBox.tsx @@ -8,7 +8,7 @@ interface AmountBoxProps { amount: string; } -function AmountBox({ title, amount }: AmountBoxProps): JSX.Element { +export function AmountBox({ title, amount }: AmountBoxProps): JSX.Element { return (
@@ -17,5 +17,3 @@ function AmountBox({ title, amount }: AmountBoxProps): JSX.Element {
); } - -export default AmountBox; diff --git a/apps/wallet-dashboard/components/Box.tsx b/apps/wallet-dashboard/components/Box.tsx index 3b9b285ea6e..cf2df3ae976 100644 --- a/apps/wallet-dashboard/components/Box.tsx +++ b/apps/wallet-dashboard/components/Box.tsx @@ -8,7 +8,7 @@ interface BoxProps { title?: string; } -function Box({ children, title }: BoxProps): JSX.Element { +export function Box({ children, title }: BoxProps): JSX.Element { return (
{title &&

{title}

} @@ -16,5 +16,3 @@ function Box({ children, title }: BoxProps): JSX.Element {
); } - -export default Box; diff --git a/apps/wallet-dashboard/components/Buttons/Button.tsx b/apps/wallet-dashboard/components/Buttons/Button.tsx index b15149e1201..78c21b256f2 100644 --- a/apps/wallet-dashboard/components/Buttons/Button.tsx +++ b/apps/wallet-dashboard/components/Buttons/Button.tsx @@ -9,7 +9,7 @@ interface ButtonProps { disabled?: boolean; } -function Button({ onClick, children, disabled }: ButtonProps): JSX.Element { +export function Button({ onClick, children, disabled }: ButtonProps): JSX.Element { return (