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