From bb1b98c98a153865956f733d9ed6f1703985063b Mon Sep 17 00:00:00 2001 From: Onizuka-wl Date: Mon, 30 Sep 2024 13:50:54 -0300 Subject: [PATCH] chore: modified scripts, linting and format --- package.json | 4 ++-- src/__tests__/utils.test.ts | 1 + src/components/Theme/muiThemeConfig.ts | 1 + src/components/Theme/rainbowTheme.ts | 2 +- src/config/index.ts | 8 ++++---- src/containers/Footer/index.tsx | 2 +- src/containers/Header/index.tsx | 8 ++++---- src/hooks/ScrollToTop.tsx | 2 +- src/hooks/useStateContext.tsx | 1 + src/pages/_app.tsx | 4 +++- src/providers/ThemeProvider.tsx | 3 +-- src/utils/config.ts | 4 ++-- 12 files changed, 22 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 3c1d6f7..371b084 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ "start": "next start -p 3000", "preview": "next start", "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", - "lint:fix": "pnpm run lint -- --fix", + "lint:fix": "pnpm run lint --fix", "prettier": "prettier src --check", - "prettier:fix": "pnpm run prettier -- --write", + "prettier:fix": "pnpm run prettier --write", "format": "pnpm run prettier:fix && yarn run lint:fix", "format:check": "pnpm run prettier && yarn run lint", "prepare": "husky && wonderland-crypto-husky-checks install", diff --git a/src/__tests__/utils.test.ts b/src/__tests__/utils.test.ts index 7ecc33d..82a0e7e 100644 --- a/src/__tests__/utils.test.ts +++ b/src/__tests__/utils.test.ts @@ -1,4 +1,5 @@ import { expect } from '@jest/globals'; + import { truncateAddress } from '../utils/format'; describe('truncateAddress', () => { diff --git a/src/components/Theme/muiThemeConfig.ts b/src/components/Theme/muiThemeConfig.ts index 24c48f6..df96cc9 100644 --- a/src/components/Theme/muiThemeConfig.ts +++ b/src/components/Theme/muiThemeConfig.ts @@ -1,4 +1,5 @@ import { createTheme } from '@mui/material'; + import { Theme, ThemeName } from '~/types'; export const getMuiThemeConfig = (currentTheme: Theme, themeName: ThemeName) => { diff --git a/src/components/Theme/rainbowTheme.ts b/src/components/Theme/rainbowTheme.ts index 0301746..418d6ac 100644 --- a/src/components/Theme/rainbowTheme.ts +++ b/src/components/Theme/rainbowTheme.ts @@ -1,5 +1,5 @@ -import merge from 'lodash.merge'; import { darkTheme, Theme } from '@rainbow-me/rainbowkit'; +import merge from 'lodash.merge'; // Configure your rainbowkit custom theme here. // More info: https://www.rainbowkit.com/docs/custom-theme diff --git a/src/config/index.ts b/src/config/index.ts index 5c3e9fc..de909ac 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,10 +1,10 @@ -import { Config } from '~/types'; +import { createPublicClient, http } from 'viem'; +import { mainnet } from 'viem/chains'; -import { getEnv } from './env'; import { getConstants } from './constants'; +import { getEnv } from './env'; -import { createPublicClient, http } from 'viem'; -import { mainnet } from 'viem/chains'; +import { Config } from '~/types'; // this provider if for load data when the user is disconnected export const publicClient = createPublicClient({ diff --git a/src/containers/Footer/index.tsx b/src/containers/Footer/index.tsx index 6fc8f48..61eca14 100644 --- a/src/containers/Footer/index.tsx +++ b/src/containers/Footer/index.tsx @@ -1,6 +1,6 @@ import { styled } from '@mui/material/styles'; -import { useCustomTheme } from '~/hooks/useTheme'; +import { useCustomTheme } from '~/hooks/useTheme'; import { FOOTER_HEIGHT } from '~/utils'; export const Footer = () => { diff --git a/src/containers/Header/index.tsx b/src/containers/Header/index.tsx index 2caa8a9..7ea2147 100644 --- a/src/containers/Header/index.tsx +++ b/src/containers/Header/index.tsx @@ -1,8 +1,8 @@ -import { ConnectButton } from '@rainbow-me/rainbowkit'; -import { styled } from '@mui/material/styles'; -import { IconButton } from '@mui/material'; -import LightModeIcon from '@mui/icons-material/LightMode'; import DarkModeIcon from '@mui/icons-material/DarkMode'; +import LightModeIcon from '@mui/icons-material/LightMode'; +import { IconButton } from '@mui/material'; +import { styled } from '@mui/material/styles'; +import { ConnectButton } from '@rainbow-me/rainbowkit'; import { useCustomTheme } from '~/hooks/useTheme'; import { zIndex, HEADER_HEIGHT } from '~/utils'; diff --git a/src/hooks/ScrollToTop.tsx b/src/hooks/ScrollToTop.tsx index 1f720d7..36a0ced 100644 --- a/src/hooks/ScrollToTop.tsx +++ b/src/hooks/ScrollToTop.tsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react'; import { useRouter } from 'next/router'; +import { useEffect } from 'react'; export function ScrollToTop() { const router = useRouter(); diff --git a/src/hooks/useStateContext.tsx b/src/hooks/useStateContext.tsx index afdc379..1bd7164 100644 --- a/src/hooks/useStateContext.tsx +++ b/src/hooks/useStateContext.tsx @@ -1,4 +1,5 @@ import { useContext } from 'react'; + import { StateContext } from '~/providers/StateProvider'; export const useStateContext = () => { diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index bc4ba68..c534876 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,7 +1,9 @@ import { AppProps } from 'next/app'; -import { Providers } from '~/providers'; + import Layout from './layout'; +import { Providers } from '~/providers'; + const Home = ({ Component, pageProps }: AppProps) => { return ( diff --git a/src/providers/ThemeProvider.tsx b/src/providers/ThemeProvider.tsx index 8c620ee..6d20695 100644 --- a/src/providers/ThemeProvider.tsx +++ b/src/providers/ThemeProvider.tsx @@ -1,8 +1,7 @@ +import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles'; import { createContext, useEffect, useMemo, useState } from 'react'; -import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles'; import { getMuiThemeConfig } from '~/components'; - import { Theme, ThemeName } from '~/types'; import { THEME_KEY, getTheme } from '~/utils'; diff --git a/src/utils/config.ts b/src/utils/config.ts index 5caddce..7bbd9f0 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,7 +1,7 @@ +import { connectorsForWallets } from '@rainbow-me/rainbowkit'; +import { rainbowWallet, walletConnectWallet, injectedWallet } from '@rainbow-me/rainbowkit/wallets'; import { createConfig, http, cookieStorage, createStorage } from 'wagmi'; import { localhost, sepolia } from 'wagmi/chains'; -import { rainbowWallet, walletConnectWallet, injectedWallet } from '@rainbow-me/rainbowkit/wallets'; -import { connectorsForWallets } from '@rainbow-me/rainbowkit'; import { getConfig } from '../config';