diff --git a/example/storybook/src/api/ExtendComponents/ExtendComponents.tsx b/example/storybook/src/api/ExtendComponents/ExtendComponents.tsx index 9c99e08d8..1c3eebb86 100644 --- a/example/storybook/src/api/ExtendComponents/ExtendComponents.tsx +++ b/example/storybook/src/api/ExtendComponents/ExtendComponents.tsx @@ -1,48 +1,19 @@ import React from 'react'; import { View, Text } from 'react-native'; -import { Wrapper } from '../../components/Wrapper'; -import { Camera } from 'lucide-react-native'; -import { StyledHeading } from '../../ui-components/AsForwarder'; -import { H2 } from '@expo/html-elements'; -import { - StyledProvider, - createComponents, - styled, -} from '@gluestack-style/react'; +import { StyledProvider, styled } from '@gluestack-style/react'; import { config } from '../../components/nb.config'; -config.components = { - Box: { - theme: { - bg: '$red500', - p: '$10', - // props: { - // ':initial': { - // scale: 0.5, - // }, - // ':animate': { - // scale: 1, - // }, - // props: { - // p: '$5', - // }, - // }, - }, - }, -}; - const Box = styled( - AnimatedView, - {}, + View, + { + bg: '$amber400', + p: '$10', + }, { componentName: 'Box', } ); -import Svg from 'react-native-svg'; -import { AnimatedView } from '@gluestack-style/animation-resolver'; - export function ExtendComponentsExample() { - const [state, setState] = React.useState(false); return ( (defaultContextData); // Can be discussed should we provide flex 1 by default or not. -const StyledView = styled( - View, - { - // flex: 1 - }, - { componentName: 'GluestackThemeView' } -); -// @ts-ignore -export const Theme: typeof StyledView = ({ children, name, ...props }) => { +export const Theme = ({ + children, + name, + ...props +}: ViewProps & { + name: string; +}) => { const contextValue = React.useMemo(() => { return { theme: name, @@ -29,9 +27,9 @@ export const Theme: typeof StyledView = ({ children, name, ...props }) => { return ( {/* @ts-ignore */} - + {children} - + ); };