From ad9c88a4f56dd9222ace3a41380a2ddc7d3cc24b Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Thu, 16 May 2024 11:23:26 +0500 Subject: [PATCH] chore: merge main --- .env.example | 2 +- .prettierrc | 7 ++++++ package.json | 2 ++ src/App.tsx | 2 +- src/components/AppBar/AppBar.tsx | 12 ++++----- src/components/username.tsx | 14 +++++------ src/controllers/MetadataController.ts | 10 +++----- src/controllers/NostrController.ts | 10 +++----- src/layouts/Main.tsx | 4 +-- src/pages/create/index.tsx | 36 +++++++++++++-------------- src/pages/home/index.tsx | 4 +-- src/pages/landing/LandingPage.tsx | 30 +++++++++++----------- src/pages/login/index.tsx | 19 +++++++------- src/pages/profile/index.tsx | 31 +++++++++++++---------- src/types/errors/DecryptionError.ts | 13 +++++----- src/utils/crypto.ts | 4 +-- src/utils/misc.ts | 8 +++--- 17 files changed, 110 insertions(+), 98 deletions(-) create mode 100644 .prettierrc diff --git a/.env.example b/.env.example index 6b61434..7239454 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -VITE_MOST_POPULAR_RELAYS=wss://relay.damus.io wss://eden.nostr.land wss://nos.lol wss://relay.snort.social wss://relay.current.fyi wss://brb.io wss://nostr.orangepill.dev wss://nostr-pub.wellorder.net wss://nostr.bitcoiner.social wss://nostr.wine wss://nostr.oxtr.dev wss://relay.nostr.bg wss://nostr.mom wss://nostr.fmt.wiz.biz wss://relay.nostr.band wss://nostr-pub.semisol.dev wss://nostr.milou.lol wss://puravida.nostr.land wss://nostr.onsats.org wss://relay.nostr.info wss://offchain.pub wss://relay.orangepill.dev wss://no.str.cr wss://atlas.nostr.land wss://nostr.zebedee.cloud wss://nostr-relay.wlvs.space wss://relay.nostrati.com wss://relay.nostr.com.au wss://nostr.inosta.cc wss://nostr.rocks \ No newline at end of file +VITE_MOST_POPULAR_RELAYS=wss://relay.damus.io wss://eden.nostr.land wss://nos.lol wss://relay.snort.social wss://relay.current.fyi wss://brb.io wss://nostr.orangepill.dev wss://nostr-pub.wellorder.net wss://nostr.wine wss://nostr.oxtr.dev wss://relay.nostr.bg wss://nostr.mom wss://nostr.fmt.wiz.biz wss://relay.nostr.band wss://nostr-pub.semisol.dev wss://nostr.milou.lol wss://puravida.nostr.land wss://nostr.onsats.org wss://relay.nostr.info wss://offchain.pub wss://relay.orangepill.dev wss://no.str.cr wss://atlas.nostr.land wss://nostr.zebedee.cloud wss://nostr-relay.wlvs.space wss://relay.nostrati.com wss://relay.nostr.com.au wss://nostr.inosta.cc wss://nostr.rocks \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..5b429c3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "none", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "endOfLine": "auto" +} diff --git a/package.json b/package.json index 6d1ea04..75a6c85 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "formatter:check": "npx prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", + "formatter:fix": "npx prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "preview": "vite preview" }, "dependencies": { diff --git a/src/App.tsx b/src/App.tsx index 6b2a50d..58f0c71 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -67,7 +67,7 @@ const App = () => { })} { const isAuthenticated = authState?.loggedIn === true return ( - + - Logo navigate('/')} /> + Logo navigate('/')} /> @@ -99,7 +99,7 @@ export const AppBar = () => { onClick={() => { navigate(appPublicRoutes.login) }} - variant='contained' + variant="contained" > Sign in @@ -113,7 +113,7 @@ export const AppBar = () => { handleClick={handleOpenUserMenu} /> { display: { md: 'none' } }} > - {username} + {username} { { return ( user-avatar { }} /> { if (res.status === 'rejected') { - failedPublishes.push( - { - relay: relays[index], - error: res.reason.message - } - ) + failedPublishes.push({ + relay: relays[index], + error: res.reason.message + }) } }) diff --git a/src/layouts/Main.tsx b/src/layouts/Main.tsx index 8d1bd81..b452354 100644 --- a/src/layouts/Main.tsx +++ b/src/layouts/Main.tsx @@ -59,13 +59,13 @@ export const MainLayout = () => { setIsLoading(false) }, [dispatch]) - if (isLoading) return + if (isLoading) return return ( <> - + { if (authUrl) { return (