-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor hooks and providers for additional simplification
- Loading branch information
Showing
18 changed files
with
89 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
export * from './SupportBubble'; | ||
export * from './UnstoppableMessaging'; | ||
export * from './hooks'; | ||
export * from './types'; | ||
export {default as UnstoppableMessagingProvider} from './provider/UnstoppableMessagingProvider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from './useEnsDomainStatus'; | ||
export {default as usePrevious} from './usePrevious'; | ||
export {default as useTokenGallery} from './useTokenGallery'; | ||
export {default as useUnstoppableMessaging} from './useUnstoppableMessaging'; | ||
export {default as useWeb3Context} from './useWeb3Context'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ts/Chat/hooks/useUnstoppableMessaging.tsx → ...nts/src/hooks/useUnstoppableMessaging.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import CssBaseline from '@mui/material/CssBaseline'; | ||
import {ThemeProvider} from '@mui/material/styles'; | ||
import {SnackbarProvider} from 'notistack'; | ||
import React from 'react'; | ||
import {QueryClient, QueryClientProvider} from 'react-query'; | ||
import {createEmotionSsrAdvancedApproach} from 'tss-react/nextJs'; | ||
|
||
import {lightTheme} from '@unstoppabledomains/ui-kit/styles'; | ||
|
||
import {TranslationProvider} from '../lib'; | ||
import Web3ContextProvider from './Web3ContextProvider'; | ||
|
||
// setup query client | ||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
// We want cacheTime to be a balance - long enough to improve load speed for frequently used | ||
// queries, while short enough to avoid using too much memory for long browsing sessions. While | ||
// it makes sense for react-query to have an aggressive 5 minute default, 24 hours seems more | ||
// appropriate for our app. For comparison, the `swr` module never clears cache keys. | ||
cacheTime: 1000 * 60 * 60 * 24, // 24 hours | ||
}, | ||
}, | ||
}); | ||
|
||
// setup emotion cache for MUI | ||
const {EmotionCacheProvider, withEmotionCache} = | ||
createEmotionSsrAdvancedApproach({key: 'css'}); | ||
export {withEmotionCache}; | ||
|
||
type Props = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
const BaseProvider: React.FC<Props> = ({children}) => { | ||
return ( | ||
<TranslationProvider> | ||
<EmotionCacheProvider> | ||
<QueryClientProvider client={queryClient}> | ||
<ThemeProvider theme={lightTheme}> | ||
<CssBaseline enableColorScheme /> | ||
<SnackbarProvider | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'left', | ||
}} | ||
> | ||
<Web3ContextProvider>{children}</Web3ContextProvider> | ||
</SnackbarProvider> | ||
</ThemeProvider> | ||
</QueryClientProvider> | ||
</EmotionCacheProvider> | ||
</TranslationProvider> | ||
); | ||
}; | ||
|
||
export default BaseProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
export * from './BaseProvider'; | ||
export * from './TokenGalleryProvider'; | ||
export * from './UnstoppableMessagingProvider'; | ||
export * from './Web3ContextProvider'; | ||
|
||
export {default as BaseProvider} from './BaseProvider'; | ||
export {default as TokenGalleryProvider} from './TokenGalleryProvider'; | ||
export {default as UnstoppableMessagingProvider} from './UnstoppableMessagingProvider'; | ||
export {default as Web3ContextProvider} from './Web3ContextProvider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters