First prototype of image upload working. IO-397 IO-398

This commit is contained in:
Patrick Fic
2020-11-17 13:39:31 -08:00
parent 79ec14fe53
commit cd5f8af9e4
15 changed files with 395 additions and 19 deletions

39
env.js Normal file
View File

@@ -0,0 +1,39 @@
import Constants from "expo-constants";
export const prodUrl = "https://someapp.herokuapp.com";
const ENV = {
dev: {
REACT_APP_CLOUDINARY_ENDPOINT:
"https://api.cloudinary.com/v1_1/bodyshop/image",
REACT_APP_CLOUDINARY_IMAGE_ENDPOINT:
"https://res.cloudinary.com/bodyshop/image/upload",
REACT_APP_CLOUDINARY_API_KEY: "473322739956866",
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS: "h_200,w_200,c_thumb",
},
staging: {
REACT_APP_CLOUDINARY_ENDPOINT:
"https://api.cloudinary.com/v1_1/bodyshop/image",
REACT_APP_CLOUDINARY_IMAGE_ENDPOINT:
"https://res.cloudinary.com/bodyshop/image/upload",
REACT_APP_CLOUDINARY_API_KEY: "473322739956866",
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS: "h_200,w_200,c_thumb",
},
prod: {
REACT_APP_CLOUDINARY_ENDPOINT:
"https://api.cloudinary.com/v1_1/bodyshop/image",
REACT_APP_CLOUDINARY_IMAGE_ENDPOINT:
"https://res.cloudinary.com/bodyshop/image/upload",
REACT_APP_CLOUDINARY_API_KEY: "473322739956866",
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS: "h_200,w_200,c_thumb",
},
};
function getEnvVars(env = "") {
if (env === null || env === undefined || env === "") return ENV.dev;
if (env.indexOf("dev") !== -1) return ENV.dev;
if (env.indexOf("staging") !== -1) return ENV.staging;
if (env.indexOf("prod") !== -1) return ENV.prod;
}
export default getEnvVars(Constants.manifest.releaseChannel);