ffc7672183
Support kind 37381 addressable events for MTG deck sharing per NIP-MG spec. Includes MagicDeckContent component with card list rendering, format/archetype badges, commander/companion display, sideboard, foil indicators, and expand/collapse for large decks. Adds /decks route and sidebar navigation.
117 lines
3.6 KiB
TypeScript
117 lines
3.6 KiB
TypeScript
// 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, useEffect } from 'react';
|
|
import NostrProvider from '@/components/NostrProvider';
|
|
import { NostrSync } from '@/components/NostrSync';
|
|
import { NativeNotifications } from '@/components/NativeNotifications';
|
|
import { InitialSyncGate } from '@/components/InitialSyncGate';
|
|
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 { AppConfig } from '@/contexts/AppContext';
|
|
import AppRouter from './AppRouter';
|
|
import { StatusBar, Style } from '@capacitor/status-bar';
|
|
import { Capacitor } from '@capacitor/core';
|
|
|
|
const head = createHead({
|
|
plugins: [
|
|
InferSeoMetaPlugin(),
|
|
],
|
|
});
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
refetchOnWindowFocus: false,
|
|
staleTime: 60000, // 1 minute
|
|
gcTime: 300000, // 5 minutes
|
|
},
|
|
},
|
|
});
|
|
|
|
const defaultConfig: AppConfig = {
|
|
theme: "dark",
|
|
useAppRelays: true,
|
|
relayMetadata: {
|
|
relays: [],
|
|
updatedAt: 0,
|
|
},
|
|
feedSettings: {
|
|
feedIncludePosts: true,
|
|
feedIncludeReposts: true,
|
|
feedIncludeArticles: false,
|
|
showArticles: false,
|
|
showVines: true,
|
|
showPolls: false,
|
|
showTreasures: false,
|
|
showTreasureGeocaches: true,
|
|
showTreasureFoundLogs: true,
|
|
showColors: false,
|
|
showPacks: true,
|
|
showStreams: true,
|
|
feedIncludeVines: false,
|
|
feedIncludePolls: false,
|
|
feedIncludeTreasureGeocaches: false,
|
|
feedIncludeTreasureFoundLogs: false,
|
|
feedIncludeColors: false,
|
|
feedIncludePacks: false,
|
|
feedIncludeStreams: false,
|
|
showDecks: false,
|
|
feedIncludeDecks: false,
|
|
},
|
|
nip85StatsPubkey: "5f68e85ee174102ca8978eef302129f081f03456c884185d5ec1c1224ab633ea",
|
|
nip85OnlyMode: true,
|
|
blossomServers: ['https://blossom.primal.net/'],
|
|
defaultZapComment: 'Zapped with Mew!',
|
|
faviconProvider: 'https://favicon.shakespeare.diy/?url={href}',
|
|
corsProxy: 'https://proxy.shakespeare.diy/?url={href}',
|
|
contentWarningPolicy: 'blur',
|
|
};
|
|
|
|
export function App() {
|
|
useEffect(() => {
|
|
// Initialize StatusBar for mobile apps
|
|
if (Capacitor.isNativePlatform()) {
|
|
StatusBar.setStyle({ style: Style.Dark }).catch(() => {
|
|
// StatusBar may not be available on all platforms
|
|
});
|
|
StatusBar.setOverlaysWebView({ overlay: true }).catch(() => {
|
|
// Ignore errors on unsupported platforms
|
|
});
|
|
}
|
|
}, []);
|
|
|
|
return (
|
|
<UnheadProvider head={head}>
|
|
<AppProvider storageKey="nostr:app-config" defaultConfig={defaultConfig}>
|
|
<QueryClientProvider client={queryClient}>
|
|
<NostrLoginProvider storageKey='nostr:login'>
|
|
<NostrProvider>
|
|
<NostrSync />
|
|
<NativeNotifications />
|
|
<NWCProvider>
|
|
<TooltipProvider>
|
|
<Toaster />
|
|
<InitialSyncGate>
|
|
<Suspense>
|
|
<AppRouter />
|
|
</Suspense>
|
|
</InitialSyncGate>
|
|
</TooltipProvider>
|
|
</NWCProvider>
|
|
</NostrProvider>
|
|
</NostrLoginProvider>
|
|
</QueryClientProvider>
|
|
</AppProvider>
|
|
</UnheadProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|