Skip to content

Commit 71c5298

Browse files
added contentful and making home screen
1 parent 7b0528d commit 71c5298

16 files changed

+492
-314
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ build/
2828
.gradle
2929
local.properties
3030
*.iml
31-
31+
.env
3232
# node.js
3333
#
3434
node_modules/

App.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import React, { useEffect, useReducer } from "react";
1+
import React, { useEffect, useReducer, useState } from "react";
22
import RNBootSplash from "react-native-bootsplash";
3+
import { SafeAreaView } from "react-native";
34
import Routes from "./navigation/Routes";
45
import { defaultState, Provider, reducer } from "./state";
56

@@ -11,10 +12,13 @@ export default function App() {
1112
RNBootSplash.hide({ fade: true });
1213
}, 500);
1314
}, []);
15+
1416
return (
17+
// <SafeAreaView>
1518
<Provider value={{ state, dispatch }}>
1619
<Routes />
1720
</Provider>
21+
// </SafeAreaView>
1822
);
1923
}
2024

android/.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</natures>
1717
<filteredResources>
1818
<filter>
19-
<id>1629383969817</id>
19+
<id>0</id>
2020
<name></name>
2121
<type>30</type>
2222
<matcher>

android/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ dependencies {
195195

196196
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
197197

198+
198199
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
199200
exclude group:'com.facebook.fbjni'
200201
}

android/app/src/main/java/com/aviatecodersappv1/MainActivity.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.os.Bundle;
44
import com.facebook.react.ReactActivity;
5-
import com.zoontek.rnbootsplash.RNBootSplash;
5+
import com.zoontek.rnbootsplash.RNBootSplash;
66

77
public class MainActivity extends ReactActivity {
88

@@ -21,4 +21,5 @@ protected void onCreate(Bundle savedInstanceState) {
2121
RNBootSplash.init(R.drawable.bootsplash, MainActivity.this); // <- display the generated bootsplash.xml drawable over our MainActivity
2222
}
2323

24+
2425
}

babel.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ["module:metro-react-native-babel-preset"],
3+
plugins: [
4+
[
5+
"module:react-native-dotenv",
6+
{
7+
moduleName: "@env",
8+
path: ".env",
9+
},
10+
],
11+
],
312
};

config/env.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {
2+
REACT_APP_CONTENTFUL_SPACE_ID,
3+
REACT_APP_CONTENTFUL_ACCESS_TOKEN,
4+
} from "@env";
5+
6+
export default devEnvironmentVariables = {
7+
REACT_APP_CONTENTFUL_SPACE_ID,
8+
REACT_APP_CONTENTFUL_ACCESS_TOKEN,
9+
};

lib/contentful.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import devEnvironmentVariables from "../config/env";
2+
const contentful = require("contentful/dist/contentful.browser.min.js");
3+
4+
const { REACT_APP_CONTENTFUL_SPACE_ID, REACT_APP_CONTENTFUL_ACCESS_TOKEN } =
5+
devEnvironmentVariables;
6+
7+
export const client = contentful.createClient({
8+
space: REACT_APP_CONTENTFUL_SPACE_ID,
9+
accessToken: REACT_APP_CONTENTFUL_ACCESS_TOKEN,
10+
});

navigation/AppStack.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ function AppStack() {
1414
<Tab.Navigator
1515
initialRouteName="Home"
1616
activeColor="#000"
17-
barStyle={{ backgroundColor: "white" }}
17+
barStyle={{
18+
backgroundColor: "#fff",
19+
shadowRadius: 2,
20+
shadowOffset: {
21+
width: 0,
22+
height: -3,
23+
},
24+
shadowColor: "#000000",
25+
elevation: 4,
26+
}}
1827
>
1928
<Tab.Screen
2029
name="Home"
@@ -24,6 +33,7 @@ function AppStack() {
2433
tabBarIcon: ({ color }) => (
2534
<MaterialIcons name="home" color={color} size={26} />
2635
),
36+
title: "Home",
2737
}}
2838
/>
2939
<Tab.Screen

navigation/Routes.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Routes = () => {
2525
return (
2626
<NavigationContainer>
2727
{state.user ? <AppStack /> : <AuthStack />}
28-
{/* <AuthStack /> */}
2928
</NavigationContainer>
3029
);
3130
};

0 commit comments

Comments
 (0)