a167c878ca
- Add `useAppRelays` boolean option to AppConfig - Define APP_RELAYS constant with default app relays: - wss://relay.ditto.pub - wss://relay.primal.net - wss://relay.damus.io - Update NostrProvider to use getEffectiveRelays() which merges app relays with user relays when useAppRelays is true - Redesign RelayListManager with two sections: - App Relays: Read-only list with enable/disable toggle - Your Relays: User's personal NIP-65 relay list (editable) - User relays now stored separately from app relays in config - Default config starts with empty user relays and useAppRelays=true Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
69 lines
1.9 KiB
TypeScript
69 lines
1.9 KiB
TypeScript
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
import { createHead, UnheadProvider } from '@unhead/react/client';
|
|
import { BrowserRouter } from 'react-router-dom';
|
|
import { NostrLoginProvider } from '@nostrify/react/login';
|
|
import NostrProvider from '@/components/NostrProvider';
|
|
import { AppProvider } from '@/components/AppProvider';
|
|
import { NWCProvider } from '@/contexts/NWCContext';
|
|
import { AppConfig } from '@/contexts/AppContext';
|
|
|
|
interface TestAppProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function TestApp({ children }: TestAppProps) {
|
|
const head = createHead();
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: { retry: false },
|
|
mutations: { retry: false },
|
|
},
|
|
});
|
|
|
|
const defaultConfig: AppConfig = {
|
|
theme: 'light',
|
|
useAppRelays: true,
|
|
relayMetadata: {
|
|
relays: [
|
|
{ url: 'wss://relay.primal.net', read: true, write: true },
|
|
],
|
|
updatedAt: 0,
|
|
},
|
|
feedSettings: {
|
|
showVines: true,
|
|
showPolls: false,
|
|
showTreasures: false,
|
|
showTreasureGeocaches: true,
|
|
showTreasureFoundLogs: true,
|
|
showColors: false,
|
|
showPacks: true,
|
|
feedIncludeVines: false,
|
|
feedIncludePolls: false,
|
|
feedIncludeTreasureGeocaches: false,
|
|
feedIncludeTreasureFoundLogs: false,
|
|
feedIncludeColors: false,
|
|
feedIncludePacks: false,
|
|
},
|
|
};
|
|
|
|
return (
|
|
<UnheadProvider head={head}>
|
|
<AppProvider storageKey='test-app-config' defaultConfig={defaultConfig}>
|
|
<QueryClientProvider client={queryClient}>
|
|
<NostrLoginProvider storageKey='test-login'>
|
|
<NostrProvider>
|
|
<NWCProvider>
|
|
<BrowserRouter>
|
|
{children}
|
|
</BrowserRouter>
|
|
</NWCProvider>
|
|
</NostrProvider>
|
|
</NostrLoginProvider>
|
|
</QueryClientProvider>
|
|
</AppProvider>
|
|
</UnheadProvider>
|
|
);
|
|
}
|
|
|
|
export default TestApp; |