Skip to content
Merged
1 change: 1 addition & 0 deletions packages/apps/dashboard/client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }],
Expand Down
9 changes: 4 additions & 5 deletions packages/apps/dashboard/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<html lang="en">
<head>
<meta charset="UTF-8" />

<meta name="description" content="HUMAN Dashboard App" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="icon"
href="data:image/png;base64,AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAAAAD/AE4A/wAjA/9Ji0n/ibS4/7HO8P+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//ss/w/422tf9MjEn/ACcD/wBOAP8AAAL/Xplj/8HX6P/1+f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9vn//8PY6P9fmWP/AAAC/0mLSf/C2Of//v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////v///8DX5/9Iikr/jLa0//X5/////////////////////////////////////////v///+71///u9f/////////////////////////////////////////////1+f//6fH///v9////////////////////////////////////////9Pj//4i0t/+yzu///////////////////////////////////v7//9Hi//+Esf//PYT//0iL///c6P//////////////////////////////////9fn//26j//8wfP//bqP//7zU///3+v//////////////////////////////////sM3v/73V///////////////////////////////////Z5///Mn3//wZh//8GYf//CGP//6vK///////////////////////////////////e6v//InP//wVg//8GYf//Fmv//6rJ//////////////////////////////////+91f//vdX//////////////////////////////////8Ta//8Wa///CGL//wlj//8IY///ocP//////////////////////////////////9bl//8fcf//CGL//wlj//8HYf//irX//////////////////////////////////73V//+91f//////////////////////////////////0uL//x1w//8IYv//CWP//whi//+Zv///////////////////////////////////z+H//xxv//8IYv//CWP//whj//+cwP//////////////////////////////////vdX//73V///////////////////////////////////f6v//JHT//wdi//8JY///CGL//5K6///////////////////////////////////K3f//GW3//whi//8JY///C2T//6zK//////////////////////////////////+91f//vdX//////////////////////////////////+jw//8wfP//B2L//wlj//8HYv//irX//////////////////////////////////8PZ//8Wa///CGL//whj//8RaP//udP//////////////////////////////////73V//+91f//////////////////////////////////7vX//z2E//8GYf//CWP//wdh//+CsP//////////////////////////////////vtb//xNq//8IY///CGL//xht///I3P//////////////////////////////////vdX//73V///////////////////////////////////2+f//TI7//wVh//8JY///BmH//3qr//////////////////////////////////+30f//EGf//wlj//8IYv//H3H//9bl//////////////////////////////////+91f//vdX///////////////////////////////////z9//9Zlv//BWD//wlj//8GYf//c6b//////////////////////////////////7DN//8NZv//CWP//wdi//8ndv//4u3//////////////////////////////////73V//+91f///////////////////////////////////////2qg//8FYf//CWP//wVh//9knf///f7/////////////////////////////pMX//wpk//8JY///BmH//zR+///q8v//////////////////////////////////vdX//73V////////////////////////////////////////eqv//wZh//8JY///B2L//yR0//+lxv//6/P/////////////9fn//8PZ//9Hi///B2L//wlj//8GYf//QYf///D2//////////////////////////////////+91f//vdX///////////////////////////////////////+dwP//CmT//whj//8JY///CGL//xBn//87g///irX//53B//9Skv//GG3//whi//8JY///CWP//wRg//9emf//+vz//////////////////////////////////73V//+91f///////////////////////////////////////+70//96q///EWj//whj//8JY///CWP//wZh//8JY///CmT//wZh//8IYv//CWP//wlj//8JY///UpL//9Pj////////////////////////////////////////vdX//73V/////////////////////////////////////////////+30//8+hf//BmH//wlj//8JY///CWP//wlj//8IY///CWP//wlj//8JY///CGL//xlt///I3P////////////////////////////////////////////+91f//vdX/////////////////////////////////////////////zd///yl3//8HYv//CWP//wlj//8GYf//C2T//w5m//8GYf//CGP//wlj//8IY///EGf//6DC///+/v///////////////////////////////////////73V//+91f///////////////////////////////////////+ry//9Fif//B2L//wlj//8IY///DWb//z6F//+Xvf//q8r//1ST//8Vav//CGL//wlj//8IYv//IHH//8PZ////////////////////////////////////////vdX//73V////////////////////////////////////////2uj//yBy//8HYv//CGP//xJp//+Mtv//6/L/////////////9Pj//7TP//8reP//B2L//wlj//8IYv//pMX///////////////////////////////////////+91f//vdX////////////////////////////////////////k7v//KXj//wdi//8HYv//MHz//+bw/////////////////////////v///2Oc//8FYP//CWP//w5m//+zz////////////////////////////////////////73V//+91f///////////////////////////////////////+vz//83gf//BmH//wdi//8ve///5/D/////////////////////////////Y5z//wVg//8IYv//FWv//8LY////////////////////////////////////////vdX//73V////////////////////////////////////////8vf//0WJ//8GYf//B2L//yh3///k7v////////////////////////3+//9cmP//BWD//whi//8cb///z+H///////////////////////////////////////+91f//vdX////////////////////////////////////////5+///U5L//wVg//8HYv//JHT//+Dr////////////////////////+vz//1aU//8FYP//B2L//yNz///d6v///////////////////////////////////////73V//+91f////////////////////////////////////////7///9hm///BWD//wdi//8hcv//2ef////////////////////////3+v//T4///wVh//8HYv//LHn//+bv////////////////////////////////////////vdX//73V/////////////////////////////////////////////4Ow//8GYf//BGD//x1v///V5P////////////////////////X5//9KjP//A1///wNf//9Hi///8vf///////////////////////////////////////+91f//sM3v////////////////////////////////////////////5O7//4Sx//8/hf//WJb//+70/////////////////////////v7//4Wy//81f///b6T//8nd/////////////////////////////////////////////7LO7/+ItLf/9Pj//////////////////////////////////////////////v////D1///w9v//////////////////////////////////9vn//+zz///9/v/////////////////////////////////////////////1+f//jba0/0iKSv/A1+f//v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////v///8LY5/9Ji0n/AAAC/1+ZY//D2Oj/9vn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////X5///B2Oj/Xplj/wAAAv8ATgD/ACYD/0yMSP+NtrX/s8/w/73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+91f//vdX//73V//+xzvD/ibS3/0qLSf8AIwP/AE4AgAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAE="
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Roboto:wght@400;500&display=swap" as="style">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HUMAN Dashboard</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/dashboard/client/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react';
import type { FC } from 'react';

