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 #379 from gluestack/release/@gluestack-style/babel…
…[email protected] Release/@gluestack style/babel plugin styled [email protected]
- Loading branch information
Showing
8 changed files
with
196 additions
and
250 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
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.