diff --git a/README.md b/README.md index 3b98b9e..7b3eb3e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ import React, { useState } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import Loader from '@erickcrus/three-dots-loader'; -return () => { +const AppScreen = () => { const [ loading, setLoading ] = useState(false); const onPress = () => { @@ -37,7 +37,9 @@ return () => { alignSelf: 'center', borderRadius: 10 }} onPress={onPress}> - {loading ? : Test} + {loading ? + : + Test} ; } diff --git a/example/app.json b/example/app.json deleted file mode 100644 index 05e5eb2..0000000 --- a/example/app.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "expo": { - "name": "example", - "slug": "example", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/icon.png", - "userInterfaceStyle": "light", - "splash": { - "image": "./assets/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "assetBundlePatterns": [ - "**/*" - ], - "ios": { - "supportsTablet": true - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", - "backgroundColor": "#ffffff" - } - }, - "web": { - "favicon": "./assets/favicon.png" - } - } -} diff --git a/example/assets/adaptive-icon.png b/example/assets/adaptive-icon.png deleted file mode 100644 index 03d6f6b..0000000 Binary files a/example/assets/adaptive-icon.png and /dev/null differ diff --git a/example/assets/favicon.png b/example/assets/favicon.png deleted file mode 100644 index e75f697..0000000 Binary files a/example/assets/favicon.png and /dev/null differ diff --git a/example/assets/icon.png b/example/assets/icon.png deleted file mode 100644 index a0b1526..0000000 Binary files a/example/assets/icon.png and /dev/null differ diff --git a/example/assets/splash.png b/example/assets/splash.png deleted file mode 100644 index 0e89705..0000000 Binary files a/example/assets/splash.png and /dev/null differ diff --git a/example/src/App.tsx b/example/src/App.tsx index 57578ce..84ca79c 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,31 +1,34 @@ -import * as React from 'react'; +import React, { useState } from 'react'; +import { View, Text, TouchableOpacity } from 'react-native'; +import Loader from '@erickcrus/three-dots-loader'; -import { StyleSheet, View, Text } from 'react-native'; -import { multiply } from '@erickcrus/three-dots-loader'; +const AppScreen = () => { + const [loading, setLoading] = useState(false); -export default function App() { - const [result, setResult] = React.useState(); + const onPress = () => { + setLoading(true); + setTimeout(() => { + setLoading(false); + }, 1250); + } - React.useEffect(() => { - multiply(3, 7).then(setResult); - }, []); - - return ( - - Result: {result} + return + + Press button to test - ); + + {loading ? + : + Test} + + ; } -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, - box: { - width: 60, - height: 60, - marginVertical: 20, - }, -}); +export default AppScreen; \ No newline at end of file diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js deleted file mode 100644 index 1729189..0000000 --- a/scripts/bootstrap.js +++ /dev/null @@ -1,29 +0,0 @@ -const os = require('os'); -const path = require('path'); -const child_process = require('child_process'); - -const root = path.resolve(__dirname, '..'); -const args = process.argv.slice(2); -const options = { - cwd: process.cwd(), - env: process.env, - stdio: 'inherit', - encoding: 'utf-8', -}; - -if (os.type() === 'Windows_NT') { - options.shell = true; -} - -let result; - -if (process.cwd() !== root || args.length) { - // We're not in the root of the project, or additional arguments were passed - // In this case, forward the command to `yarn` - result = child_process.spawnSync('yarn', args, options); -} else { - // If `yarn` is run without arguments, perform bootstrap - result = child_process.spawnSync('yarn', ['bootstrap'], options); -} - -process.exitCode = result.status; diff --git a/src/__tests__/index.test.tsx b/src/__tests__/index.test.tsx deleted file mode 100644 index bf84291..0000000 --- a/src/__tests__/index.test.tsx +++ /dev/null @@ -1 +0,0 @@ -it.todo('write a test');