Skip to content

Commit

Permalink
Revert "Persist query data in session storage (#229)"
Browse files Browse the repository at this point in the history
This reverts commit d35f2f6.
  • Loading branch information
luistorres committed Apr 30, 2024
1 parent d35f2f6 commit 8937b30
Show file tree
Hide file tree
Showing 7 changed files with 507 additions and 326 deletions.
52 changes: 11 additions & 41 deletions packages/web-app/app/_providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,25 @@

import type { ReactNode } from 'react';
import { IdOsProvider } from './idos';
import { wagmiConfig } from './wagmi-config';
import { SsrWrapper } from './ssr-wrapper';
import { ReactQueryProviderWrapper } from './react-query-wrapper-provider';
import { Web3Provider } from './web3-provider';
import { DialogProvider } from './dialog';
import { WagmiProvider } from 'wagmi';
import { PersistQueryWrapper } from './persist-query-wrapper';
import { nohemi } from '../_ui/fonts';
import merge from 'lodash.merge';
import {
RainbowKitProvider,
darkTheme,
type Theme,
} from '@rainbow-me/rainbowkit';
import { KycProvider } from './kyc';

type TProvidersProps = {
children: ReactNode;
};

const customTheme = merge(
darkTheme({
overlayBlur: 'small',
accentColor: '#3865FD',
accentColorForeground: '#FFF',
}),
{
fonts: {
body: nohemi.style.fontFamily,
},
},
) as Theme;

export function Providers({ children }: TProvidersProps) {
return (
<WagmiProvider config={wagmiConfig}>
<SsrWrapper>
<PersistQueryWrapper>
<RainbowKitProvider
showRecentTransactions={true}
theme={customTheme}
modalSize="compact"
>
<IdOsProvider>
<KycProvider>
<DialogProvider>{children}</DialogProvider>
</KycProvider>
</IdOsProvider>
</RainbowKitProvider>
</PersistQueryWrapper>
</SsrWrapper>
</WagmiProvider>
<ReactQueryProviderWrapper>
<Web3Provider>
<IdOsProvider>
<KycProvider>
<DialogProvider>{children}</DialogProvider>
</KycProvider>
</IdOsProvider>
</Web3Provider>
</ReactQueryProviderWrapper>
);
}
37 changes: 0 additions & 37 deletions packages/web-app/app/_providers/persist-query-wrapper.tsx

This file was deleted.

17 changes: 17 additions & 0 deletions packages/web-app/app/_providers/react-query-wrapper-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { TChildren } from '@/app/_types';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: 0,
// staleTime: Infinity,
},
},
});

export function ReactQueryProviderWrapper({ children }: TChildren) {
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
}
16 changes: 0 additions & 16 deletions packages/web-app/app/_providers/ssr-wrapper.tsx

This file was deleted.

39 changes: 39 additions & 0 deletions packages/web-app/app/_providers/web3-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use client';

import { WagmiProvider } from 'wagmi';
import {
RainbowKitProvider,
darkTheme,
type Theme,
} from '@rainbow-me/rainbowkit';
import { TChildren } from '@/app/_types';
import { nohemi } from '../_ui/fonts';
import merge from 'lodash.merge';
import { wagmiConfig } from './wagmi-config';

const customTheme = merge(
darkTheme({
overlayBlur: 'small',
accentColor: '#3865FD',
accentColorForeground: '#FFF',
}),
{
fonts: {
body: nohemi.style.fontFamily,
},
},
) as Theme;

export function Web3Provider({ children }: TChildren) {
return (
<WagmiProvider config={wagmiConfig}>
<RainbowKitProvider
showRecentTransactions={true}
theme={customTheme}
modalSize="compact"
>
{children}
</RainbowKitProvider>
</WagmiProvider>
);
}
2 changes: 0 additions & 2 deletions packages/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"@rainbow-me/rainbowkit": "^2.0.1",
"@rainbow-me/rainbowkit-siwe-next-auth": "^0.4.0",
"@tailwindcss/forms": "^0.5.7",
"@tanstack/query-async-storage-persister": "^5.32.1",
"@tanstack/react-query": "^5.24.1",
"@tanstack/react-query-persist-client": "^5.32.1",
"@tanstack/react-table": "^8.16.0",
"@types/node": "20.12.7",
"autoprefixer": "10.4.19",
Expand Down
Loading

0 comments on commit 8937b30

Please sign in to comment.