diff --git a/packages/apps/dashboard/client/eslint.config.js b/packages/apps/dashboard/client/eslint.config.js index dcf3e17b34..a253b2d2e5 100644 --- a/packages/apps/dashboard/client/eslint.config.js +++ b/packages/apps/dashboard/client/eslint.config.js @@ -72,6 +72,7 @@ export default tseslint.config( ], 'import/no-duplicates': 'error', 'import/no-unresolved': 'error', + '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }], '@typescript-eslint/no-explicit-any': 'error', 'no-console': ['error', { allow: ['warn', 'error'] }], diff --git a/packages/apps/dashboard/client/index.html b/packages/apps/dashboard/client/index.html index 3b1a160e05..bbab1e01ee 100644 --- a/packages/apps/dashboard/client/index.html +++ b/packages/apps/dashboard/client/index.html @@ -2,17 +2,16 @@ - + + - + + HUMAN Dashboard diff --git a/packages/apps/dashboard/client/src/app/AppRoutes.tsx b/packages/apps/dashboard/client/src/app/AppRoutes.tsx index 866ee88553..1ca3459cef 100644 --- a/packages/apps/dashboard/client/src/app/AppRoutes.tsx +++ b/packages/apps/dashboard/client/src/app/AppRoutes.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; diff --git a/packages/apps/dashboard/client/src/app/providers/ThemeProvider.tsx b/packages/apps/dashboard/client/src/app/providers/ThemeProvider.tsx index 82045f6af2..a4e372457c 100644 --- a/packages/apps/dashboard/client/src/app/providers/ThemeProvider.tsx +++ b/packages/apps/dashboard/client/src/app/providers/ThemeProvider.tsx @@ -1,17 +1,15 @@ import { - FC, - PropsWithChildren, + type FC, + type PropsWithChildren, useCallback, useEffect, useMemo, useState, } from 'react'; -import { - CssBaseline, - PaletteMode, - ThemeProvider as MuiThemeProvider, -} from '@mui/material'; +import type { PaletteMode } from '@mui/material'; +import CssBaseline from '@mui/material/CssBaseline'; +import MuiThemeProvider from '@mui/material/styles/ThemeProvider'; import { createAppTheme } from '@/shared/ui/theme'; diff --git a/packages/apps/dashboard/client/src/app/styles/_home-page.scss b/packages/apps/dashboard/client/src/app/styles/_home-page.scss index e0c55f0895..28f2715d44 100644 --- a/packages/apps/dashboard/client/src/app/styles/_home-page.scss +++ b/packages/apps/dashboard/client/src/app/styles/_home-page.scss @@ -1,7 +1,3 @@ -.home-page-search { - margin-top: 24px; -} - .home-page-leaderboard { margin-top: 60px; } diff --git a/packages/apps/dashboard/client/src/app/styles/_page-wrapper.scss b/packages/apps/dashboard/client/src/app/styles/_page-wrapper.scss index 647bdf1945..d51f35de55 100644 --- a/packages/apps/dashboard/client/src/app/styles/_page-wrapper.scss +++ b/packages/apps/dashboard/client/src/app/styles/_page-wrapper.scss @@ -12,10 +12,15 @@ .container { margin: auto; padding: 30px 80px 100px; + min-height: calc(100vh - 82px); @media (max-width: 1200px) { padding: 24px 16px; } + + @media (max-width: 900px) { + min-height: calc(100vh - 62px); + } } @media (max-width: 600px) { diff --git a/packages/apps/dashboard/client/src/features/graph/api/useChartData.ts b/packages/apps/dashboard/client/src/features/graph/api/useChartData.ts index b6e27a522d..5f0c24e2b5 100644 --- a/packages/apps/dashboard/client/src/features/graph/api/useChartData.ts +++ b/packages/apps/dashboard/client/src/features/graph/api/useChartData.ts @@ -10,11 +10,11 @@ import validateResponse from '@/shared/lib/validateResponse'; import { hcaptchaDailyStatsSchema, - HcaptchaDailyStats, + type HcaptchaDailyStats, } from '../model/hcaptchaDailyStatsSchema'; import { hmtDailyStatsSchema, - HMTDailyStats, + type HMTDailyStats, } from '../model/hmtDailyStatsSchema'; export type ChartData = (HMTDailyStats & Omit)[]; diff --git a/packages/apps/dashboard/client/src/features/graph/store/useChartParamsStore.ts b/packages/apps/dashboard/client/src/features/graph/store/useChartParamsStore.ts index 7755ed615d..28f2fcdc64 100644 --- a/packages/apps/dashboard/client/src/features/graph/store/useChartParamsStore.ts +++ b/packages/apps/dashboard/client/src/features/graph/store/useChartParamsStore.ts @@ -1,4 +1,4 @@ -import dayjs, { Dayjs } from 'dayjs'; +import dayjs, { type Dayjs } from 'dayjs'; import { create } from 'zustand'; const MINIMAL_DATE_FOR_DATE_PICKER = '2021-04-06'; diff --git a/packages/apps/dashboard/client/src/features/graph/ui/AreaChart.tsx b/packages/apps/dashboard/client/src/features/graph/ui/AreaChart.tsx index 73a297367d..cfe54a390c 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/AreaChart.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/AreaChart.tsx @@ -1,9 +1,10 @@ -import { FC, useEffect, useRef, useState } from 'react'; +import { type FC, useEffect, useRef, useState } from 'react'; -import { Typography, useTheme } from '@mui/material'; import Card from '@mui/material/Card'; import Stack from '@mui/material/Stack'; -import dayjs, { Dayjs } from 'dayjs'; +import useTheme from '@mui/material/styles/useTheme'; +import Typography from '@mui/material/Typography'; +import dayjs, { type Dayjs } from 'dayjs'; import { CartesianGrid, Tooltip, @@ -16,7 +17,7 @@ import { import DatePicker from '@/shared/ui/DatePicker'; -import useChartData, { ChartData } from '../api/useChartData'; +import useChartData, { type ChartData } from '../api/useChartData'; import formatNumber from '../lib/formatNumber'; import useChartParamsStore, { initialAllTime, diff --git a/packages/apps/dashboard/client/src/features/graph/ui/ChartTooltip.tsx b/packages/apps/dashboard/client/src/features/graph/ui/ChartTooltip.tsx index a1c474da5b..98cb87e7a5 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/ChartTooltip.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/ChartTooltip.tsx @@ -1,17 +1,18 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord'; -import { Grid, Typography } from '@mui/material'; import Box from '@mui/material/Box'; import Card from '@mui/material/Card'; +import Grid from '@mui/material/Grid'; import Stack from '@mui/material/Stack'; -import { TooltipProps } from 'recharts'; +import Typography from '@mui/material/Typography'; +import type { TooltipProps } from 'recharts'; import FormattedNumber from '@/shared/ui/FormattedNumber'; import formatDate from '../lib/formatDate'; -import { ChartDataConfigObject } from './AreaChart'; +import type { ChartDataConfigObject } from './AreaChart'; const renderTitle = (title: string) => { const currentTitle: ChartDataConfigObject = { diff --git a/packages/apps/dashboard/client/src/features/graph/ui/CustomXAxisTick.tsx b/packages/apps/dashboard/client/src/features/graph/ui/CustomXAxisTick.tsx index 7d351507c6..154a1a8687 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/CustomXAxisTick.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/CustomXAxisTick.tsx @@ -1,6 +1,6 @@ -import { useTheme } from '@mui/material'; +import useTheme from '@mui/material/styles/useTheme'; // @ts-expect-error -- import error, but this type work property -import { ContentRenderer } from 'recharts'; +import type { ContentRenderer } from 'recharts'; import formatDate from '../lib/formatDate'; diff --git a/packages/apps/dashboard/client/src/features/graph/ui/GraphSwiper.tsx b/packages/apps/dashboard/client/src/features/graph/ui/GraphSwiper.tsx index 67775b3f45..cf4e9c602f 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/GraphSwiper.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/GraphSwiper.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect } from 'react'; +import { type FC, useEffect } from 'react'; import { Navigation } from 'swiper/modules'; import { Swiper, SwiperSlide } from 'swiper/react'; diff --git a/packages/apps/dashboard/client/src/features/graph/ui/SmallGraph.tsx b/packages/apps/dashboard/client/src/features/graph/ui/SmallGraph.tsx index f03d15b7d0..0a8e17c1b3 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/SmallGraph.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/SmallGraph.tsx @@ -1,19 +1,19 @@ -import { FC, Fragment } from 'react'; +import { type FC, Fragment } from 'react'; -import { useTheme } from '@mui/material'; import Box from '@mui/material/Box'; import Card from '@mui/material/Card'; import Stack from '@mui/material/Stack'; +import useTheme from '@mui/material/styles/useTheme'; import Typography from '@mui/material/Typography'; import { - AreaChart, Area, - XAxis, - YAxis, + AreaChart, CartesianGrid, - Tooltip, ResponsiveContainer, - TooltipProps, + Tooltip, + type TooltipProps, + XAxis, + YAxis, } from 'recharts'; import { useIsMobile } from '@/shared/hooks/useBreakpoints'; diff --git a/packages/apps/dashboard/client/src/features/graph/ui/ToggleButtons.tsx b/packages/apps/dashboard/client/src/features/graph/ui/ToggleButtons.tsx index 9ef5a320b4..8bb138b157 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/ToggleButtons.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/ToggleButtons.tsx @@ -1,12 +1,12 @@ -import { styled } from '@mui/material'; import Button from '@mui/material/Button'; +import styled from '@mui/material/styles/styled'; import ToggleButton from '@mui/material/ToggleButton'; import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; import dayjs from 'dayjs'; import useChartParamsStore, { TIME_PERIOD_OPTIONS, - TimePeriod, + type TimePeriod, } from '../store/useChartParamsStore'; export const StyledToggleButtonGroup = styled(ToggleButtonGroup)( diff --git a/packages/apps/dashboard/client/src/features/graph/ui/ToggleCharts.tsx b/packages/apps/dashboard/client/src/features/graph/ui/ToggleCharts.tsx index b699b14f8d..14ea451755 100644 --- a/packages/apps/dashboard/client/src/features/graph/ui/ToggleCharts.tsx +++ b/packages/apps/dashboard/client/src/features/graph/ui/ToggleCharts.tsx @@ -1,8 +1,10 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { FormControlLabel, FormGroup, Typography } from '@mui/material'; import Checkbox from '@mui/material/Checkbox'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import FormGroup from '@mui/material/FormGroup'; import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; import FormattedNumber from '@/shared/ui/FormattedNumber'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/model/leaderboardSchema.ts b/packages/apps/dashboard/client/src/features/leaderboard/model/leaderboardSchema.ts index 03bb6609f7..9d66199cda 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/model/leaderboardSchema.ts +++ b/packages/apps/dashboard/client/src/features/leaderboard/model/leaderboardSchema.ts @@ -1,19 +1,6 @@ import { z } from 'zod'; -export const reputationSchema = z.unknown().transform((value) => { - try { - const knownReputation = z - .union([z.literal('Low'), z.literal('Medium'), z.literal('High')]) - .parse(value); - - return knownReputation; - } catch (error) { - console.error(error); - return 'Unknown'; - } -}); - -export type Reputation = z.infer; +import { reputationSchema } from '@/shared/model/reputationSchema'; const leaderboardEntity = z.object({ address: z.string(), diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/AddressCell.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/AddressCell.tsx index f2935aa8fa..901fbb1d69 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/AddressCell.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/AddressCell.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { ChainId } from '@human-protocol/sdk'; +import type { ChainId } from '@human-protocol/sdk/src/enums'; import Box from '@mui/material/Box'; import AbbreviateClipboard from '@/shared/ui/AbbreviateClipboard'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/CategoryCell.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/CategoryCell.tsx index aff8549534..887dca2b8f 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/CategoryCell.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/CategoryCell.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/ChainCell.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/ChainCell.tsx index 028b9dcaf2..55d910c549 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/ChainCell.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/ChainCell.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { ChainId } from '@human-protocol/sdk'; +import type { ChainId } from '@human-protocol/sdk/src/enums'; import Typography from '@mui/material/Typography'; import { getNetwork } from '@/shared/lib/networks'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/DataGridWrapper.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/DataGridWrapper.tsx index bc71c3b905..f89fc8e37a 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/DataGridWrapper.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/DataGridWrapper.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; @@ -8,7 +8,7 @@ import { useIsMobile } from '@/shared/hooks/useBreakpoints'; import handleErrorMessage from '@/shared/lib/handleErrorMessage'; import Loader from '@/shared/ui/Loader'; -import { LeaderboardData } from '../model/leaderboardSchema'; +import type { LeaderboardData } from '../model/leaderboardSchema'; import useDataGrid from '../ui/useDataGrid'; type Props = { diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/Leaderboard.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/Leaderboard.tsx index baea7f9a8b..8d14be8764 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/Leaderboard.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/Leaderboard.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/RoleCell.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/RoleCell.tsx index f65a2a7da4..d2ec1162de 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/RoleCell.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/RoleCell.tsx @@ -1,6 +1,6 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; -import { Launch as LaunchIcon } from '@mui/icons-material'; +import LaunchIcon from '@mui/icons-material/Launch'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import { Link } from 'react-router-dom'; @@ -59,13 +59,16 @@ const RoleCell: FC = ({ rank, role, websiteUrl, name }) => { - + {formattedName ?? humanReadableRole} {websiteUrl ? : null} {name && role ? ( - + {humanReadableRole} ) : null} diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/SelectNetwork.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/SelectNetwork.tsx index 555c9a8b3a..d8972b9e45 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/SelectNetwork.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/SelectNetwork.tsx @@ -5,7 +5,7 @@ import CircularProgress from '@mui/material/CircularProgress'; import FormControl from '@mui/material/FormControl'; import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; -import Select, { SelectChangeEvent } from '@mui/material/Select'; +import Select, { type SelectChangeEvent } from '@mui/material/Select'; import useFilteredNetworks from '@/shared/api/useFilteredNetworks'; import { useIsMobile } from '@/shared/hooks/useBreakpoints'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/TextCell.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/TextCell.tsx index a3f78f9ebf..49e650b8c3 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/TextCell.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/TextCell.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Typography from '@mui/material/Typography'; diff --git a/packages/apps/dashboard/client/src/features/leaderboard/ui/useDataGrid.tsx b/packages/apps/dashboard/client/src/features/leaderboard/ui/useDataGrid.tsx index f2e2f630f2..1f9930e059 100644 --- a/packages/apps/dashboard/client/src/features/leaderboard/ui/useDataGrid.tsx +++ b/packages/apps/dashboard/client/src/features/leaderboard/ui/useDataGrid.tsx @@ -3,12 +3,12 @@ import { useMemo } from 'react'; import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; -import { GridColDef, GridRenderCellParams } from '@mui/x-data-grid'; +import type { GridColDef, GridRenderCellParams } from '@mui/x-data-grid'; import { useIsMobile } from '@/shared/hooks/useBreakpoints'; import CustomTooltip from '@/shared/ui/CustomTooltip'; -import { LeaderboardData } from '../model/leaderboardSchema'; +import type { LeaderboardData } from '../model/leaderboardSchema'; import useLeaderboardFiltersStore from '../store/useLeaderboardFiltersStore'; import AddressCell from './AddressCell'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts b/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts index 10b6b53ddd..e12e5844ee 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts +++ b/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts @@ -1,7 +1,7 @@ -import { Role } from '@human-protocol/sdk'; +import { Role } from '@human-protocol/sdk/src/constants'; import { z } from 'zod'; -import { reputationSchema } from '@/features/leaderboard/model/leaderboardSchema'; +import { reputationSchema } from '@/shared/model/reputationSchema'; const transformOptionalTokenAmount = ( value: string | undefined | null, diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/Clipboard.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/Clipboard.tsx index 7d4c256570..ef1550aa55 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/Clipboard.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/Clipboard.tsx @@ -1,4 +1,4 @@ -import { FC, useState } from 'react'; +import { type FC, useState } from 'react'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import Card from '@mui/material/Card'; @@ -43,6 +43,7 @@ const Clipboard: FC = ({ value }) => { { navigator.clipboard.writeText(value); setTooltipOpen(true); diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx index 5270129696..8f8318f455 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Chip from '@mui/material/Chip'; import Stack from '@mui/material/Stack'; @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography'; import SectionWrapper from '@/shared/ui/SectionWrapper'; -import { AddressDetailsEscrow } from '../model/addressDetailsSchema'; +import type { AddressDetailsEscrow } from '../model/addressDetailsSchema'; import HmtBalance from './HmtBalance'; import TitleSectionWrapper from './TitleSectionWrapper'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx index 0d9d00c134..fab1fbc99c 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtPrice.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtPrice.tsx index be07a28276..7d0233744f 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtPrice.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtPrice.tsx @@ -1,4 +1,5 @@ -import { Typography, Stack } from '@mui/material'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; import useHmtPrice from '@/shared/api/useHmtPrice'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorAddress.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorAddress.tsx index 9f47bdbbc8..4054a82cf9 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorAddress.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorAddress.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { Role } from '@human-protocol/sdk'; +import { Role } from '@human-protocol/sdk/src/constants'; import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; import Link from '@mui/material/Link'; @@ -13,7 +13,7 @@ import { env } from '@/shared/config/env'; import EntityIcon from '@/shared/ui/EntityIcon'; import SectionWrapper from '@/shared/ui/SectionWrapper'; -import { AddressDetailsOperator } from '../model/addressDetailsSchema'; +import type { AddressDetailsOperator } from '../model/addressDetailsSchema'; import HmtBalance from './HmtBalance'; import HmtPrice from './HmtPrice'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTable.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTable.tsx index 02c973e230..dae7cbd7ea 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTable.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTable.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Table from '@mui/material/Table'; import TableContainer from '@mui/material/TableContainer'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBody.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBody.tsx index 34cbef9bdd..bb34c6301c 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBody.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBody.tsx @@ -1,15 +1,15 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { TableRow } from '@mui/material'; import CircularProgress from '@mui/material/CircularProgress'; import Link from '@mui/material/Link'; import MuiTableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; import handleErrorMessage from '@/shared/lib/handleErrorMessage'; import useGlobalFiltersStore from '@/shared/store/useGlobalFiltersStore'; -import { PaginatedEscrowDetails } from '../../model/escrowDetailsSchema'; +import type { PaginatedEscrowDetails } from '../../model/escrowDetailsSchema'; import EscrowsTableBodyContainer from './EscrowsTableBodyContainer'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBodyContainer.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBodyContainer.tsx index fe7f2c329e..9f85086590 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBodyContainer.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/OperatorEscrows/EscrowsTableBodyContainer.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import Grid from '@mui/material/Grid'; import MuiTableBody from '@mui/material/TableBody'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/ReputationScore.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/ReputationScore.tsx index 6dc9a20c09..c6a1b8d0db 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/ReputationScore.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/ReputationScore.tsx @@ -1,6 +1,7 @@ -import { Chip, useTheme } from '@mui/material'; +import Chip from '@mui/material/Chip'; +import useTheme from '@mui/material/styles/useTheme'; -type Reputation = 'High' | 'Medium' | 'Low' | 'Unknown'; +import type { Reputation } from '@/shared/model/reputationSchema'; type Props = { reputation: Reputation; @@ -15,28 +16,28 @@ const ReputationScore = ({ reputation }: Props) => { const theme = useTheme(); const reputationAttributes: Record = { - High: { + high: { title: 'High', colors: { title: theme.palette.success.main, border: theme.palette.success.light, }, }, - Medium: { + medium: { title: 'Medium', colors: { title: theme.palette.warning.main, border: theme.palette.warning.light, }, }, - Low: { + low: { title: 'Low', colors: { title: theme.palette.orange.main, border: theme.palette.orange.light, }, }, - Unknown: { + unknown: { title: 'Coming soon', colors: { title: theme.palette.ocean.main, diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/SearchResults.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/SearchResults.tsx index e9b30182a3..ff88b6637e 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/SearchResults.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/SearchResults.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; -import { Stack } from '@mui/material'; +import Stack from '@mui/material/Stack'; import { AxiosError } from 'axios'; import { useLocation, useParams } from 'react-router-dom'; @@ -13,7 +13,7 @@ import Loader from '@/shared/ui/Loader'; import ShadowIcon from '@/shared/ui/ShadowIcon'; import useAddressDetails from '../api/useAddressDetails'; -import { AddressDetails } from '../model/addressDetailsSchema'; +import type { AddressDetails } from '../model/addressDetailsSchema'; import Clipboard from './Clipboard'; import EscrowAddress from './EscrowAddress'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx index 8731f44cfc..60d7023dbb 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/TablePagination.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/TablePagination.tsx index a0611b80ee..8a35ebfa92 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/TablePagination.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/TablePagination.tsx @@ -1,6 +1,6 @@ -import { FC, useEffect } from 'react'; +import { type FC, useEffect } from 'react'; -import { TablePagination as MuiTablePagination } from '@mui/material'; +import MuiTablePagination from '@mui/material/TablePagination'; import useGlobalFiltersStore from '@/shared/store/useGlobalFiltersStore'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/TitleSectionWrapper.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/TitleSectionWrapper.tsx index 3eacd67706..a7fc5ad517 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/TitleSectionWrapper.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/TitleSectionWrapper.tsx @@ -1,9 +1,9 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; -import { SxProps } from '@mui/material'; import Box from '@mui/material/Box'; import Stack from '@mui/material/Stack'; +import type { SxProps } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; import CustomTooltip from '@/shared/ui/CustomTooltip'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx index 8d57079fb1..ae097a4229 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx index bc74edf214..254e6fecac 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx @@ -1,11 +1,11 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import SectionWrapper from '@/shared/ui/SectionWrapper'; -import { +import type { AddressDetailsOperator, AddressDetailsWallet, } from '../model/addressDetailsSchema'; diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBody.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBody.tsx index f1725e4252..f39de49cd3 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBody.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBody.tsx @@ -1,4 +1,4 @@ -import { FC, useState } from 'react'; +import { type FC, useState } from 'react'; import AddCircleIcon from '@mui/icons-material/AddCircle'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; @@ -13,7 +13,7 @@ import TableRow from '@mui/material/TableRow'; import handleErrorMessage from '@/shared/lib/handleErrorMessage'; import AbbreviateClipboard from '@/shared/ui/AbbreviateClipboard'; -import { PaginatedTransactionDetails } from '../../model/transactionDetailsSchema'; +import type { PaginatedTransactionDetails } from '../../model/transactionDetailsSchema'; import TransactionsTableBodyContainer from './TransactionsTableBodyContainer'; import TransactionsTableCellMethod from './TransactionsTableCellMethod'; @@ -75,7 +75,11 @@ const TransactionsTableBody: FC = ({ data, isLoading, error }) => { {elem.internalTransactions.length > 0 && ( - toggleRow(idx)} size="small"> + toggleRow(idx)} + size="small" + > {expandedRows[idx] ? ( ) : ( diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBodyContainer.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBodyContainer.tsx index 133bb36a0f..97e6abc3d2 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBodyContainer.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/WalletTransactions/TransactionsTableBodyContainer.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import Grid from '@mui/material/Grid'; import MuiTableBody from '@mui/material/TableBody'; diff --git a/packages/apps/dashboard/client/src/pages/home/ui/HomePage.tsx b/packages/apps/dashboard/client/src/pages/home/ui/HomePage.tsx index a92bd05c73..3e2e5fe8c9 100644 --- a/packages/apps/dashboard/client/src/pages/home/ui/HomePage.tsx +++ b/packages/apps/dashboard/client/src/pages/home/ui/HomePage.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; import Box from '@mui/material/Box'; @@ -28,7 +28,7 @@ const CardWrapper = styled(Grid)(({ theme }) => ({ borderRadius: '16px', padding: '24px 32px', [theme.breakpoints.up('md')]: { - height: 300, + height: '100%', }, [theme.breakpoints.down('md')]: { height: 'auto', @@ -66,10 +66,10 @@ const HomePage: FC = () => { return ( - + All HUMAN activity. In one place. - + diff --git a/packages/apps/dashboard/client/src/shared/model/reputationSchema.ts b/packages/apps/dashboard/client/src/shared/model/reputationSchema.ts new file mode 100644 index 0000000000..92b074435e --- /dev/null +++ b/packages/apps/dashboard/client/src/shared/model/reputationSchema.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const reputationSchema = z.unknown().transform((value) => { + try { + const knownReputation = z + .union([z.literal('low'), z.literal('medium'), z.literal('high')]) + .parse(value); + + return knownReputation; + } catch (error) { + console.error(error); + return 'unknown'; + } +}); + +export type Reputation = z.infer; diff --git a/packages/apps/dashboard/client/src/shared/ui/AbbreviateClipboard/index.tsx b/packages/apps/dashboard/client/src/shared/ui/AbbreviateClipboard/index.tsx index 83c1e14638..5c665fb461 100644 --- a/packages/apps/dashboard/client/src/shared/ui/AbbreviateClipboard/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/AbbreviateClipboard/index.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; -import { Link } from '@mui/material'; import IconButton from '@mui/material/IconButton'; +import Link from '@mui/material/Link'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import { useNavigate } from 'react-router-dom'; @@ -57,6 +57,7 @@ const AbbreviateClipboard = ({ value, link }: AbbreviateClipboardProps) => { )} { navigator.clipboard.writeText(value); setTooltipOpen(true); diff --git a/packages/apps/dashboard/client/src/shared/ui/Breadcrumbs/index.tsx b/packages/apps/dashboard/client/src/shared/ui/Breadcrumbs/index.tsx index 2858ae7b4d..53a22f2412 100644 --- a/packages/apps/dashboard/client/src/shared/ui/Breadcrumbs/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/Breadcrumbs/index.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; import Box from '@mui/material/Box'; diff --git a/packages/apps/dashboard/client/src/shared/ui/CustomTooltip/index.tsx b/packages/apps/dashboard/client/src/shared/ui/CustomTooltip/index.tsx index 4002edbb51..f3e59903f6 100644 --- a/packages/apps/dashboard/client/src/shared/ui/CustomTooltip/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/CustomTooltip/index.tsx @@ -1,4 +1,4 @@ -import { Tooltip, TooltipProps } from '@mui/material'; +import Tooltip, { type TooltipProps } from '@mui/material/Tooltip'; const CustomTooltip = (props: TooltipProps) => { return ; diff --git a/packages/apps/dashboard/client/src/shared/ui/DatePicker/index.tsx b/packages/apps/dashboard/client/src/shared/ui/DatePicker/index.tsx index 1ec5ff700f..92c6743952 100644 --- a/packages/apps/dashboard/client/src/shared/ui/DatePicker/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/DatePicker/index.tsx @@ -1,14 +1,14 @@ -import { Dispatch, SetStateAction, useState } from 'react'; +import { type Dispatch, type SetStateAction, useState } from 'react'; import Typography from '@mui/material/Typography'; import { - DatePickerProps, + type DatePickerProps, LocalizationProvider, - UseDateFieldProps, + type UseDateFieldProps, } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { DatePicker as DatePickerMui } from '@mui/x-date-pickers/DatePicker'; -import { +import type { BaseSingleInputFieldProps, DateValidationError, FieldSection, diff --git a/packages/apps/dashboard/client/src/shared/ui/EntityIcon/index.tsx b/packages/apps/dashboard/client/src/shared/ui/EntityIcon/index.tsx index 2ae1ceb6a0..868933cbeb 100644 --- a/packages/apps/dashboard/client/src/shared/ui/EntityIcon/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/EntityIcon/index.tsx @@ -1,4 +1,4 @@ -import { Role } from '@human-protocol/sdk'; +import { Role } from '@human-protocol/sdk/src/constants'; import ExchangeOracleIcon from '@/shared/ui/icons/ExchangeOracleIcon'; import HumanIcon from '@/shared/ui/icons/HumanIcon'; diff --git a/packages/apps/dashboard/client/src/shared/ui/FormattedNumber/index.tsx b/packages/apps/dashboard/client/src/shared/ui/FormattedNumber/index.tsx index 43f4a848dd..2adf29fd5d 100644 --- a/packages/apps/dashboard/client/src/shared/ui/FormattedNumber/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/FormattedNumber/index.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { NumericFormat } from 'react-number-format'; diff --git a/packages/apps/dashboard/client/src/shared/ui/NetworkIcon/index.tsx b/packages/apps/dashboard/client/src/shared/ui/NetworkIcon/index.tsx index 5126ad866e..ec953056ea 100644 --- a/packages/apps/dashboard/client/src/shared/ui/NetworkIcon/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/NetworkIcon/index.tsx @@ -1,4 +1,4 @@ -import { ChainId } from '@human-protocol/sdk'; +import type { ChainId } from '@human-protocol/sdk/src/enums'; import BinanceSmartChainIcon from '@/shared/ui/icons/BinanceSmartChainIcon'; import EthereumIcon from '@/shared/ui/icons/EthereumIcon'; diff --git a/packages/apps/dashboard/client/src/shared/ui/SearchBar/index.tsx b/packages/apps/dashboard/client/src/shared/ui/SearchBar/index.tsx index 939908955f..c8dcd6c476 100644 --- a/packages/apps/dashboard/client/src/shared/ui/SearchBar/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/SearchBar/index.tsx @@ -1,22 +1,19 @@ -import { FC, useCallback, useEffect, useState } from 'react'; +import { type FC, useCallback, useEffect, useState } from 'react'; import CloseIcon from '@mui/icons-material/Close'; import SearchIcon from '@mui/icons-material/Search'; -import { - InputAdornment, - TextField, - Select as MuiSelect, - SelectChangeEvent, - Grid, - MenuItem, - Box, - CircularProgress, - useTheme, -} from '@mui/material'; +import Box from '@mui/material/Box'; +import CircularProgress from '@mui/material/CircularProgress'; +import Grid from '@mui/material/Grid'; import IconButton from '@mui/material/IconButton'; -import clsx from 'clsx'; -import { useNavigate } from 'react-router-dom'; - +import InputAdornment from '@mui/material/InputAdornment'; +import MenuItem from '@mui/material/MenuItem'; +import MuiSelect, { type SelectChangeEvent } from '@mui/material/Select'; +import useTheme from '@mui/material/styles/useTheme'; +import TextField from '@mui/material/TextField'; +import { useLocation, useNavigate } from 'react-router-dom'; + +import { ROUTES } from '@/app/config/routes'; import useFilteredNetworks from '@/shared/api/useFilteredNetworks'; import { useIsMobile } from '@/shared/hooks/useBreakpoints'; import isValidEvmAddress from '@/shared/lib/isValidEvmAddress'; @@ -34,23 +31,16 @@ import { gridSx, } from './styles'; -type SearchBarProps = { - className?: string; - initialInputValue?: string; -}; - -const SearchBar: FC = ({ - className = '', - initialInputValue = '', -}) => { - const isMobile = useIsMobile(); +const SearchBar: FC = () => { + const [inputValue, setInputValue] = useState(''); + const [error, setError] = useState(''); + const [focus, setFocus] = useState(false); const { filteredNetworks, isLoading } = useFilteredNetworks(); const { address, chainId, setChainId, setAddress } = useGlobalFiltersStore(); const navigate = useNavigate(); - const [inputValue, setInputValue] = useState(initialInputValue); - const [error, setError] = useState(null); - const [focus, setFocus] = useState(false); + const isMobile = useIsMobile(); const theme = useTheme(); + const location = useLocation(); useEffect(() => { setInputValue(address); @@ -77,11 +67,11 @@ const SearchBar: FC = ({ setInputValue(value); if (isValidEvmAddress(value)) { - setError(null); + setError(''); } else if (value.length > 0) { setError('Invalid EVM address. Must start with 0x and be 42 characters.'); } else { - setError(null); + setError(''); } }; @@ -91,7 +81,7 @@ const SearchBar: FC = ({ const handleClearClick = () => { setInputValue(''); - setError(null); + setError(''); }; const handleSubmit = (event: React.FormEvent) => { @@ -99,7 +89,20 @@ const SearchBar: FC = ({ navigateToAddress(); }; - if (isLoading) return ; + if (isLoading) { + const color = + location.pathname === ROUTES.HOME ? 'white.main' : 'primary.main'; + return ( + + + + ); + } const renderEmptyValue = ( @@ -121,7 +124,7 @@ const SearchBar: FC = ({ ); return ( -
+ = ({ ), endAdornment: inputValue && ( - + = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/DarkModeIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/DarkModeIcon.tsx index 28a6d6d5f2..43ab1e5ba5 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/DarkModeIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/DarkModeIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const DarkModeIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/DiscordIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/DiscordIcon.tsx index 459685c6d5..6556f5b50d 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/DiscordIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/DiscordIcon.tsx @@ -1,8 +1,8 @@ -import React from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; -const DiscordIcon: React.FC = (props) => { +const DiscordIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/EscrowAddressIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/EscrowAddressIcon.tsx index fe065f746d..8dea2f7832 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/EscrowAddressIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/EscrowAddressIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const EscrowAddressIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/EthereumIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/EthereumIcon.tsx index 61e39522cf..933282013d 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/EthereumIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/EthereumIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const EthereumIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/ExchangeOracleIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/ExchangeOracleIcon.tsx index f4fd72d70d..aaf2f8bcd0 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/ExchangeOracleIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/ExchangeOracleIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const ExchangeOracleIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/HumanIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/HumanIcon.tsx index 90581b56c1..d535dcb3d2 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/HumanIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/HumanIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const HumanIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/JobLauncherIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/JobLauncherIcon.tsx index 80a004766f..eba393aa89 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/JobLauncherIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/JobLauncherIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const JobLauncherIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/LeaderboardIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/LeaderboardIcon.tsx index 585a217543..6dc2e1e874 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/LeaderboardIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/LeaderboardIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const LeaderboardIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/LightModeIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/LightModeIcon.tsx index 5e8866c7f8..ba6afb627d 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/LightModeIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/LightModeIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const LightModeIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIcon.tsx index ea6291608a..c307d86781 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const LogoBlockIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIconMobile.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIconMobile.tsx index 1fdf5e9d2c..8f1a645479 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIconMobile.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/LogoBlockIconMobile.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const LogoBlockIconMobile: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/PolygonIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/PolygonIcon.tsx index 0eb1c1ef40..d37c41c1b1 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/PolygonIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/PolygonIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const PolygonIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/RecordingOracleIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/RecordingOracleIcon.tsx index a3f305dc62..b972cd92ad 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/RecordingOracleIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/RecordingOracleIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const RecordingOracleIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/ReputationOracleIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/ReputationOracleIcon.tsx index 67639b7fca..651067c91e 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/ReputationOracleIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/ReputationOracleIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const ReputationOracleIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/icons/WalletIcon.tsx b/packages/apps/dashboard/client/src/shared/ui/icons/WalletIcon.tsx index d8f159c4fa..37dc85f7e0 100644 --- a/packages/apps/dashboard/client/src/shared/ui/icons/WalletIcon.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/icons/WalletIcon.tsx @@ -1,6 +1,6 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; +import SvgIcon, { type SvgIconProps } from '@mui/material/SvgIcon'; const WalletIcon: FC = (props) => { return ( diff --git a/packages/apps/dashboard/client/src/shared/ui/theme/index.tsx b/packages/apps/dashboard/client/src/shared/ui/theme/index.tsx index 56307ab400..d010336abe 100644 --- a/packages/apps/dashboard/client/src/shared/ui/theme/index.tsx +++ b/packages/apps/dashboard/client/src/shared/ui/theme/index.tsx @@ -1,11 +1,11 @@ -import { CSSProperties } from 'react'; +import type { CSSProperties } from 'react'; -import { Shadows } from '@mui/material'; -import { createTheme } from '@mui/material/styles'; -import { +import type { PaletteColorOptions, PaletteColor, } from '@mui/material/styles/createPalette'; +import createTheme from '@mui/material/styles/createTheme'; +import type { Shadows } from '@mui/material/styles/shadows'; import { lightPalette, darkPalette } from './palette'; diff --git a/packages/apps/dashboard/client/src/widgets/footer/ui/Footer.tsx b/packages/apps/dashboard/client/src/widgets/footer/ui/Footer.tsx index 1695d72ed0..6eae04234f 100644 --- a/packages/apps/dashboard/client/src/widgets/footer/ui/Footer.tsx +++ b/packages/apps/dashboard/client/src/widgets/footer/ui/Footer.tsx @@ -1,12 +1,13 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import GitHubIcon from '@mui/icons-material/GitHub'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; import TelegramIcon from '@mui/icons-material/Telegram'; import TwitterIcon from '@mui/icons-material/Twitter'; -import { IconButton, styled } from '@mui/material'; import Box from '@mui/material/Box'; +import IconButton from '@mui/material/IconButton'; import Link from '@mui/material/Link'; +import styled from '@mui/material/styles/styled'; import Typography from '@mui/material/Typography'; import { env } from '@/shared/config/env'; diff --git a/packages/apps/dashboard/client/src/widgets/header/ui/Header.tsx b/packages/apps/dashboard/client/src/widgets/header/ui/Header.tsx index 8b2703c8e4..d3ca5743c7 100644 --- a/packages/apps/dashboard/client/src/widgets/header/ui/Header.tsx +++ b/packages/apps/dashboard/client/src/widgets/header/ui/Header.tsx @@ -1,13 +1,13 @@ -import { FC, useState } from 'react'; +import { type FC, useState } from 'react'; import CloseIcon from '@mui/icons-material/Close'; import MenuIcon from '@mui/icons-material/Menu'; -import { Link as MuiLink } from '@mui/material'; import AppBar from '@mui/material/AppBar'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Drawer from '@mui/material/Drawer'; import IconButton from '@mui/material/IconButton'; +import MuiLink from '@mui/material/Link'; import styled from '@mui/material/styles/styled'; import Toolbar from '@mui/material/Toolbar'; import { Link } from 'react-router-dom'; @@ -53,7 +53,7 @@ const Header: FC = () => { height: { xs: 62, md: 82 }, }} > - + diff --git a/packages/apps/dashboard/client/src/widgets/header/ui/ThemeModeSwitch.tsx b/packages/apps/dashboard/client/src/widgets/header/ui/ThemeModeSwitch.tsx index 7be9bd599c..0ac478ac59 100644 --- a/packages/apps/dashboard/client/src/widgets/header/ui/ThemeModeSwitch.tsx +++ b/packages/apps/dashboard/client/src/widgets/header/ui/ThemeModeSwitch.tsx @@ -1,6 +1,7 @@ -import { FC } from 'react'; +import type { FC } from 'react'; -import { IconButton, useTheme } from '@mui/material'; +import IconButton from '@mui/material/IconButton'; +import useTheme from '@mui/material/styles/useTheme'; import DarkModeIcon from '@/shared/ui/icons/DarkModeIcon'; import LightModeIcon from '@/shared/ui/icons/LightModeIcon'; diff --git a/packages/apps/dashboard/client/src/widgets/page-wrapper/ui/PageWrapper.tsx b/packages/apps/dashboard/client/src/widgets/page-wrapper/ui/PageWrapper.tsx index e4096036c4..8ecc2a85d1 100644 --- a/packages/apps/dashboard/client/src/widgets/page-wrapper/ui/PageWrapper.tsx +++ b/packages/apps/dashboard/client/src/widgets/page-wrapper/ui/PageWrapper.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren } from 'react'; import clsx from 'clsx'; diff --git a/packages/apps/dashboard/client/vite.config.ts b/packages/apps/dashboard/client/vite.config.ts index 1d90c510e5..ad7d6b888e 100644 --- a/packages/apps/dashboard/client/vite.config.ts +++ b/packages/apps/dashboard/client/vite.config.ts @@ -24,6 +24,14 @@ export default defineConfig({ commonjsOptions: { include: [/core/, /human-protocol-sdk/, /node_modules/], }, + minify: 'terser', + terserOptions: { + compress: { + drop_debugger: true, + unused: true, + dead_code: true, + }, + }, }, server: { port: 3004,