Skip to content

Commit

Permalink
update env
Browse files Browse the repository at this point in the history
  • Loading branch information
SamratSahoo committed Nov 15, 2024
1 parent 13197fc commit e2d7128
Show file tree
Hide file tree
Showing 6 changed files with 748 additions and 679 deletions.
2 changes: 1 addition & 1 deletion mobile/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This env file can be exposed.
DEPLOY_CONTEXT="development"
EXPO_PUBLIC_DEPLOY_CONTEXT="development"
3 changes: 1 addition & 2 deletions mobile/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { userGetUserInfo } from "./actions/User";
import { Role } from "./utils/types";
import { auth } from "./utils/firebase";
import PartnershipsScreen from "./screens/Onboarding/PartnershipsScreen";
import Config from "react-native-config";

SplashScreen.preventAutoHideAsync();

Expand All @@ -55,7 +54,7 @@ export default function App() {
}, [appIsReady]);

useEffect(() => {
if (Config.DEPLOY_CONTEXT === "development") {
if (process.env.EXPO_PUBLIC_DEPLOY_CONTEXT !== "production") {
setInitialRoute(Screens.DEVELOPMENT_SCREEN);
setAppIsReady(true);
} else {
Expand Down
1 change: 0 additions & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.1",
"react-native-config": "^1.5.3",
"react-native-dropdown-picker": "^5.4.2",
"react-native-fiesta": "^0.7.0",
"react-native-get-random-values": "~1.11.0",
Expand Down
4 changes: 1 addition & 3 deletions mobile/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import Config from "react-native-config";

let FIREBASE_API_KEY,
FIREBASE_AUTH_DOMAIN,
FIREBASE_PROJECT_ID,
FIREBASE_STORAGE_BUCKET,
FIREBASE_MESSAGING_SENDER_ID,
FIREBASE_APP_ID;

if (Config.DEPLOY_CONTEXT === "production") {
if (process.env.EXPO_PUBLIC_DEPLOY_CONTEXT === "production") {
FIREBASE_API_KEY = "AIzaSyAJfZOc0HTD2nFQwPgvxJ67hzF4VF12Ut4";
FIREBASE_AUTH_DOMAIN = "healing4heroes-bdd64.firebaseapp.com";
FIREBASE_PROJECT_ID = "healing4heroes-bdd64";
Expand Down
4 changes: 1 addition & 3 deletions mobile/utils/urls.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Config from "react-native-config";

function getBaseURL() {
if (Config.DEPLOY_CONTEXT === "production") {
if (process.env.EXPO_PUBLIC_DEPLOY_CONTEXT === "production") {
return `https://healing4heroes.netlify.app`;
}

Expand Down
Loading

0 comments on commit e2d7128

Please sign in to comment.