import type { ComponentType, ForwardedRef } from 'react';
import React from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
import { ThemeContext, ThemeProvider } from './theme/theme';
import { TypographyContext, TypographyProvider } from './typography/typography';
import { NotificationProvider } from './notification/notification';
Animated.addWhitelistedNativeProps({ text: true });
type KitraProviderType = {
children?: any,
limit?: number,
messageType?: {
[key: string]: {
backgroundColor: string,
icon: React.ReactNode
}
},
linearMessageType?: (theme?:any, colorScheme?:'dark' | 'light') => {[key:string]: {
backgroundColor:{
color:string [],
location:number [],
bottomColor:string [],
bottomLocation:number []
}
icon:React.ReactNode
}}
}
export const KitraProvider = ({ children, messageType, linearMessageType, limit }: KitraProviderType) => (
(linearMessageType ? linearMessageType(theme, colorScheme) : theme)}
messageType={messageType}
limit={limit}
>
{children}
);
export function applyDefaults(Component: ComponentType) {
return React.forwardRef((props: T, ref: ForwardedRef) => (
{theme => (
{typography =>
}
)}
));
}