import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 0 additions & 4 deletions packages/apps/dashboard/client/src/app/styles/_home-page.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.home-page-search {
margin-top: 24px;
}

.home-page-leaderboard {
margin-top: 60px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HcaptchaDailyStats, 'date'>)[];
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<string> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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)(
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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<typeof reputationSchema>;
import { reputationSchema } from '@/shared/model/reputationSchema';

const leaderboardEntity = z.object({
address: z.string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -59,13 +59,16 @@ const RoleCell: FC<Props> = ({ rank, role, websiteUrl, name }) => {
<EntityIcon role={role} />
<Box display="flex" flexDirection="column" gap={4 / 8}>
<Box display="flex" alignItems="center" gap={12 / 8}>
<Typography variant={isMobile ? 'subtitle2' : 'h6'}>
<Typography variant={isMobile ? 'subtitle2' : 'h6'} component="p">
{formattedName ?? humanReadableRole}
</Typography>
{websiteUrl ? <LaunchIcon fontSize="small" /> : null}
</Box>
{name && role ? (
<Typography variant={isMobile ? 'body3' : 'subtitle2'}>
<Typography
variant={isMobile ? 'body3' : 'subtitle2'}
component="p"
>
{humanReadableRole}
</Typography>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react';
import type { FC } from 'react';

import Typography from '@mui/material/Typography';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -43,6 +43,7 @@ const Clipboard: FC<ClipboardProps> = ({ value }) => {
</Typography>

<IconButton
aria-label="Copy to clipboard"
onClick={() => {
navigator.clipboard.writeText(value);
setTooltipOpen(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FC } from 'react';
import type { FC } from 'react';

import Chip from '@mui/material/Chip';
import Stack from '@mui/material/Stack';
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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Loading
Loading