Skip to content

Commit 0adceae

Browse files
committed
Implementing the multisteps component with styles attributes
1 parent 9513c55 commit 0adceae

File tree

7 files changed

+37858
-15
lines changed

7 files changed

+37858
-15
lines changed

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,77 @@ import MultiSteps from "react-native-multi-steps";
1515

1616
// ...
1717

18-
const result = await MultiSteps.multiply(3, 7);
18+
//Simple implementation
19+
<MultiSteps
20+
//Move to the next item
21+
onMoveNext={(data)=>{console.log(data) }}
22+
//Move to the previous item
23+
onMovePrevious={(data)=>{console.log(data)}}
24+
/>
25+
26+
//Whever you need to implement onSubmit
27+
<MultiSteps
28+
//Move to the next item
29+
onMoveNext={(data)=>{console.log(data) }}
30+
//Move to the previous item
31+
onMovePrevious={(data)=>{console.log(data)}}
32+
//onSubmit is optional, only implement it whever you need to use it
33+
onSubmit={()=>{console.log('Submiting')}}
34+
/>
35+
```
36+
# Example
37+
```js
38+
import { StyleSheet, View, Text } from 'react-native';
39+
import MultiSteps from 'react-native-multi-steps';
40+
41+
export default function App() {
42+
43+
return (
44+
<View style={styles.container}>
45+
<MultiSteps
46+
onMoveNext={function (data: any): void { console.log("next", data) }}
47+
onMovePrevious={function (data: any): void { console.log("previous", data) }}
48+
onSubmit={function () { console.log('Submit') }}>
49+
<View>
50+
<Text>
51+
A paragraph is a series of related sentences developing a central idea, called the topic. Try to think about paragraphs in terms of thematic unity: a paragraph is a sentence or a group of sentences that supports one central, unified idea. Paragraphs add one idea at a time to your broader argument.
52+
</Text>
53+
</View>
54+
<View>
55+
<Text>
56+
Piedmont, or mountain, glaciers are found in many parts of the world. In North America they are distributed along the mountain ranges of the Pacific Coast from central California northward. They abound in the Andes range in South America and are familiar and greatly admired spectacles in the Alps, the Pyrenees, the Caucasus Mountains and the mountains of Scandanavia. Rivers of ice flow down the valleys of various Asian mountain ranges, including the Himalayas, the Hindu Kush, and the Karakoram and Kunlun ranges. They are also a feature of the Southern Alps of New Zealand and are found in the lofty mountains of New Guinea. The largest piedmont glaciers are the Malaspina and Bering glaciers, both in Alaska. </Text>
57+
</View>
58+
<View>
59+
<Text>
60+
Scientists' research has revealed that viruses are by far the most abundant life forms on Earth. There are a million times more viruses on the planet than stars in the universe. Viruses also harbor the majority of genetic diversity on Earth. Scientists are finding evidence of viruses as a planetary force, influencing the global climate and geochemical cycles. They have also profoundly shaped the evolution of their hosts. The human genome, for example, contains 100,000 segments of virus DNA.
61+
</Text>
62+
</View>
63+
<View>
64+
<Text>
65+
sibusiso love you
66+
</Text>
67+
</View>
68+
<View>
69+
<Text>
70+
Scientists' research has revealed that viruses are by far the most abundant life forms on Earth. There are a million times more viruses on the planet than stars in the universe. Viruses also harbor the majority of genetic diversity on Earth. Scientists are finding evidence of viruses as a planetary force, influencing the global climate and geochemical cycles. They have also profoundly shaped the evolution of their hosts. The human genome, for example, contains 100,000 segments of virus DNA.
71+
</Text>
72+
</View>
73+
</MultiSteps>
74+
75+
</View>
76+
);
77+
}
78+
79+
const styles = StyleSheet.create({
80+
container: {
81+
flex: 1,
82+
alignItems: 'center',
83+
justifyContent: 'center',
84+
margin: 20,
85+
},
86+
87+
});
88+
1989
```
2090

2191
## Contributing

0 commit comments

Comments
 (0)