forked from caglardurmus/react-native-insta-story
-
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.
chore(formatter): execute prettier -- write command to format files
- Loading branch information
Showing
16 changed files
with
1,279 additions
and
1,221 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 |
---|---|---|
|
@@ -55,3 +55,8 @@ node_modules | |
ios | ||
android | ||
images | ||
|
||
*/.expo | ||
*/node_modules | ||
*/yarn.lock | ||
*/package |
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,4 +1,4 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
} | ||
} |
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 |
---|---|---|
@@ -1,55 +1,55 @@ | ||
import {StatusBar} from 'expo-status-bar'; | ||
import {StyleSheet, Text, View} from 'react-native'; | ||
import { StatusBar } from 'expo-status-bar'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
import InstaStory from 'react-native-insta-story'; | ||
|
||
export default function App() { | ||
function createData() { | ||
const array = [] | ||
function createData() { | ||
const array = []; | ||
|
||
const userCount = 10; | ||
const userStoryCount = 15; | ||
const userCount = 10; | ||
const userStoryCount = 15; | ||
|
||
for (let i = 1; i <= userCount; i++) { | ||
const storyArray = []; | ||
for (let k = 1; k <= userStoryCount; k++) { | ||
storyArray.push( | ||
{ | ||
story_id: i, | ||
story_image: "https://picsum.photos/500/800?random=" + Math.random(), | ||
swipeText: 'Custom swipe text for this story', | ||
onPress: () => console.log(`story ${i} swiped`), | ||
} | ||
) | ||
} | ||
for (let i = 1; i <= userCount; i++) { | ||
const storyArray = []; | ||
for (let k = 1; k <= userStoryCount; k++) { | ||
storyArray.push({ | ||
story_id: i, | ||
story_image: 'https://picsum.photos/500/800?random=' + Math.random(), | ||
swipeText: 'Custom swipe text for this story', | ||
onPress: () => console.log(`story ${i} swiped`), | ||
}); | ||
} | ||
|
||
array.push({ | ||
user_id: i, | ||
user_image: "https://picsum.photos/200/300?random=" + Math.random(), | ||
user_name: "Test User " + i, | ||
stories: storyArray | ||
}) | ||
} | ||
return array; | ||
array.push({ | ||
user_id: i, | ||
user_image: 'https://picsum.photos/200/300?random=' + Math.random(), | ||
user_name: 'Test User ' + i, | ||
stories: storyArray, | ||
}); | ||
} | ||
return array; | ||
} | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<StatusBar style="auto"/> | ||
<InstaStory data={createData()} | ||
duration={10} | ||
customSwipeUpComponent={<View> | ||
<Text>Swipe</Text> | ||
</View>} | ||
|
||
style={{marginTop: 30}} | ||
/> | ||
</View> | ||
); | ||
return ( | ||
<View style={styles.container}> | ||
<StatusBar style="auto" /> | ||
<InstaStory | ||
data={createData()} | ||
duration={10} | ||
customSwipeUpComponent={ | ||
<View> | ||
<Text>Swipe</Text> | ||
</View> | ||
} | ||
style={{ marginTop: 30 }} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
}, | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
}, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Story from "./src/Story"; | ||
import Story from './src/Story'; | ||
|
||
export const InstaStory = Story; | ||
|
||
|
Oops, something went wrong.