import React from 'react'; import { View, ScrollView, StyleSheet, SafeAreaView, Dimensions, } from 'react-native'; import { Avatar, FAB, Icon, ListItem, Text, Badge, Tab, } from 'react-native-elements'; import { Header } from '../components/header'; const ScreenWidth = Dimensions.get('window').width; const WhatsappClone: React.FunctionComponent = () => { const [index, setIndex] = React.useState(0); const scrollRef = React.useRef(null); return ( <>
WhatsApp { setIndex(e); scrollRef.current?.scrollTo({ x: ScreenWidth * e, }); }} indicatorStyle={{ backgroundColor: 'white', }} style={{ backgroundColor: 'transparent' }} > { setIndex(e.nativeEvent.contentOffset.x / ScreenWidth); }} ref={scrollRef} > {[...new Array(5)].map((v, i) => ( {}}> John Doe I am using React Native Elements ))} {}}> My Status Tap to add status update {[...new Array(3)].map((v, i) => ( {}}> John Doe Today, 11:3{i * 3} AM ))} ); }; export default WhatsappClone; const styles = StyleSheet.create({ safeArea: { backgroundColor: '#075E54', paddingTop: 30, }, icon: { paddingHorizontal: 10, }, header1: { padding: 8, paddingLeft: 10, flexDirection: 'row', alignItems: 'center', }, header2: { flexDirection: 'row', alignItems: 'center', width: ScreenWidth - 40, }, tabLabel: { color: '#fff', fontSize: 16, paddingHorizontal: 20, }, activeTabLabel: { padding: 10, borderBottomColor: '#fff', borderBottomWidth: 4, }, chatOverviewLight: { opacity: 0.6, fontSize: 12, color: 'black', }, chatOverviewDark: { opacity: 0.6, fontSize: 12, color: 'white', }, view: { flex: 1, width: ScreenWidth, }, });