import React, { useState } from "react"; import { StyleSheet, Dimensions, View, TouchableWithoutFeedback, Keyboard, Text } from "react-native"; import Constants from "expo-constants"; import MapView from "react-native-maps"; import { Marker } from "react-native-maps"; import { BottomTab } from "./Components/BottomTab"; import { RoundButton } from "./Components/RoundButton"; import { SearchBar } from "./Components/SearchBar"; import { Ionicons, FontAwesome } from "@expo/vector-icons"; import { Banner } from "./Components/Banner"; import {mapStyleDark, markers, searchResult} from "./Components/data" export default function App() { const [region, setRegion] = useState({ latitude: 26.843038624798467, latitudeDelta: 0.0732756619287187, longitude: 80.94415543600917, longitudeDelta: 0.04971709102392197, }); const [darkTheme, setDarkTheme] = useState(false); const [searchActive, setSearchActive] = useState(false); return ( setRegion(region)} initialRegion={region} > {markers.map((item, index) => ( ))} setSearchActive(true)} onBlurHandler={()=>setSearchActive(false)} /> {searchActive ? ( { searchResult.map((item, index)=>( {item} )) } ) : ( <> setDarkTheme(!darkTheme)} > {}}> )} ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#fff", alignItems: "center", justifyContent: "center", marginTop: Constants.statusBarHeight }, map: { width: Dimensions.get("window").width, height: Dimensions.get("window").height, }, toggleButton: { position: "absolute", left: Dimensions.get("window").width - 65, top: 100, }, arrowButton: { position: "absolute", left: Dimensions.get("window").width - 65, top: 160, }, searchResult:{ position:'absolute', backgroundColor:'#fff', height:Dimensions.get("window").height - 100, width:'90%', top:100, borderRadius:10, padding:15 }, searchText:{ fontSize:16, borderBottomWidth:0.6, borderBottomColor:'grey', paddingVertical:10, } });