Skip to content

Commit

Permalink
🚧 add algolia container on app
Browse files Browse the repository at this point in the history
  • Loading branch information
ajubin committed May 16, 2019
1 parent 64f69ac commit fdead91
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALGOLIA_APP_ID=<ALGOLIA_APP_ID>
ALGOLIA_SEARCH_KEY=<ALGOLIA_SEARCH_KEY>
ALGOLIA_INDEX_NAME=<ALGOLIA_INDEX_NAME>
16 changes: 14 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,26 @@
import React, { Component } from "react";
import { StyleSheet, SafeAreaView } from "react-native";
import { SearchBox, InfiniteHits } from "./src/components";
import {
ALGOLIA_APP_ID,
ALGOLIA_INDEX_NAME,
ALGOLIA_SEARCH_KEY,
} from "react-native-dotenv";
import { InstantSearch } from "react-instantsearch-native";

interface Props {}
export class App extends Component<Props> {
render() {
return (
<SafeAreaView style={styles.container}>
<SearchBox />
<InfiniteHits />
<InstantSearch
apiKey={ALGOLIA_SEARCH_KEY}
appId={ALGOLIA_APP_ID}
indexName={ALGOLIA_INDEX_NAME}
>
<SearchBox />
<InfiniteHits />
</InstantSearch>
</SafeAreaView>
);
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"eslint": "^5.15.1",
"react": "16.6.3",
"react-native": "0.58.6",
"react-native-dotenv": "^0.2.0"
"react-native-dotenv": "^0.2.0",
"react-instantsearch": "^5.4.0"
},
"devDependencies": {
"@types/jest": "^24.0.9",
"@types/react": "^16.8.7",
"@types/react-instantsearch": "^5.2.2",
"@types/react-native": "^0.57.38",
"@types/react-test-renderer": "^16.8.1",
"babel-core": "^7.0.0-bridge.0",
Expand Down
Loading

0 comments on commit fdead91

Please sign in to comment.