From c2e7d24580e142151e20564e8a822ec1f60bbe2d Mon Sep 17 00:00:00 2001 From: Ignacio Date: Fri, 10 Nov 2023 19:00:53 +0800 Subject: [PATCH] chore: cleanup code --- .eslintrc.json | 2 + src/components/arrow/index.tsx | 3 -- src/components/cardSwiper/index.tsx | 1 - .../footer/components/footer_items/index.tsx | 33 --------------- src/recoil/settings/index.ts | 1 - src/recoil/settings/utils.ts | 7 ---- .../blog/components/title_posts/styles.tsx | 1 - .../components/network_info/hooks.tsx | 1 - .../components/network_info/index.tsx | 1 - src/screens/policy/index.tsx | 12 ------ .../components/calculator/config.ts | 6 +++ .../components/calculator/styles.tsx | 5 +-- .../components/calculate_rewards/config.ts | 5 --- .../components/calculate_rewards/utils.ts | 28 ------------- .../components/network_card/useStyles.ts | 3 -- .../components/network_grid/config.ts | 3 -- src/styles/globals.css | 41 ------------------- src/styles/theme/dark.ts | 4 -- src/styles/theme/index.ts | 24 ----------- src/styles/theme/light.ts | 1 - 20 files changed, 9 insertions(+), 173 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7486532a..c98c6def 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,6 +23,8 @@ "jsx-a11y/anchor-is-valid": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/interactive-supports-focus": "off", + "jsx-a11y/control-has-associated-label": "off", + "react/no-unknown-property": "off", "camelcase": "off", "import/prefer-default-export": "off", "import/extensions": [ diff --git a/src/components/arrow/index.tsx b/src/components/arrow/index.tsx index 1bbcfff2..f5f4dd1d 100644 --- a/src/components/arrow/index.tsx +++ b/src/components/arrow/index.tsx @@ -58,9 +58,6 @@ export default function Arraw({ className, sx, direction }: Props) { "& path": { stroke: theme.palette.custom.forbole.blue, }, - // "&:hover circle": { - // fill: "rgba(255, 255, 255,.7)", - // }, }, ...sx, }} diff --git a/src/components/cardSwiper/index.tsx b/src/components/cardSwiper/index.tsx index d1cb5ad5..15464bc3 100644 --- a/src/components/cardSwiper/index.tsx +++ b/src/components/cardSwiper/index.tsx @@ -1,4 +1,3 @@ -// Import Swiper React components import { Box, Stack, useTheme } from "@mui/material"; import Image from "next/image"; import { CSSProperties } from "react"; diff --git a/src/components/footer/components/footer_items/index.tsx b/src/components/footer/components/footer_items/index.tsx index efa7ce0b..3b7e10fe 100644 --- a/src/components/footer/components/footer_items/index.tsx +++ b/src/components/footer/components/footer_items/index.tsx @@ -1,7 +1,6 @@ import { Box, Divider, Typography, useTheme } from "@mui/material"; import useTranslation from "next-translate/useTranslation"; import Link from "next/link"; -import React from "react"; import { FooterProps } from "../../types"; import useStyles from "./useStyles"; @@ -36,12 +35,10 @@ const FooterItems = ({ staking }: FooterProps) => { alignItems: "center", [theme.breakpoints.down("laptop")]: { pt: "12px", - // color: theme.palette.custom.forbole.indigo, gap: "8px", borderTop: `1px solid ${theme.palette.custom.forbole.grey02}`, }, [theme.breakpoints.up("laptop")]: { - // color: theme.palette.primary.main, flexDirection: "row", "& hr": { mx: 2, @@ -108,10 +105,8 @@ const FooterItems = ({ staking }: FooterProps) => { alignItems: "center", [theme.breakpoints.down("laptop")]: { gap: "12px", - // color: theme.palette.custom.forbole.indigo, }, [theme.breakpoints.up("laptop")]: { - // color: theme.palette.primary.main, flexDirection: "row", alignItems: "center", paddingTop: 0, @@ -149,34 +144,6 @@ const FooterItems = ({ staking }: FooterProps) => { {t("blog")} - {/* */} - {/* */} - {/* - {t("careers")} - */} - {/* */} diff --git a/src/recoil/settings/index.ts b/src/recoil/settings/index.ts index 22c276ae..4ec9f751 100644 --- a/src/recoil/settings/index.ts +++ b/src/recoil/settings/index.ts @@ -9,7 +9,6 @@ export { useSettingsRecoil, atomState, writeTheme, - // getThemeTemplate, readTheme, navigationId, }; diff --git a/src/recoil/settings/utils.ts b/src/recoil/settings/utils.ts index d245c092..eb3f24e7 100644 --- a/src/recoil/settings/utils.ts +++ b/src/recoil/settings/utils.ts @@ -12,10 +12,3 @@ export const THEME_DICTIONARY = { light: lightTemplate, dark: darkTemplate, }; - -// export const getThemeTemplate = (theme: keyof Theme) => { -// if (THEME_DICTIONARY[theme]) { -// return THEME_DICTIONARY[theme]; -// } -// return lightTemplate; -// }; diff --git a/src/screens/blog/components/title_posts/styles.tsx b/src/screens/blog/components/title_posts/styles.tsx index e4742a85..807969e8 100644 --- a/src/screens/blog/components/title_posts/styles.tsx +++ b/src/screens/blog/components/title_posts/styles.tsx @@ -13,7 +13,6 @@ export const styles: { [index: string]: SxProps } = { textDecoration: "none", }, [theme.breakpoints.up("laptop")]: { - // padding: 0, padding: theme.spacing(3.75), background: "rgba(255, 255, 255, 0.1)", backdropFilter: "blur(8px)", diff --git a/src/screens/network_guides/components/network_info/hooks.tsx b/src/screens/network_guides/components/network_info/hooks.tsx index 7c7cf728..642e3be0 100644 --- a/src/screens/network_guides/components/network_info/hooks.tsx +++ b/src/screens/network_guides/components/network_info/hooks.tsx @@ -43,7 +43,6 @@ export const useNetworkGuidesHook = () => { ? setCosmosNetworkGuides((prev) => ({ ...prev, [data.metric.instance]: [ - // ...prev[data.metric.instance], { title: "commission", stats: data.commissionRate, diff --git a/src/screens/network_guides/components/network_info/index.tsx b/src/screens/network_guides/components/network_info/index.tsx index 0fa58bf2..c0edeead 100644 --- a/src/screens/network_guides/components/network_info/index.tsx +++ b/src/screens/network_guides/components/network_info/index.tsx @@ -239,7 +239,6 @@ const NetworkInfo = ({ post }: any) => { sx={{ display: "contents", textAlign: "center", - // WebkitLineClamp: readMore ? 10 : 5, WebkitLineClamp: readMore ? "unset" : "inherit", }} > diff --git a/src/screens/policy/index.tsx b/src/screens/policy/index.tsx index 02b70f67..3a578af0 100644 --- a/src/screens/policy/index.tsx +++ b/src/screens/policy/index.tsx @@ -113,17 +113,6 @@ const Policy = () => { > {t("updatedDate")} - {/* - {t('description1', {})} - */} { color: "#000", fontSize: theme.spacing(1.375), fontWeight: 400, - // paddingBottom: theme.spacing(5), }} />, } = { "& .MuiSelect-icon": { margin: theme.spacing(0.5, 2.5, 0, 0), }, - [theme.breakpoints.up("laptop")]: { - // gridColumn: '1 / span 5', - // gridRow: '2 / span 1', - }, + [theme.breakpoints.up("laptop")]: {}, }), input: (theme) => ({ ".MuiOutlinedInput-root": { diff --git a/src/screens/staking/components/calculate_rewards/config.ts b/src/screens/staking/components/calculate_rewards/config.ts index 2d295c87..3d23a8b3 100644 --- a/src/screens/staking/components/calculate_rewards/config.ts +++ b/src/screens/staking/components/calculate_rewards/config.ts @@ -60,13 +60,8 @@ const stakingParams: NetworkProps = { gravity_bridge: baseState, jackal: baseState, terra: baseState, - // nym: baseState, - // omniflix: baseState, stargaze: baseState, teritori: baseState, - // xpla: baseState, - // ununifi: baseState, - // onomy: baseState }; export const getStakingParams = (key: string) => { diff --git a/src/screens/staking/components/calculate_rewards/utils.ts b/src/screens/staking/components/calculate_rewards/utils.ts index ad65083f..64a6f63a 100644 --- a/src/screens/staking/components/calculate_rewards/utils.ts +++ b/src/screens/staking/components/calculate_rewards/utils.ts @@ -110,34 +110,6 @@ vsys.gecko = "https://api.coingecko.com/api/v3/coins/v-systems"; const emoney: any = R.clone(defaultFunctions(uBandToBand)); emoney.gecko = "https://api.coingecko.com/api/v3/coins/iris-network"; -// const iris: any = { -// bonded: (data: any) => { -// return Number(R.pathOr(0, ["bonded_tokens"], data)); -// }, -// inflation: (data: any) => { -// const [inflationData] = data?.filter( -// (x) => x?.type === "irishub/mint/Params" -// ); -// return ( -// toFixed(Number(R.pathOr(0, ["value", "inflation"], inflationData))) ?? 0 -// ); -// }, -// supply: (data: any) => { -// const [supply] = R.pathOr([], ["total_supply"], data).filter( -// (x) => x.denom === "iris-atto" -// ); -// return uIrisToIris(Number(R.pathOr(0, ["amount"], supply))); -// }, -// commissionRate: (data: any) => { -// return Number(R.pathOr(0, ["commission", "rate"], data)); -// }, -// marketPrice: (data: any) => { -// return toFixed( -// Number(R.pathOr(0, ["market_data", "current_price", "usd"], data)) -// ); -// }, -// }; - const iris: any = R.clone(defaultFunctions(uIrisToIris)); iris.gecko = "https://api.coingecko.com/api/v3/coins/iris-network"; diff --git a/src/screens/staking/components/networks/components/network_grid/components/network_card/useStyles.ts b/src/screens/staking/components/networks/components/network_grid/components/network_card/useStyles.ts index e8077adb..777b7a5c 100644 --- a/src/screens/staking/components/networks/components/network_grid/components/network_card/useStyles.ts +++ b/src/screens/staking/components/networks/components/network_grid/components/network_card/useStyles.ts @@ -43,7 +43,6 @@ const useStyles = () => { "0px 8px 22px -6px rgba(2, 38, 225, 0.12), 0px 14px 64px -4px rgba(2, 38, 225, 0.12)", }, "& .networkbox__explore-btn": { - // ...theme.mixins.button: padding: "0.75rem 1rem", borderRadius: "200px", /* Primary Color/BD Red Gradient 02 */ @@ -132,12 +131,10 @@ const useStyles = () => { right: theme.spacing(3), }, "& .MuiTypography-h3": { - // fontSize: theme.typography.h5.fontSize, fontSize: theme.spacing(2), color: theme.palette.custom.forbole.indigo6, }, "& .MuiTypography-h6, & .MuiTypography-body1": { - // fontSize: theme.typography.body2.fontSize, fontSize: theme.spacing(2), color: theme.palette.custom.forbole.indigo6, }, diff --git a/src/screens/staking/components/networks/components/network_grid/config.ts b/src/screens/staking/components/networks/components/network_grid/config.ts index 47b3b55f..faf4fef0 100644 --- a/src/screens/staking/components/networks/components/network_grid/config.ts +++ b/src/screens/staking/components/networks/components/network_grid/config.ts @@ -21,10 +21,7 @@ export const cosmosNetworkParams: NetworkProps = { evmos: { bonded: 0, APY: 0, TVL: 0 }, comdex: { bonded: 0, APY: 0, TVL: 0 }, axelar: { bonded: 0, APY: 0, TVL: 0 }, - // bitcanna: { bonded: 0, APY: 0, TVL: 0 }, cheqd: { bonded: 0, APY: 0, TVL: 0 }, - // chihuahua: { bonded: 0, APY: 0, TVL: 0 }, - // terra_classic: { bonded: 0, APY: 0, TVL: 0 }, persistence: { bonded: 0, APY: 0, TVL: 0 }, crescent: { bonded: 0, APY: 0, TVL: 0 }, picasso: { bonded: 0, APY: 0, TVL: 0 }, diff --git a/src/styles/globals.css b/src/styles/globals.css index ed240719..a17e1b91 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -3,18 +3,10 @@ html { box-sizing: border-box; } -/* @font-face { - font-family: 'Chinese Font'; - src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff"); - unicode-range: U+4E00–9FFF; - letter-spacing: 1rem; -} */ - body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; overflow-x: hidden; line-height: normal; - /* overflow-y: scroll !important; */ } * { @@ -28,39 +20,6 @@ body { box-sizing: border-box; } -/*Carousel组件 */ -/* .swiper-slide.scale { - transition: 300ms; - transform: scale(0.8); - height: auto; -} - -.swiper-slide-active.scale { - transform: scale(1); -} -.scale>.swiper-wrapper{ - align-items: stretch; -} -.c-next.swiper-button-disabled, -.c-prev.swiper-button-disabled { - display: none; -} - -.c-next, -.c-prev { - display: none; -} - -@media screen and (max-width: 768px) { - .c-next, - .c-prev { - display: block; - } -} -/* .v-next.swiper-button-disabled, -.v-prev.swiper-button-disabled { - display: none; -} */ input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, diff --git a/src/styles/theme/dark.ts b/src/styles/theme/dark.ts index b94157f6..25d04e6c 100644 --- a/src/styles/theme/dark.ts +++ b/src/styles/theme/dark.ts @@ -1,9 +1,5 @@ import { PaletteMode } from "@mui/material"; -// const backgroundDefault = '#252345'; -// const backgroundDefault = 'rgba(30, 41, 67, 1)'; -// const backgroundDefault = 'url(/images/assets/image_BG.png)'; -// const backgroundDefault = 'transaprent'; const backgroundDefault = "#171A4B"; /** Custom theme overrides for dark mode */ diff --git a/src/styles/theme/index.ts b/src/styles/theme/index.ts index cb3c05a1..e7b9582d 100644 --- a/src/styles/theme/index.ts +++ b/src/styles/theme/index.ts @@ -4,20 +4,11 @@ import { deepmerge } from "@mui/utils"; import { darkThemeOverride } from "./dark"; import { lightThemeOverride } from "./light"; -// interface CustomPalette extends Palette { -// background: { default: string }; -// } - -// export interface CustomTheme extends Theme { -// palette: CustomPalette; -// } - /** Common themes that don't change across light and dark theme */ export const common: ThemeOptions = { breakpoints: { keys: ["mobile", "tablet", "laptop", "desktop"], values: { - // mobile: 320, mobile: 375, tablet: 768, laptop: 1025, @@ -43,21 +34,6 @@ export const common: ThemeOptions = { }, }, }, - - // components: { - // MuiCssBaseline: { - // styleOverrides: ` - // @font-face { - // font-family: chinese font; - // font-style: normal; - // font-weight: 400; - // src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff"); - // unicodeRange: U+4E00–9FFF; - // letter-spacing: 0.2rem; - // } - // `, - // }, - // }, }; export const lightTemplate: ThemeOptions = deepmerge( diff --git a/src/styles/theme/light.ts b/src/styles/theme/light.ts index 8934ba82..277f6dab 100644 --- a/src/styles/theme/light.ts +++ b/src/styles/theme/light.ts @@ -1,7 +1,6 @@ import { PaletteMode } from "@mui/material"; const backgroundDefault = "#FFFFFF"; -// const backgroundDefault = 'rgba(30, 41, 67, 1)'; /** Custom theme overrides for dark mode */ export const lightThemeOverride = {