All files / src/providers/mantine mantine.tsx

100% Statements 4/4
75% Branches 3/4
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 391x                 1x       1x     3x                                            
'use client';
 
import { localStorageColorSchemeManager, MantineProvider } from '@mantine/core';
import { ModalsProvider } from '@mantine/modals';
import { Notifications } from '@mantine/notifications';
import NextTopLoader from 'nextjs-toploader';
import type { PropsWithChildren } from 'react';
import { lightTheme } from './lightTheme';
 
const colorSchemeManager = localStorageColorSchemeManager({
  key: 'cookbook-color-scheme',
});
 
export const MantineProviderWrapper = ({
  children,
}: Readonly<PropsWithChildren>) => {
  return (
    <MantineProvider
      theme={lightTheme}
      defaultColorScheme="auto"
      colorSchemeManager={colorSchemeManager}
    >
      <Notifications />
      <NextTopLoader
        color={
          lightTheme.colors?.[lightTheme.primaryColor ?? 'pink']?.[7] ??
          '#E00890'
        }
        showSpinner={false}
        height={2}
        crawl={true}
        easing="ease-in-out"
        key="top-loader"
      />
      <ModalsProvider>{children}</ModalsProvider>
    </MantineProvider>
  );
};