From e5f26f4b1f39abf0cc7ba85be34046e9ac5ea815 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Mon, 15 Jun 2026 21:24:25 +0700 Subject: [PATCH] Revert "fix: resolve Zod compatibility issues for clean build" This reverts commit be47816c6447e5f620287275e670cc32eac02bb5. Co-authored-by: shakespeare.diy --- package.json | 3 +- src/components/AppProvider.tsx | 4 +- src/src/App.test.tsx | 8 + src/src/App.tsx | 79 + src/src/AppRouter.tsx | 95 + src/src/components/AddPhotoToSpot.tsx | 234 ++ src/src/components/AddTagsToSpot.tsx | 181 ++ src/src/components/AddToCollectionDialog.tsx | 267 ++ src/src/components/AppProvider.tsx | 149 ++ src/src/components/BackupReminder.tsx | 144 ++ src/src/components/CameraCapture.tsx | 313 +++ src/src/components/EditProfileForm.tsx | 373 +++ src/src/components/ErrorBoundary.tsx | 113 + src/src/components/EventCard.tsx | 308 +++ src/src/components/FollowListManager.tsx | 276 ++ src/src/components/FounderFollow.tsx | 320 +++ src/src/components/GearSwapItemCard.tsx | 296 +++ src/src/components/LanguageToggle.tsx | 122 + src/src/components/Layout.tsx | 769 ++++++ src/src/components/MarketplaceItemCard.tsx | 564 +++++ src/src/components/MyDataTab.tsx | 792 ++++++ src/src/components/NostrProvider.tsx | 113 + src/src/components/NostrSync.tsx | 251 ++ src/src/components/NoteContent.test.tsx | 136 + src/src/components/NoteContent.tsx | 137 + src/src/components/OfflineIndicator.tsx | 115 + src/src/components/PWAInstallPrompt.tsx | 351 +++ src/src/components/QualityMeter.tsx | 231 ++ src/src/components/RelatrSettings.tsx | 288 +++ src/src/components/RelayListManager.tsx | 365 +++ src/src/components/ReportDialog.tsx | 314 +++ src/src/components/SasquatchGuide.tsx | 451 ++++ src/src/components/ScrollToTop.tsx | 12 + src/src/components/SecuritySettings.tsx | 330 +++ src/src/components/SetStatusDialog.tsx | 360 +++ src/src/components/ShopBountyCard.tsx | 192 ++ src/src/components/SortDropdown.tsx | 148 ++ src/src/components/SpamFeePayment.tsx | 320 +++ src/src/components/SponsorSlot.tsx | 160 ++ src/src/components/SpotCard.tsx | 245 ++ src/src/components/SpotMap.tsx | 1099 ++++++++ src/src/components/SpotOwnership.tsx | 355 +++ src/src/components/SpotPicker.tsx | 198 ++ src/src/components/TagInput.tsx | 195 ++ src/src/components/ThemeToggle.tsx | 19 + src/src/components/TourCard.tsx | 452 ++++ src/src/components/TrustBadge.tsx | 78 + src/src/components/TrustFilter.tsx | 161 ++ src/src/components/UserStatusIndicator.tsx | 94 + src/src/components/WalletModal.tsx | 404 +++ src/src/components/WeatherToggle.tsx | 36 + src/src/components/WhosSkating.tsx | 138 + src/src/components/ZapButton.tsx | 58 + src/src/components/ZapDialog.tsx | 700 ++++++ src/src/components/auth/AccountSwitcher.tsx | 107 + .../components/auth/AmberCallbackHandler.tsx | 229 ++ src/src/components/auth/LoginArea.tsx | 116 + src/src/components/auth/LoginDialog.tsx | 501 ++++ .../components/auth/MnemonicSignupDialog.tsx | 453 ++++ src/src/components/auth/SignupDialog.tsx | 845 +++++++ .../components/auth/SignupMethodDialog.tsx | 141 ++ src/src/components/comments/Comment.tsx | 174 ++ src/src/components/comments/CommentForm.tsx | 90 + .../components/comments/CommentsSection.tsx | 100 + .../components/onboarding/RelayEducation.tsx | 307 +++ src/src/components/ui/accordion.tsx | 56 + src/src/components/ui/alert-dialog.tsx | 139 ++ src/src/components/ui/alert.tsx | 59 + src/src/components/ui/aspect-ratio.tsx | 5 + src/src/components/ui/avatar.tsx | 48 + src/src/components/ui/badge-variants.ts | 21 + src/src/components/ui/badge.tsx | 17 + src/src/components/ui/breadcrumb.tsx | 115 + src/src/components/ui/button-variants.ts | 30 + src/src/components/ui/button.tsx | 28 + src/src/components/ui/calendar.tsx | 64 + src/src/components/ui/card.tsx | 79 + src/src/components/ui/carousel.tsx | 260 ++ src/src/components/ui/chart.tsx | 363 +++ src/src/components/ui/checkbox.tsx | 28 + src/src/components/ui/collapsible.tsx | 9 + src/src/components/ui/command.tsx | 153 ++ src/src/components/ui/context-menu.tsx | 198 ++ src/src/components/ui/dialog.tsx | 120 + src/src/components/ui/drawer.tsx | 116 + src/src/components/ui/dropdown-menu.tsx | 198 ++ src/src/components/ui/form-utils.ts | 48 + src/src/components/ui/form.tsx | 133 + src/src/components/ui/hover-card.tsx | 27 + src/src/components/ui/input-otp.tsx | 69 + src/src/components/ui/input.tsx | 22 + src/src/components/ui/label.tsx | 24 + src/src/components/ui/menubar.tsx | 234 ++ .../components/ui/navigation-menu-variants.ts | 5 + src/src/components/ui/navigation-menu.tsx | 123 + src/src/components/ui/pagination.tsx | 118 + src/src/components/ui/popover.tsx | 29 + src/src/components/ui/progress.tsx | 26 + src/src/components/ui/radio-group.tsx | 42 + src/src/components/ui/resizable.tsx | 43 + src/src/components/ui/scroll-area.tsx | 46 + src/src/components/ui/select.tsx | 158 ++ src/src/components/ui/separator.tsx | 29 + src/src/components/ui/sheet.tsx | 131 + src/src/components/ui/sidebar-utils.ts | 52 + src/src/components/ui/sidebar.tsx | 724 ++++++ src/src/components/ui/skeleton.tsx | 15 + src/src/components/ui/slider.tsx | 26 + src/src/components/ui/switch.tsx | 27 + src/src/components/ui/table.tsx | 117 + src/src/components/ui/tabs.tsx | 53 + src/src/components/ui/textarea.tsx | 23 + src/src/components/ui/toast.tsx | 127 + src/src/components/ui/toaster.tsx | 33 + src/src/components/ui/toggle-group.tsx | 59 + src/src/components/ui/toggle-variants.ts | 23 + src/src/components/ui/toggle.tsx | 22 + src/src/components/ui/tooltip.tsx | 28 + src/src/components/wallet/CashuWallet.tsx | 644 +++++ src/src/components/wallet/CashuWalletCard.tsx | 690 +++++ .../wallet/LightningPrivacyTips.tsx | 226 ++ .../components/wallet/MintPrivacyManager.tsx | 486 ++++ src/src/components/wallet/QRScannerModal.tsx | 145 ++ .../wallet/WalletComparisonGuide.tsx | 188 ++ src/src/contexts/AppContext.ts | 32 + src/src/contexts/LanguageContext.tsx | 143 ++ src/src/contexts/NWCContext.tsx | 8 + src/src/hooks/&1 | 0 src/src/hooks/useAppContext.ts | 14 + src/src/hooks/useAuthor.ts | 64 + src/src/hooks/useBTCMap.ts | 139 ++ src/src/hooks/useBatchTrustScores.ts | 123 + src/src/hooks/useBtcMapPlaces.ts | 78 + src/src/hooks/useCoaches.ts | 118 + src/src/hooks/useComments.ts | 98 + src/src/hooks/useCurrentUser.ts | 59 + src/src/hooks/useDirectMessages.ts | 721 ++++++ src/src/hooks/useExchangeRate.ts | 41 + src/src/hooks/useFollowList.ts | 29 + src/src/hooks/useFollowing.ts | 247 ++ src/src/hooks/useFoodSpots.ts | 107 + src/src/hooks/useIsMobile.tsx | 19 + src/src/hooks/useLabProfiles.ts | 104 + src/src/hooks/useLightningAddress.ts | 38 + src/src/hooks/useListingReports.ts | 192 ++ src/src/hooks/useListingRestrictions.ts | 270 ++ src/src/hooks/useLocalStorage.ts | 54 + src/src/hooks/useLoggedInAccounts.ts | 91 + src/src/hooks/useLoginActions.ts | 69 + src/src/hooks/useMarketplace.ts | 87 + src/src/hooks/useNWC.ts | 221 ++ src/src/hooks/useNWCContext.ts | 15 + src/src/hooks/useNoGoodRadio.ts | 41 + src/src/hooks/useNostr.ts | 6 + src/src/hooks/useNostrPublish.ts | 119 + src/src/hooks/useNutzap.ts | 334 +++ src/src/hooks/useOfflineCache.ts | 249 ++ src/src/hooks/usePostComment.ts | 92 + src/src/hooks/useQRCodeScanner.ts | 175 ++ src/src/hooks/useRelatrScore.ts | 243 ++ src/src/hooks/useSasquatchGuide.ts | 195 ++ src/src/hooks/useSellerInfo.ts | 161 ++ src/src/hooks/useSellerSales.ts | 149 ++ src/src/hooks/useShops.ts | 214 ++ src/src/hooks/useSkateEvents.ts | 105 + src/src/hooks/useSkateRelays.ts | 140 ++ src/src/hooks/useSkateShops.ts | 71 + src/src/hooks/useSkateSpots.ts | 154 ++ src/src/hooks/useSpotCollections.ts | 372 +++ src/src/hooks/useSpotContributions.ts | 175 ++ src/src/hooks/useSpotServices.ts | 69 + src/src/hooks/useSpotWeather.ts | 111 + src/src/hooks/useStash.ts | 271 ++ src/src/hooks/useTheme.ts | 20 + src/src/hooks/useToast.ts | 182 ++ src/src/hooks/useTours.ts | 123 + src/src/hooks/useTrustScore.ts | 143 ++ src/src/hooks/useUploadFile.ts | 26 + src/src/hooks/useUserStatus.ts | 293 +++ src/src/hooks/useWallet.ts | 41 + src/src/hooks/useZaps.ts | 350 +++ src/src/hooks/wallet/useCashu.ts | 251 ++ src/src/hooks/wallet/useHistoryManager.ts | 106 + .../hooks/wallet/useLightningOperations.ts | 156 ++ src/src/hooks/wallet/useMintManager.ts | 187 ++ src/src/hooks/wallet/useTokenOperations.ts | 167 ++ src/src/i18n/en.ts | 799 ++++++ src/src/i18n/es.ts | 800 ++++++ src/src/index.css | 385 +++ src/src/lib/amber.ts | 495 ++++ src/src/lib/exchangeRateService.ts | 140 ++ src/src/lib/genUserName.test.ts | 33 + src/src/lib/genUserName.ts | 34 + src/src/lib/lightningAddress.ts | 162 ++ src/src/lib/nip06.test.ts | 173 ++ src/src/lib/nip06.ts | 107 + src/src/lib/offlineCache.ts | 301 +++ src/src/lib/polyfills.ts | 90 + src/src/lib/relatr.ts | 188 ++ src/src/lib/skateTags.ts | 424 ++++ src/src/lib/skateboardRating.ts | 144 ++ src/src/lib/types.ts | 1238 +++++++++ src/src/lib/utils.ts | 6 + src/src/lib/wallet/qrCodeGenerator.ts | 25 + src/src/lib/weather.ts | 347 +++ src/src/main.tsx | 47 + src/src/pages/AboutPage.tsx | 263 ++ src/src/pages/BecomeCoachPage.tsx | 438 ++++ src/src/pages/BecomeFilmerPage.tsx | 474 ++++ src/src/pages/BountyLeaderboardPage.tsx | 483 ++++ src/src/pages/CoachDetailPage.tsx | 287 +++ src/src/pages/CollectionDetailPage.tsx | 401 +++ src/src/pages/CommunityStatsPage.tsx | 520 ++++ src/src/pages/ConversationPage.tsx | 288 +++ src/src/pages/CreateEventPage.tsx | 889 +++++++ src/src/pages/CreateListingPage.tsx | 1086 ++++++++ src/src/pages/CreateShopPage.tsx | 509 ++++ src/src/pages/CreateSpotPage.tsx | 645 +++++ src/src/pages/CreateTourPage.tsx | 2215 +++++++++++++++++ src/src/pages/DirectMessagesPage.tsx | 326 +++ src/src/pages/EditEventPage.tsx | 572 +++++ src/src/pages/EditShopPage.tsx | 564 +++++ src/src/pages/EditSpotPage.tsx | 641 +++++ src/src/pages/EventDetailPage.tsx | 368 +++ src/src/pages/EventsPage.tsx | 613 +++++ src/src/pages/FAQPage.tsx | 302 +++ src/src/pages/FoodPage.tsx | 280 +++ src/src/pages/GearSwapPage.tsx | 444 ++++ src/src/pages/Index.tsx | 585 +++++ src/src/pages/LabPage.tsx | 407 +++ src/src/pages/MapPage.tsx | 1170 +++++++++ src/src/pages/MarketplacePage.tsx | 218 ++ src/src/pages/NIP19Page.tsx | 378 +++ src/src/pages/NotFound.tsx | 33 + src/src/pages/OnboardingPage.tsx | 618 +++++ src/src/pages/PyramidPage.tsx | 204 ++ src/src/pages/SettingsPage.tsx | 634 +++++ src/src/pages/ShopDetailPage.tsx | 485 ++++ src/src/pages/SignersPage.tsx | 376 +++ src/src/pages/SpotCollectionsPage.tsx | 500 ++++ src/src/pages/SpotDetailPage.tsx | 961 +++++++ src/src/pages/StashPage.tsx | 1656 ++++++++++++ src/src/pages/TourDetailPage.tsx | 373 +++ src/src/pages/WalletPage.tsx | 355 +++ src/src/test/ErrorBoundary.test.tsx | 60 + src/src/test/TestApp.tsx | 56 + src/src/test/setup.ts | 40 + src/src/vite-env.d.ts | 8 + 248 files changed, 60432 insertions(+), 3 deletions(-) create mode 100644 src/src/App.test.tsx create mode 100644 src/src/App.tsx create mode 100644 src/src/AppRouter.tsx create mode 100644 src/src/components/AddPhotoToSpot.tsx create mode 100644 src/src/components/AddTagsToSpot.tsx create mode 100644 src/src/components/AddToCollectionDialog.tsx create mode 100644 src/src/components/AppProvider.tsx create mode 100644 src/src/components/BackupReminder.tsx create mode 100644 src/src/components/CameraCapture.tsx create mode 100644 src/src/components/EditProfileForm.tsx create mode 100644 src/src/components/ErrorBoundary.tsx create mode 100644 src/src/components/EventCard.tsx create mode 100644 src/src/components/FollowListManager.tsx create mode 100644 src/src/components/FounderFollow.tsx create mode 100644 src/src/components/GearSwapItemCard.tsx create mode 100644 src/src/components/LanguageToggle.tsx create mode 100644 src/src/components/Layout.tsx create mode 100644 src/src/components/MarketplaceItemCard.tsx create mode 100644 src/src/components/MyDataTab.tsx create mode 100644 src/src/components/NostrProvider.tsx create mode 100644 src/src/components/NostrSync.tsx create mode 100644 src/src/components/NoteContent.test.tsx create mode 100644 src/src/components/NoteContent.tsx create mode 100644 src/src/components/OfflineIndicator.tsx create mode 100644 src/src/components/PWAInstallPrompt.tsx create mode 100644 src/src/components/QualityMeter.tsx create mode 100644 src/src/components/RelatrSettings.tsx create mode 100644 src/src/components/RelayListManager.tsx create mode 100644 src/src/components/ReportDialog.tsx create mode 100644 src/src/components/SasquatchGuide.tsx create mode 100644 src/src/components/ScrollToTop.tsx create mode 100644 src/src/components/SecuritySettings.tsx create mode 100644 src/src/components/SetStatusDialog.tsx create mode 100644 src/src/components/ShopBountyCard.tsx create mode 100644 src/src/components/SortDropdown.tsx create mode 100644 src/src/components/SpamFeePayment.tsx create mode 100644 src/src/components/SponsorSlot.tsx create mode 100644 src/src/components/SpotCard.tsx create mode 100644 src/src/components/SpotMap.tsx create mode 100644 src/src/components/SpotOwnership.tsx create mode 100644 src/src/components/SpotPicker.tsx create mode 100644 src/src/components/TagInput.tsx create mode 100644 src/src/components/ThemeToggle.tsx create mode 100644 src/src/components/TourCard.tsx create mode 100644 src/src/components/TrustBadge.tsx create mode 100644 src/src/components/TrustFilter.tsx create mode 100644 src/src/components/UserStatusIndicator.tsx create mode 100644 src/src/components/WalletModal.tsx create mode 100644 src/src/components/WeatherToggle.tsx create mode 100644 src/src/components/WhosSkating.tsx create mode 100644 src/src/components/ZapButton.tsx create mode 100644 src/src/components/ZapDialog.tsx create mode 100644 src/src/components/auth/AccountSwitcher.tsx create mode 100644 src/src/components/auth/AmberCallbackHandler.tsx create mode 100644 src/src/components/auth/LoginArea.tsx create mode 100644 src/src/components/auth/LoginDialog.tsx create mode 100644 src/src/components/auth/MnemonicSignupDialog.tsx create mode 100644 src/src/components/auth/SignupDialog.tsx create mode 100644 src/src/components/auth/SignupMethodDialog.tsx create mode 100644 src/src/components/comments/Comment.tsx create mode 100644 src/src/components/comments/CommentForm.tsx create mode 100644 src/src/components/comments/CommentsSection.tsx create mode 100644 src/src/components/onboarding/RelayEducation.tsx create mode 100644 src/src/components/ui/accordion.tsx create mode 100644 src/src/components/ui/alert-dialog.tsx create mode 100644 src/src/components/ui/alert.tsx create mode 100644 src/src/components/ui/aspect-ratio.tsx create mode 100644 src/src/components/ui/avatar.tsx create mode 100644 src/src/components/ui/badge-variants.ts create mode 100644 src/src/components/ui/badge.tsx create mode 100644 src/src/components/ui/breadcrumb.tsx create mode 100644 src/src/components/ui/button-variants.ts create mode 100644 src/src/components/ui/button.tsx create mode 100644 src/src/components/ui/calendar.tsx create mode 100644 src/src/components/ui/card.tsx create mode 100644 src/src/components/ui/carousel.tsx create mode 100644 src/src/components/ui/chart.tsx create mode 100644 src/src/components/ui/checkbox.tsx create mode 100644 src/src/components/ui/collapsible.tsx create mode 100644 src/src/components/ui/command.tsx create mode 100644 src/src/components/ui/context-menu.tsx create mode 100644 src/src/components/ui/dialog.tsx create mode 100644 src/src/components/ui/drawer.tsx create mode 100644 src/src/components/ui/dropdown-menu.tsx create mode 100644 src/src/components/ui/form-utils.ts create mode 100644 src/src/components/ui/form.tsx create mode 100644 src/src/components/ui/hover-card.tsx create mode 100644 src/src/components/ui/input-otp.tsx create mode 100644 src/src/components/ui/input.tsx create mode 100644 src/src/components/ui/label.tsx create mode 100644 src/src/components/ui/menubar.tsx create mode 100644 src/src/components/ui/navigation-menu-variants.ts create mode 100644 src/src/components/ui/navigation-menu.tsx create mode 100644 src/src/components/ui/pagination.tsx create mode 100644 src/src/components/ui/popover.tsx create mode 100644 src/src/components/ui/progress.tsx create mode 100644 src/src/components/ui/radio-group.tsx create mode 100644 src/src/components/ui/resizable.tsx create mode 100644 src/src/components/ui/scroll-area.tsx create mode 100644 src/src/components/ui/select.tsx create mode 100644 src/src/components/ui/separator.tsx create mode 100644 src/src/components/ui/sheet.tsx create mode 100644 src/src/components/ui/sidebar-utils.ts create mode 100644 src/src/components/ui/sidebar.tsx create mode 100644 src/src/components/ui/skeleton.tsx create mode 100644 src/src/components/ui/slider.tsx create mode 100644 src/src/components/ui/switch.tsx create mode 100644 src/src/components/ui/table.tsx create mode 100644 src/src/components/ui/tabs.tsx create mode 100644 src/src/components/ui/textarea.tsx create mode 100644 src/src/components/ui/toast.tsx create mode 100644 src/src/components/ui/toaster.tsx create mode 100644 src/src/components/ui/toggle-group.tsx create mode 100644 src/src/components/ui/toggle-variants.ts create mode 100644 src/src/components/ui/toggle.tsx create mode 100644 src/src/components/ui/tooltip.tsx create mode 100644 src/src/components/wallet/CashuWallet.tsx create mode 100644 src/src/components/wallet/CashuWalletCard.tsx create mode 100644 src/src/components/wallet/LightningPrivacyTips.tsx create mode 100644 src/src/components/wallet/MintPrivacyManager.tsx create mode 100644 src/src/components/wallet/QRScannerModal.tsx create mode 100644 src/src/components/wallet/WalletComparisonGuide.tsx create mode 100644 src/src/contexts/AppContext.ts create mode 100644 src/src/contexts/LanguageContext.tsx create mode 100644 src/src/contexts/NWCContext.tsx create mode 100644 src/src/hooks/&1 create mode 100644 src/src/hooks/useAppContext.ts create mode 100644 src/src/hooks/useAuthor.ts create mode 100644 src/src/hooks/useBTCMap.ts create mode 100644 src/src/hooks/useBatchTrustScores.ts create mode 100644 src/src/hooks/useBtcMapPlaces.ts create mode 100644 src/src/hooks/useCoaches.ts create mode 100644 src/src/hooks/useComments.ts create mode 100644 src/src/hooks/useCurrentUser.ts create mode 100644 src/src/hooks/useDirectMessages.ts create mode 100644 src/src/hooks/useExchangeRate.ts create mode 100644 src/src/hooks/useFollowList.ts create mode 100644 src/src/hooks/useFollowing.ts create mode 100644 src/src/hooks/useFoodSpots.ts create mode 100644 src/src/hooks/useIsMobile.tsx create mode 100644 src/src/hooks/useLabProfiles.ts create mode 100644 src/src/hooks/useLightningAddress.ts create mode 100644 src/src/hooks/useListingReports.ts create mode 100644 src/src/hooks/useListingRestrictions.ts create mode 100644 src/src/hooks/useLocalStorage.ts create mode 100644 src/src/hooks/useLoggedInAccounts.ts create mode 100644 src/src/hooks/useLoginActions.ts create mode 100644 src/src/hooks/useMarketplace.ts create mode 100644 src/src/hooks/useNWC.ts create mode 100644 src/src/hooks/useNWCContext.ts create mode 100644 src/src/hooks/useNoGoodRadio.ts create mode 100644 src/src/hooks/useNostr.ts create mode 100644 src/src/hooks/useNostrPublish.ts create mode 100644 src/src/hooks/useNutzap.ts create mode 100644 src/src/hooks/useOfflineCache.ts create mode 100644 src/src/hooks/usePostComment.ts create mode 100644 src/src/hooks/useQRCodeScanner.ts create mode 100644 src/src/hooks/useRelatrScore.ts create mode 100644 src/src/hooks/useSasquatchGuide.ts create mode 100644 src/src/hooks/useSellerInfo.ts create mode 100644 src/src/hooks/useSellerSales.ts create mode 100644 src/src/hooks/useShops.ts create mode 100644 src/src/hooks/useSkateEvents.ts create mode 100644 src/src/hooks/useSkateRelays.ts create mode 100644 src/src/hooks/useSkateShops.ts create mode 100644 src/src/hooks/useSkateSpots.ts create mode 100644 src/src/hooks/useSpotCollections.ts create mode 100644 src/src/hooks/useSpotContributions.ts create mode 100644 src/src/hooks/useSpotServices.ts create mode 100644 src/src/hooks/useSpotWeather.ts create mode 100644 src/src/hooks/useStash.ts create mode 100644 src/src/hooks/useTheme.ts create mode 100644 src/src/hooks/useToast.ts create mode 100644 src/src/hooks/useTours.ts create mode 100644 src/src/hooks/useTrustScore.ts create mode 100644 src/src/hooks/useUploadFile.ts create mode 100644 src/src/hooks/useUserStatus.ts create mode 100644 src/src/hooks/useWallet.ts create mode 100644 src/src/hooks/useZaps.ts create mode 100644 src/src/hooks/wallet/useCashu.ts create mode 100644 src/src/hooks/wallet/useHistoryManager.ts create mode 100644 src/src/hooks/wallet/useLightningOperations.ts create mode 100644 src/src/hooks/wallet/useMintManager.ts create mode 100644 src/src/hooks/wallet/useTokenOperations.ts create mode 100644 src/src/i18n/en.ts create mode 100644 src/src/i18n/es.ts create mode 100644 src/src/index.css create mode 100644 src/src/lib/amber.ts create mode 100644 src/src/lib/exchangeRateService.ts create mode 100644 src/src/lib/genUserName.test.ts create mode 100644 src/src/lib/genUserName.ts create mode 100644 src/src/lib/lightningAddress.ts create mode 100644 src/src/lib/nip06.test.ts create mode 100644 src/src/lib/nip06.ts create mode 100644 src/src/lib/offlineCache.ts create mode 100644 src/src/lib/polyfills.ts create mode 100644 src/src/lib/relatr.ts create mode 100644 src/src/lib/skateTags.ts create mode 100644 src/src/lib/skateboardRating.ts create mode 100644 src/src/lib/types.ts create mode 100644 src/src/lib/utils.ts create mode 100644 src/src/lib/wallet/qrCodeGenerator.ts create mode 100644 src/src/lib/weather.ts create mode 100644 src/src/main.tsx create mode 100644 src/src/pages/AboutPage.tsx create mode 100644 src/src/pages/BecomeCoachPage.tsx create mode 100644 src/src/pages/BecomeFilmerPage.tsx create mode 100644 src/src/pages/BountyLeaderboardPage.tsx create mode 100644 src/src/pages/CoachDetailPage.tsx create mode 100644 src/src/pages/CollectionDetailPage.tsx create mode 100644 src/src/pages/CommunityStatsPage.tsx create mode 100644 src/src/pages/ConversationPage.tsx create mode 100644 src/src/pages/CreateEventPage.tsx create mode 100644 src/src/pages/CreateListingPage.tsx create mode 100644 src/src/pages/CreateShopPage.tsx create mode 100644 src/src/pages/CreateSpotPage.tsx create mode 100644 src/src/pages/CreateTourPage.tsx create mode 100644 src/src/pages/DirectMessagesPage.tsx create mode 100644 src/src/pages/EditEventPage.tsx create mode 100644 src/src/pages/EditShopPage.tsx create mode 100644 src/src/pages/EditSpotPage.tsx create mode 100644 src/src/pages/EventDetailPage.tsx create mode 100644 src/src/pages/EventsPage.tsx create mode 100644 src/src/pages/FAQPage.tsx create mode 100644 src/src/pages/FoodPage.tsx create mode 100644 src/src/pages/GearSwapPage.tsx create mode 100644 src/src/pages/Index.tsx create mode 100644 src/src/pages/LabPage.tsx create mode 100644 src/src/pages/MapPage.tsx create mode 100644 src/src/pages/MarketplacePage.tsx create mode 100644 src/src/pages/NIP19Page.tsx create mode 100644 src/src/pages/NotFound.tsx create mode 100644 src/src/pages/OnboardingPage.tsx create mode 100644 src/src/pages/PyramidPage.tsx create mode 100644 src/src/pages/SettingsPage.tsx create mode 100644 src/src/pages/ShopDetailPage.tsx create mode 100644 src/src/pages/SignersPage.tsx create mode 100644 src/src/pages/SpotCollectionsPage.tsx create mode 100644 src/src/pages/SpotDetailPage.tsx create mode 100644 src/src/pages/StashPage.tsx create mode 100644 src/src/pages/TourDetailPage.tsx create mode 100644 src/src/pages/WalletPage.tsx create mode 100644 src/src/test/ErrorBoundary.test.tsx create mode 100644 src/src/test/TestApp.tsx create mode 100644 src/src/test/setup.ts create mode 100644 src/src/vite-env.d.ts diff --git a/package.json b/package.json index a8525f2..df5dc4e 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "lucide-react": "^0.462.0", "ngeohash": "^0.6.3", "nostr-tools": "^2.13.0", + "npubcash-sdk": "^0.2.0", "qrcode": "^1.5.4", "react": "^18.3.1", "react-day-picker": "^8.10.1", @@ -84,7 +85,7 @@ "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "vaul": "^0.9.3", - "zod": "^3.23.8" + "zod": "^3.25.71" }, "devDependencies": { "@eslint/js": "^9.9.0", diff --git a/src/components/AppProvider.tsx b/src/components/AppProvider.tsx index ea86a74..2da8a41 100644 --- a/src/components/AppProvider.tsx +++ b/src/components/AppProvider.tsx @@ -14,7 +14,7 @@ interface AppProviderProps { // Zod schema for RelayMetadata validation const RelayMetadataSchema = z.object({ relays: z.array(z.object({ - url: z.string().url(), + url: z.url(), read: z.boolean(), write: z.boolean(), })), @@ -23,7 +23,7 @@ const RelayMetadataSchema = z.object({ // Zod schema for BlossomServerMetadata validation const BlossomServerMetadataSchema = z.object({ - servers: z.array(z.string().url()), + servers: z.array(z.url()), updatedAt: z.number(), }) satisfies z.ZodType; diff --git a/src/src/App.test.tsx b/src/src/App.test.tsx new file mode 100644 index 0000000..bedec00 --- /dev/null +++ b/src/src/App.test.tsx @@ -0,0 +1,8 @@ +import { render } from '@testing-library/react'; +import { test } from 'vitest'; + +import App from './App'; + +test('App', () => { + render(); +}) \ No newline at end of file diff --git a/src/src/App.tsx b/src/src/App.tsx new file mode 100644 index 0000000..76cc557 --- /dev/null +++ b/src/src/App.tsx @@ -0,0 +1,79 @@ +// NOTE: This file should normally not be modified unless you are adding a new provider. +// To add new routes, edit the AppRouter.tsx file. + +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { createHead, UnheadProvider } from '@unhead/react/client'; +import { InferSeoMetaPlugin } from '@unhead/addons'; +import { Suspense } from 'react'; +import NostrProvider from '@/components/NostrProvider'; +import { NostrSync } from '@/components/NostrSync'; +import { Toaster } from "@/components/ui/toaster"; +import { TooltipProvider } from "@/components/ui/tooltip"; +import { NostrLoginProvider } from '@nostrify/react/login'; +import { AppProvider } from '@/components/AppProvider'; +import { NWCProvider } from '@/contexts/NWCContext'; +import { LanguageProvider } from '@/contexts/LanguageContext'; +import { AppConfig } from '@/contexts/AppContext'; +import { PWAInstallPrompt } from '@/components/PWAInstallPrompt'; +import { AmberCallbackHandler } from '@/components/auth/AmberCallbackHandler'; +import AppRouter from './AppRouter'; + +const head = createHead({ + plugins: [ + InferSeoMetaPlugin(), + ], +}); + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + refetchOnWindowFocus: false, + staleTime: 60000, // 1 minute + gcTime: Infinity, + }, + }, +}); + +const defaultConfig: AppConfig = { + theme: "dark", + relayMetadata: { + relays: [ + { url: 'wss://relay.ditto.pub', read: true, write: true }, + { url: 'wss://goskatespots.nostr1.com', read: true, write: true }, + { url: 'wss://wotr.relatr.xyz', read: true, write: true }, + { url: 'wss://purplepag.es', read: true, write: false }, // Profile aggregator - read only + ], + updatedAt: 0, + }, + useSkateRelay: true, // Use community relay by default for skate content +}; + +export function App() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export default App; diff --git a/src/src/AppRouter.tsx b/src/src/AppRouter.tsx new file mode 100644 index 0000000..9ffc49a --- /dev/null +++ b/src/src/AppRouter.tsx @@ -0,0 +1,95 @@ +import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { ScrollToTop } from "./components/ScrollToTop"; + +import Index from "./pages/Index"; +import MapPage from "./pages/MapPage"; +import EventsPage from "./pages/EventsPage"; +import FoodPage from "./pages/FoodPage"; +import WalletPage from "./pages/WalletPage"; +import SettingsPage from "./pages/SettingsPage"; +import CreateSpotPage from "./pages/CreateSpotPage"; +import CreateShopPage from "./pages/CreateShopPage"; +import CreateEventPage from "./pages/CreateEventPage"; +import CreateListingPage from "./pages/CreateListingPage"; +import CreateTourPage from "./pages/CreateTourPage"; +import EditSpotPage from "./pages/EditSpotPage"; +import EditShopPage from "./pages/EditShopPage"; +import EditEventPage from "./pages/EditEventPage"; +import GearSwapPage from "./pages/GearSwapPage"; +import SpotDetailPage from "./pages/SpotDetailPage"; +import ShopDetailPage from "./pages/ShopDetailPage"; +import EventDetailPage from "./pages/EventDetailPage"; +import OnboardingPage from "./pages/OnboardingPage"; +import PyramidPage from "./pages/PyramidPage"; +import LabPage from "./pages/LabPage"; +import BecomeCoachPage from "./pages/BecomeCoachPage"; +import BecomeFilmerPage from "./pages/BecomeFilmerPage"; +import CoachDetailPage from "./pages/CoachDetailPage"; +import TourDetailPage from "./pages/TourDetailPage"; +import AboutPage from "./pages/AboutPage"; +import FAQPage from "./pages/FAQPage"; +import CommunityStatsPage from "./pages/CommunityStatsPage"; +import SpotCollectionsPage from "./pages/SpotCollectionsPage"; +import CollectionDetailPage from "./pages/CollectionDetailPage"; +import DirectMessagesPage from "./pages/DirectMessagesPage"; +import ConversationPage from "./pages/ConversationPage"; +import BountyLeaderboardPage from "./pages/BountyLeaderboardPage"; +import SignersPage from "./pages/SignersPage"; +import StashPage from "./pages/StashPage"; +import { NIP19Page } from "./pages/NIP19Page"; +import NotFound from "./pages/NotFound"; + +export function AppRouter() { + return ( + + + + } /> + } /> + } /> + } /> + {/* Legacy route redirect */} + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + {/* Bounty System */} + } /> + {/* Security & Signers */} + } /> + {/* Stash - Private Inventory */} + } /> + {/* NIP-19 route for npub1, note1, naddr1, nevent1, nprofile1 */} + } /> + {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} + } /> + + + ); +} +export default AppRouter; diff --git a/src/src/components/AddPhotoToSpot.tsx b/src/src/components/AddPhotoToSpot.tsx new file mode 100644 index 0000000..6a3fc70 --- /dev/null +++ b/src/src/components/AddPhotoToSpot.tsx @@ -0,0 +1,234 @@ +import { useState } from 'react'; +import { Camera, Upload, Loader2, X } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { Textarea } from '@/components/ui/textarea'; +import { Card, CardContent } from '@/components/ui/card'; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from '@/components/ui/dialog'; +import { useCurrentUser } from '@/hooks/useCurrentUser'; +import { useNostrPublish } from '@/hooks/useNostrPublish'; +import { useUploadFile } from '@/hooks/useUploadFile'; +import { useToast } from '@/hooks/useToast'; +import { useQueryClient } from '@tanstack/react-query'; +import { PHOTO_CONTRIBUTION_KIND } from '@/hooks/useSpotContributions'; +import { SKATE_SPOT_KIND } from '@/lib/types'; +import { LoginArea } from '@/components/auth/LoginArea'; + +interface AddPhotoToSpotProps { + spotPubkey: string; + spotIdentifier: string; + spotTitle: string; +} + +export function AddPhotoToSpot({ spotPubkey, spotIdentifier, spotTitle }: AddPhotoToSpotProps) { + const { user } = useCurrentUser(); + const { mutateAsync: publishEvent, isPending: isPublishing } = useNostrPublish(); + const { mutateAsync: uploadFile, isPending: isUploading } = useUploadFile(); + const { toast } = useToast(); + const queryClient = useQueryClient(); + + const [open, setOpen] = useState(false); + const [caption, setCaption] = useState(''); + const [uploadedImage, setUploadedImage] = useState<{ url: string; mimeType?: string } | null>(null); + + const spotRef = `${SKATE_SPOT_KIND}:${spotPubkey}:${spotIdentifier}`; + + const handleImageUpload = async (e: React.ChangeEvent) => { + const files = e.target.files; + if (!files || files.length === 0) return; + + try { + const file = files[0]; + const tags = await uploadFile(file); + const url = tags.find(([name]) => name === 'url')?.[1]; + const mimeType = tags.find(([name]) => name === 'm')?.[1]; + + if (url) { + setUploadedImage({ url, mimeType }); + toast({ + title: 'Photo uploaded', + description: 'Add a caption and submit to contribute!', + }); + } + } catch (error) { + toast({ + title: 'Upload failed', + description: error instanceof Error ? error.message : 'Failed to upload photo', + variant: 'destructive', + }); + } + + e.target.value = ''; + }; + + const handleSubmit = async () => { + if (!uploadedImage) { + toast({ + title: 'No photo', + description: 'Please upload a photo first.', + variant: 'destructive', + }); + return; + } + + try { + // Create kind 1063 file metadata event + const eventTags: string[][] = [ + ['url', uploadedImage.url], + ['a', spotRef], + ['alt', `Community photo for ${spotTitle}`], + ]; + + if (uploadedImage.mimeType) { + eventTags.push(['m', uploadedImage.mimeType]); + } + + await publishEvent({ + kind: PHOTO_CONTRIBUTION_KIND, + content: caption.trim(), + tags: eventTags, + }); + + toast({ + title: 'Photo contributed!', + description: 'Your photo has been added to this spot.', + }); + + // Reset and close + setCaption(''); + setUploadedImage(null); + setOpen(false); + + // Invalidate the photos query + queryClient.invalidateQueries({ queryKey: ['spot-photos', spotPubkey, spotIdentifier] }); + } catch (error) { + toast({ + title: 'Failed to contribute', + description: error instanceof Error ? error.message : 'Something went wrong', + variant: 'destructive', + }); + } + }; + + const handleClose = () => { + setOpen(false); + setCaption(''); + setUploadedImage(null); + }; + + return ( + + + + + + + + + Add Photo to Spot + + + Contribute a photo to help others discover this spot. + + + + {!user ? ( +
+

Log in to contribute photos

+ +
+ ) : ( +
+ {/* Photo upload area */} + {uploadedImage ? ( +
+ Uploaded + +
+ ) : ( + + + + + + )} + + {/* Caption */} +
+