From ed6b7192672439eab9bd3dd671607d98e0c92aa8 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sat, 16 Dec 2023 20:36:33 -0500 Subject: [PATCH] Run prettier --- .prettierignore | 3 ++- .prettierrc | 3 ++- .vscode/settings.json | 9 ++----- src/app/app.tsx | 2 +- src/components/animation/Fade.tsx | 16 ++++++------ src/components/animation/Spinner.tsx | 8 +++--- src/components/buttons/OutlineButton.tsx | 2 +- src/components/buttons/SolidButton.tsx | 2 +- src/components/errors/ErrorBoundary.tsx | 2 +- src/components/icons/Identicon.tsx | 2 +- src/components/menus/Dropdown.tsx | 4 +-- src/components/nav/Footer.tsx | 2 +- src/config/chains.ts | 20 +++++++------- src/features/staking/hooks.ts | 1 + src/features/wallet/WalletDropdown.tsx | 4 +-- src/global.d.ts | 2 +- src/index.d.ts | 2 +- src/styles/globals.css | 4 +-- src/utils/debounce.ts | 16 ++++++------ src/utils/logger.ts | 2 +- src/utils/objects.ts | 33 ++++++++++-------------- src/utils/ssr.ts | 10 +++---- src/utils/strings.ts | 4 +-- 23 files changed, 71 insertions(+), 82 deletions(-) diff --git a/.prettierignore b/.prettierignore index d70ebaa..820b345 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -public \ No newline at end of file +public +src/vendor \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 337274c..2cd7cd3 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,5 +6,6 @@ "plugins": [ "prettier-plugin-organize-imports", "prettier-plugin-tailwindcss" - ] + ], + "tailwindFunctions": ["clsx"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 3ac1da9..8ffeb0a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,14 +16,14 @@ "[typescript]": { "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescriptreact]": { "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "editor.defaultFormatter": "esbenp.prettier-vscode" }, @@ -38,11 +38,6 @@ }, "editor.tabSize": 2, "editor.detectIndentation": false, - "[typescript][typescriptreact]": { - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit" - } - }, "tailwindCSS.experimental.classRegex": [ ["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] ] diff --git a/src/app/app.tsx b/src/app/app.tsx index 7f21813..007d767 100644 --- a/src/app/app.tsx +++ b/src/app/app.tsx @@ -42,7 +42,7 @@ export function App({ children }: PropsWithChildren) { export function BodyLayout({ children }: PropsWithChildren) { return ( -
+
{children}
diff --git a/src/components/animation/Fade.tsx b/src/components/animation/Fade.tsx index 85b5224..8ab859d 100644 --- a/src/components/animation/Fade.tsx +++ b/src/components/animation/Fade.tsx @@ -1,16 +1,16 @@ -import { PropsWithChildren, useEffect, useState } from 'react' +import { PropsWithChildren, useEffect, useState } from 'react'; export function Fade(props: PropsWithChildren<{ show: boolean }>) { - const { show, children } = props - const [render, setRender] = useState(show) + const { show, children } = props; + const [render, setRender] = useState(show); useEffect(() => { - if (show) setRender(true) - }, [show]) + if (show) setRender(true); + }, [show]); const onAnimationEnd = () => { - if (!show) setRender(false) - } + if (!show) setRender(false); + }; return render ? (
) { > {children}
- ) : null + ) : null; } diff --git a/src/components/animation/Spinner.tsx b/src/components/animation/Spinner.tsx index b0b527d..f6b9e89 100644 --- a/src/components/animation/Spinner.tsx +++ b/src/components/animation/Spinner.tsx @@ -1,5 +1,5 @@ -import { memo } from 'react' -import styles from 'src/components/animation/Spinner.module.css' +import { memo } from 'react'; +import styles from 'src/components/animation/Spinner.module.css'; // From https://loading.io/css/ function _Spinner() { @@ -10,7 +10,7 @@ function _Spinner() {
- ) + ); } -export const Spinner = memo(_Spinner) +export const Spinner = memo(_Spinner); diff --git a/src/components/buttons/OutlineButton.tsx b/src/components/buttons/OutlineButton.tsx index 7822a18..4cca92d 100644 --- a/src/components/buttons/OutlineButton.tsx +++ b/src/components/buttons/OutlineButton.tsx @@ -7,7 +7,7 @@ export function OutlineButton({ }: PropsWithChildren>) { return (