-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.tsx
More file actions
51 lines (47 loc) · 1.21 KB
/
App.tsx
File metadata and controls
51 lines (47 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { StatusBar } from "expo-status-bar";
import { StyleSheet, View, ScrollView } from "react-native";
import {
SafeAreaProvider,
useSafeAreaInsets,
} from "react-native-safe-area-context";
import { InstantSearch } from "react-instantsearch-core";
import { Heading } from "./components/Heading";
import { BookList } from "./components/BookList";
import { SearchInput } from "./components/SearchInput";
import { searchClient } from "./utils/typesense";
function AppContent() {
const insets = useSafeAreaInsets();
return (
<View style={[styles.container, { paddingTop: insets.top }]}>
<ScrollView>
<Heading />
<SearchInput />
<View style={styles.grid}>
<BookList />
</View>
<StatusBar style="auto" />
</ScrollView>
</View>
);
}
export default function App() {
return (
<SafeAreaProvider>
<InstantSearch searchClient={searchClient} indexName="books">
<AppContent />
</InstantSearch>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#222",
},
grid: {
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "center",
paddingHorizontal: 8,
},
});