import React from 'react'; import {StyleSheet, View, TouchableOpacity, Text} from 'react-native'; import {GradientBackground, SocialMediaLinker} from '../../components'; import {LinkerType} from 'src/types'; import {SOCIAL_LIST} from '../../constants/'; /** * Home Screen for displaying Tagg post suggestions * for users to discover and browse */ const Home: React.FC = () => { const linkers: Array = []; const [state, setState] = React.useState({ showMore: false, }); let numSocials: Number = state.showMore ? 9 : 3; for (let i = 0; i < numSocials; i++) { let linker: LinkerType = { label: SOCIAL_LIST[i], }; linkers.push(linker); } const handleShowPress = () => { setState({ ...state, showMore: !state.showMore, }); }; return ( {linkers.map((linker, index) => ( ))} {state.showMore && Show Less 🔼} {!state.showMore && Show More 🔽} ); }; const styles = StyleSheet.create({ container: { flexDirection: 'row', height: '19%', flexWrap: 'wrap', justifyContent: 'center', alignContent: 'center', }, show: { borderColor: '#fff', borderWidth: 1, borderRadius: 3, paddingHorizontal: '2%', paddingVertical: '1%', marginVertical: '3%', marginLeft: '65%', }, }); export default Home;