Add dynamic builkd for rome/imex
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
const IS_ROME = process.env.APP_VARIANT === 'ROME';
|
||||
|
||||
export default ({ config }) => {
|
||||
//console.log("Expo", JSON.stringify(config, null, 2))
|
||||
return ({
|
||||
|
||||
const newConfig = ({
|
||||
...config,
|
||||
name: IS_ROME ? "Rome Mobile" : "ImEX Mobile",
|
||||
slug: IS_ROME ? "rome-mobile" : "imexmobile",
|
||||
extra: {
|
||||
...config.extra,
|
||||
appVariant: process.env.APP_VARIANT || 'IMEX',
|
||||
eas: {
|
||||
...config.extra.eas,
|
||||
projectId: IS_ROME ? "df105e21-a07f-4425-af10-2200a7704a48" : "ffe01f3a-d507-4698-82cd-da1f1cad450b"
|
||||
@@ -54,4 +55,7 @@ export default ({ config }) => {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
console.log("New Expo Config:", JSON.stringify(newConfig, null, 2));
|
||||
return newConfig;
|
||||
};
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@@ -1,4 +1,4 @@
|
||||
<babeledit_project be_version="2.7.1" version="1.2">
|
||||
<babeledit_project version="1.2" be_version="2.7.1">
|
||||
<!--
|
||||
|
||||
BabelEdit project file
|
||||
@@ -66,6 +66,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>title_rome</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
|
||||
@@ -64,7 +64,7 @@ export default function GlobalSearch() {
|
||||
setError("No results available. Try again.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Search error:", error);
|
||||
console.error("Search error:", error, error.response);
|
||||
setError(error.message);
|
||||
}
|
||||
setLoading(false);
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import Constants from "expo-constants";
|
||||
import { Image } from "expo-image";
|
||||
import { Formik } from "formik";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Image, StyleSheet, View } from "react-native";
|
||||
import { StyleSheet, View } from "react-native";
|
||||
import { Button, Text, TextInput } from "react-native-paper";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { emailSignInStart } from "../../redux/user/user.actions";
|
||||
import SignInError from "./sign-in-error";
|
||||
|
||||
import {
|
||||
selectCurrentUser,
|
||||
selectSigningIn,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import SignInError from "./sign-in-error";
|
||||
//import SignInErrorAlertComponent from "../sign-in-error-alert/sign-in-error-alert.component";
|
||||
import Constants from "expo-constants";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
@@ -38,9 +38,18 @@ export function SignIn({ emailSignInStart, signingIn }) {
|
||||
<View style={styles.imageContainer}>
|
||||
<Image
|
||||
style={styles.logo}
|
||||
source={require("@/assets/images/logo192.png")}
|
||||
contentFit="contain"
|
||||
source={
|
||||
Constants?.expoConfig?.extra?.appVariant === "ROME"
|
||||
? require("@/assets/images/RomeOnlineIcon.png")
|
||||
: require("@/assets/images/logo192.png")
|
||||
}
|
||||
/>
|
||||
<Text variant="headlineLarge">{t("app.title")}</Text>
|
||||
<Text variant="headlineLarge">
|
||||
{Constants?.expoConfig?.extra?.appVariant === "ROME"
|
||||
? t("app.title_rome")
|
||||
: t("app.title")}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<Formik initialValues={{ email: "", password: "" }} onSubmit={formSubmit}>
|
||||
@@ -82,7 +91,7 @@ export function SignIn({ emailSignInStart, signingIn }) {
|
||||
|
||||
<Text style={styles.footer}>
|
||||
{t("settings.labels.version", {
|
||||
number: Constants.expoConfig.version,
|
||||
number: Constants.expoConfig?.version,
|
||||
})}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -103,10 +112,7 @@ const styles = StyleSheet.create({
|
||||
justifyContent: "center",
|
||||
gap: 10,
|
||||
},
|
||||
logo: {
|
||||
maxWidth: "20%",
|
||||
resizeMode: "contain",
|
||||
},
|
||||
logo: { width: "100", height: "100" },
|
||||
formContainer: {
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
|
||||
6
env.js
6
env.js
@@ -1,3 +1,4 @@
|
||||
import Constants from "expo-constants";
|
||||
import * as Updates from "expo-updates";
|
||||
|
||||
const ENV = {
|
||||
@@ -62,11 +63,12 @@ const ENV = {
|
||||
},
|
||||
}
|
||||
};
|
||||
const IS_ROME = process.env.APP_VARIANT === 'ROME';
|
||||
const IS_ROME = Constants?.expoConfig?.extra?.appVariant === 'ROME';
|
||||
//console.log("*** ~ Constants?.expoConfig?.extra:", Constants?.expoConfig);
|
||||
|
||||
function getEnvVars() {
|
||||
if (Updates.channel !== "production") return IS_ROME ? ENV.rometest : ENV.test;
|
||||
else return IS_ROME ? ENV.romeprod : ENV.prod;
|
||||
}
|
||||
console.log(IS_ROME, process.env, "ENV: ", getEnvVars());
|
||||
console.log('APP_VARIANT:', Constants?.expoConfig?.extra?.appVariant, 'IS_ROME:', IS_ROME, "ENV: ", getEnvVars());
|
||||
export default getEnvVars();
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
"eject": "expo eject",
|
||||
"setup:imex": "cp configs/imex/google-services.json ./google-services.json && cp configs/imex/GoogleService-Info.plist ./GoogleService-Info.plist",
|
||||
"setup:rome": "cp configs/rome/google-services.json ./google-services.json && cp configs/rome/GoogleService-Info.plist ./GoogleService-Info.plist",
|
||||
"start:imex": "npm run setup:imex && APP_VARIANT=IMEX npm start",
|
||||
"start:rome": "npm run setup:rome && APP_VARIANT=ROME npm start",
|
||||
"start:imex": "npm run setup:imex && npm start",
|
||||
"start:rome": "npm run setup:rome && npm start",
|
||||
"release:test": "expo publish --release-channel test",
|
||||
"release:production": "expo publish --release-channel production",
|
||||
"build:production": "eas build --profile production",
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"translation": {
|
||||
"app": {
|
||||
"nomobileaccess": "Your shop does not currently have access to ImEX Mobile. ",
|
||||
"title": "ImEX Mobile"
|
||||
"nomobileaccess": "Your shop does not currently have access to the mobile app. ",
|
||||
"title": "ImEX Mobile",
|
||||
"title_rome": "Rome Mobile"
|
||||
},
|
||||
"camera": {
|
||||
"titles": {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"translation": {
|
||||
"app": {
|
||||
"nomobileaccess": "",
|
||||
"title": ""
|
||||
"title": "",
|
||||
"title_rome": ""
|
||||
},
|
||||
"camera": {
|
||||
"titles": {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"translation": {
|
||||
"app": {
|
||||
"nomobileaccess": "",
|
||||
"title": ""
|
||||
"title": "",
|
||||
"title_rome": ""
|
||||
},
|
||||
"camera": {
|
||||
"titles": {
|
||||
|
||||
Reference in New Issue
Block a user