mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added react-native-app-intro-slider Added react-native-app-intro-slider. * Fixed pipeline error Removed semicolon to fix pipeline error.
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
import * as React from 'react';
|
|
import { Image, StyleSheet, Text, View } from 'react-native';
|
|
import AppIntroSlider from 'react-native-app-intro-slider';
|
|
|
|
const slides = [
|
|
{
|
|
key: 'somethun',
|
|
title: 'Title 1',
|
|
text: 'Description.\nSay something cool',
|
|
image: require('./assets/1.jpg'),
|
|
backgroundColor: '#59b2ab',
|
|
},
|
|
{
|
|
key: 'somethun-dos',
|
|
title: 'Title 2',
|
|
text: 'Other cool stuff',
|
|
image: require('./assets/2.jpg'),
|
|
backgroundColor: '#febe29',
|
|
},
|
|
{
|
|
key: 'somethun1',
|
|
title: 'Rocket guy',
|
|
text: "I'm already out of descriptions\n\nLorem ipsum bla bla bla",
|
|
image: require('./assets/3.jpg'),
|
|
backgroundColor: '#22bcb5',
|
|
},
|
|
];
|
|
|
|
const styles = StyleSheet.create({
|
|
mainContent: {
|
|
flex: 1,
|
|
alignItems: 'center',
|
|
justifyContent: 'space-around',
|
|
},
|
|
image: {
|
|
width: 320,
|
|
height: 320,
|
|
},
|
|
text: {
|
|
color: 'rgba(255, 255, 255, 0.8)',
|
|
backgroundColor: 'transparent',
|
|
textAlign: 'center',
|
|
paddingHorizontal: 16,
|
|
},
|
|
title: {
|
|
fontSize: 22,
|
|
color: 'white',
|
|
backgroundColor: 'transparent',
|
|
textAlign: 'center',
|
|
marginBottom: 16,
|
|
},
|
|
});
|
|
|
|
export default class App extends React.Component {
|
|
_renderItem = (item: any) => {
|
|
return (
|
|
<View style={{ flex: 1 }}>
|
|
<Text style={styles.title}>{item.title}</Text>
|
|
<Image source={item.image} />
|
|
<Text style={styles.text}>{item.text}</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
render() {
|
|
return <AppIntroSlider renderItem={this._renderItem} slides={slides} />;
|
|
}
|
|
}
|