2023-08-12 03:22:50 +00:00
|
|
|
import { NavigationContainer } from "@react-navigation/native";
|
|
|
|
import React from "react";
|
2022-11-26 01:20:18 +00:00
|
|
|
import {
|
|
|
|
DefaultTheme,
|
2023-07-20 02:55:19 +00:00
|
|
|
MD3DarkTheme,
|
2022-11-26 01:20:18 +00:00
|
|
|
Provider as PaperProvider,
|
2023-08-12 03:22:50 +00:00
|
|
|
} from "react-native-paper";
|
|
|
|
import MaterialIcon from "react-native-vector-icons/MaterialIcons";
|
|
|
|
import { ThemeContext } from "./use-theme";
|
2022-10-29 23:56:58 +00:00
|
|
|
|
|
|
|
export const MockProviders = ({
|
|
|
|
children,
|
|
|
|
}: {
|
2023-08-12 03:22:50 +00:00
|
|
|
children: JSX.Element | JSX.Element[];
|
2022-10-29 23:56:58 +00:00
|
|
|
}) => (
|
2023-06-27 03:16:59 +00:00
|
|
|
<PaperProvider settings={{ icon: (props) => <MaterialIcon {...props} /> }}>
|
2023-01-01 01:19:15 +00:00
|
|
|
<ThemeContext.Provider
|
|
|
|
value={{
|
2023-08-12 03:22:50 +00:00
|
|
|
theme: "system",
|
2023-01-01 01:19:15 +00:00
|
|
|
setTheme: jest.fn(),
|
|
|
|
lightColor: DefaultTheme.colors.primary,
|
2023-07-15 02:38:46 +00:00
|
|
|
darkColor: MD3DarkTheme.colors.primary,
|
2023-01-01 01:19:15 +00:00
|
|
|
setLightColor: jest.fn(),
|
|
|
|
setDarkColor: jest.fn(),
|
2023-06-27 03:16:59 +00:00
|
|
|
}}
|
|
|
|
>
|
2022-11-01 05:30:23 +00:00
|
|
|
<NavigationContainer>{children}</NavigationContainer>
|
|
|
|
</ThemeContext.Provider>
|
2022-10-31 08:32:33 +00:00
|
|
|
</PaperProvider>
|
2023-08-12 03:22:50 +00:00
|
|
|
);
|