-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36b20bf
commit 50ecdcd
Showing
65 changed files
with
508 additions
and
412 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,68 +1,24 @@ | ||
import { EnhancedStore } from '@reduxjs/toolkit'; | ||
import log from 'loglevel'; | ||
import React, { useEffect, useState } from 'react'; | ||
import React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
|
||
import './features/i18n/i18n'; | ||
|
||
import { theme } from './features/ui/components/Layout/Theme/theme'; | ||
import { Router } from './pages/Router'; | ||
import store from './store/store'; | ||
|
||
import './features/i18n/i18n'; | ||
|
||
log.setDefaultLevel('silent'); | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
if (import.meta.env.MODE !== 'production') { | ||
log.enableAll(); | ||
} else { | ||
log.disableAll(); | ||
} | ||
|
||
const Provider = React.lazy(() => | ||
import(/* webpackChunkName: "Redux" */ 'react-redux').then(module => ({ | ||
default: module.Provider, | ||
})) | ||
); | ||
|
||
const StoreLoader = React.lazy(() => | ||
import(/* webpackChunkName: "Store" */ './store/StoreLoader').then( | ||
module => ({ | ||
default: module.StoreLoader, | ||
}) | ||
) | ||
); | ||
|
||
const ChakraProvider = React.lazy(() => | ||
import(/* webpackChunkName: "ChakraUI" */ '@chakra-ui/react').then( | ||
module => ({ | ||
default: module.ChakraProvider, | ||
}) | ||
) | ||
); | ||
|
||
export const App: React.FC = () => { | ||
const [store, setStore] = useState<EnhancedStore>(); | ||
|
||
useEffect(() => { | ||
if (!store) { | ||
return; | ||
} | ||
// Use lazy loaded module store | ||
}, [store]); | ||
|
||
const handleStoreLoaded = (module: EnhancedStore) => { | ||
// Careful, always do it using a function, | ||
// else the module itself will be initialized! | ||
setStore(() => module); | ||
}; | ||
|
||
if (!store) { | ||
// Lazy load it | ||
return <StoreLoader onLoaded={handleStoreLoaded} />; | ||
} | ||
|
||
return ( | ||
<Provider store={store}> | ||
<ChakraProvider theme={theme}> | ||
<Router /> | ||
</ChakraProvider> | ||
<Router /> | ||
</Provider> | ||
); | ||
}; |
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
15 changes: 0 additions & 15 deletions
15
src/features/ui/components/Layout/CookieConsent/CookieConsent.stories.tsx
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/features/ui/components/Layout/CookieConsent/CookieConsentMessage.stories.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// ConnectButton.stories.ts|tsx | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { CookieConsentMessage } from './CookieConsentMessage'; | ||
|
||
const meta: Meta<typeof CookieConsentMessage> = { | ||
component: CookieConsentMessage, | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof CookieConsentMessage>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
debug: true, | ||
}, | ||
}; |
8 changes: 4 additions & 4 deletions
8
...yout/CookieConsent/CookieConsent.test.tsx → ...okieConsent/CookieConsentMessage.test.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
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
Oops, something went wrong.