forked from craftzdog/react-native-animated-todo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,517 additions
and
32 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,21 +1,11 @@ | ||
import { StatusBar } from 'expo-status-bar'; | ||
import React from 'react'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
import React from 'react' | ||
import AppContainer from './src/components/app-container' | ||
import Main from './src/screens/main' | ||
|
||
export default function App() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text>Open up App.tsx to start working on your app!</Text> | ||
<StatusBar style="auto" /> | ||
</View> | ||
); | ||
<AppContainer> | ||
<Main /> | ||
</AppContainer> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const options ={ | ||
arrowParens: 'avoid', | ||
singleQuote: true, | ||
backetSpacing: true, | ||
endOfLine: 'lf', | ||
semi: false, | ||
tabWidth: 2, | ||
trailingComma: 'none' | ||
} | ||
module.exports = options |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react' | ||
import { NavigationContainer } from '@react-navigation/native' | ||
import { NativeBaseProvider } from 'native-base' | ||
import theme from '../theme' | ||
|
||
type Props = { | ||
children: React.ReactNode | ||
} | ||
|
||
export default function AppContainer(props: Props) { | ||
return ( | ||
<NavigationContainer> | ||
<NativeBaseProvider theme={theme}>{props.children}</NativeBaseProvider> | ||
</NavigationContainer> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { Text, HStack, Switch, useColorMode } from 'native-base' | ||
|
||
export default function ThemeToggle() { | ||
const { colorMode, toggleColorMode } = useColorMode() | ||
return ( | ||
<HStack space={2} alignItems="center"> | ||
<Text>Dark</Text> | ||
<Switch | ||
isChecked={colorMode === 'light'} | ||
onToggle={toggleColorMode} | ||
></Switch> | ||
<Text>Light</Text> | ||
</HStack> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from 'react' | ||
import { Text, Box, Center, VStack, useColorModeValue } from 'native-base' | ||
import ThemeToggle from '../components/theme-toggle' | ||
|
||
export default function MainScreen() { | ||
return ( | ||
<Center | ||
_dark={{ bg: 'blueGray.900' }} | ||
_light={{ bg: 'blueGray.50' }} | ||
px={4} | ||
flex={1} | ||
> | ||
<VStack space={5} alignItems="center"> | ||
<Box p={10} bg={useColorModeValue('red.500', 'yellow.500')}> | ||
<Text>Hello</Text> | ||
</Box> | ||
<ThemeToggle /> | ||
</VStack> | ||
</Center> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { extendTheme } from 'native-base' | ||
|
||
const config = { | ||
useSystemColorMode: false, | ||
initialColorMode: 'light' | ||
} | ||
|
||
const colors = { | ||
primary: { | ||
50: '#EEF2F6', | ||
100: '#CFD9E7', | ||
200: '#B1C1D8', | ||
300: '#92A9C9', | ||
400: '#7491B9', | ||
500: '#5578AA', | ||
600: '#446088', | ||
700: '#334866', | ||
800: '#223044', | ||
900: '#111822' | ||
} | ||
} | ||
|
||
export default extendTheme({ config, colors }) |
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,6 +1,16 @@ | ||
{ | ||
"extends": "expo/tsconfig.base", | ||
"compilerOptions": { | ||
"strict": true | ||
"strict": true, | ||
"allowSyntheticDefaultImports": true, | ||
"jsx": "react-native", | ||
"lib": [ | ||
"dom", | ||
"esnext" | ||
], | ||
"moduleResolution": "node", | ||
"noEmit": true, | ||
"skipLibCheck": true, | ||
"resolveJsonModule": true, | ||
} | ||
} |
Oops, something went wrong.