This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #378 from gluestack/fix/babel-plugin-api
Fix/babel plugin api
- Loading branch information
Showing
7 changed files
with
195 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,22 @@ | ||
/* eslint-disable react-native/no-inline-styles */ | ||
import React from 'react'; | ||
import { SafeAreaView, StyleSheet } from 'react-native'; | ||
import { View } from 'react-native'; | ||
import { config } from './gluestack-ui.config'; | ||
import './styles'; | ||
import { StyledProvider } from '../../packages/react'; | ||
import { Box, Heading } from './src/core'; | ||
import { styled, StyledProvider } from '../../packages/react'; | ||
// import { Box, Heading } from './src/core'; | ||
|
||
const bg = '$40'; | ||
const abc = '$pink500'; | ||
export default function App() { | ||
const [hover, setHover] = React.useState(false); | ||
const [active, setActive] = React.useState(false); | ||
const Box = styled(View, { | ||
bg: '$primary100', | ||
h: '$10', | ||
w: '$10', | ||
}); | ||
|
||
console.log(hover, active, '+++'); | ||
export default function App() { | ||
return ( | ||
<> | ||
{/* top SafeAreaView */} | ||
<SafeAreaView /> | ||
{/* bottom SafeAreaView */} | ||
<SafeAreaView | ||
style={{ | ||
...styles.container, | ||
}} | ||
> | ||
{/* gluestack-ui provider */} | ||
<StyledProvider config={config.theme}> | ||
<Box | ||
onHoverIn={() => setHover(true)} | ||
onHoverOut={() => setHover(false)} | ||
onPressIn={() => setActive(true)} | ||
onPressOut={() => setActive(false)} | ||
states={{ | ||
hover, | ||
active, | ||
}} | ||
bg={{}} | ||
sx={{ | ||
bg: '$red500', | ||
}} | ||
/> | ||
</StyledProvider> | ||
</SafeAreaView> | ||
{/* gluestack-ui provider */} | ||
<StyledProvider config={config.theme}> | ||
<Box bg="$red500" /> | ||
</StyledProvider> | ||
</> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
overflow: 'hidden', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.