1
0
Fork 0
freesewing/sites/lab/pages/_app.mjs

45 lines
1.3 KiB
JavaScript
Raw Normal View History

import 'shared/styles/globals.css'
2022-02-06 19:16:49 +01:00
import { appWithTranslation } from 'next-i18next'
2023-05-17 17:04:15 +02:00
import React from 'react'
import Bugsnag from '@bugsnag/js'
import BugsnagPluginReact from '@bugsnag/plugin-react'
import { siteConfig } from 'site/site.config.mjs'
import { Toaster as DefaultToaster } from 'react-hot-toast'
import { ContextWrapper } from 'shared/components/wrappers/context.mjs'
2023-05-17 17:04:15 +02:00
Bugsnag.start({
apiKey: siteConfig.bugsnag.key,
collectUserIp: false,
plugins: [new BugsnagPluginReact()],
})
const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React)
const FreeSewingLab = ({ Component, pageProps }) => (
<ErrorBoundary>
<ContextWrapper>
<Component {...pageProps} />
<DefaultToaster
position="bottom-right"
toastOptions={{
className: 'bg-base-100 text-base-content',
success: {
className: 'bg-success text-success-content',
},
error: {
className: 'bg-error text-error-content',
},
loading: {
className: 'bg-warning text-warning-content',
},
custom: {
className: 'bg-accent text-accent-content',
},
}}
/>
</ContextWrapper>
</ErrorBoundary>
)
2022-02-06 19:16:49 +01:00
export default appWithTranslation(FreeSewingLab)