diff --git a/.env.example b/.env.example index 437d32fa..968ce637 100644 --- a/.env.example +++ b/.env.example @@ -12,4 +12,5 @@ VITE_APP_FIREBASE_STORAGEBUCKET= VITE_APP_FIREBASE_MESSAGINGSENDERID= VITE_APP_FIREBASE_APPID= VITE_APP_IOS_APIKEY= -VITE_APP_ANDROID_APIKEY= \ No newline at end of file +VITE_APP_ANDROID_APIKEY= +VITE_APP_PUBLIC_IMG_URL= \ No newline at end of file diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 6398b99d..cf80748c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -17,11 +17,12 @@ jobs: env: CI: false VITE_APP_YBUG_ID: 01m1nn5zqystt1qq5n11 - VITE_APP_PUBLIC_API_URL: https://api-stage.escolalms.com + VITE_APP_PUBLIC_API_URL: https://demo-stage.api.s.wellms.io VITE_APP_SENTRYDSN: https://1abed5b3f95e41be8e1c39c33af12506@sentry.etd24.pl/96 VITE_APP_ROUTING_TYPE: HashRouter # VITE_APP_PUBLIC_MOBILE_DEVICE: false - VITE_APP_PUBLIC_URL: https://demo-stage.escolalms.com + VITE_APP_PUBLIC_URL: https://demo-stage.app.s.wellms.io + VITE_APP_PUBLIC_IMG_URL: https://wellms-multidomain-demo-stage.s3.pl-waw.scw.cloud run: | npm i --legacy-peer-deps npm run build diff --git a/config/php/index.php b/config/php/index.php index 623de2c3..079c882a 100644 --- a/config/php/index.php +++ b/config/php/index.php @@ -46,6 +46,9 @@ if (isset($setup['VITE_APP_URL'])) { $content = preg_replace('/(?<=window.VITE_APP_URL=")(.*)(?=")/', $setup['VITE_APP_URL'], $content); } + if (isset($setup['VITE_APP_PUBLIC_IMG_URL'])) { + $content = preg_replace('/(?<=window.VITE_APP_PUBLIC_IMG_URL=")(.*)(?=")/', $setup['VITE_APP_PUBLIC_IMG_URL'], $content); + } } } diff --git a/index.html b/index.html index a586829e..6d38dbd0 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,7 @@ window.VITE_APP_FIREBASE_APPID = null; window.VITE_APP_IOS_APIKEY = null; window.VITE_APP_ANDROID_APIKEY = null; + window.VITE_APP_PUBLIC_IMG_URL = null; diff --git a/src/config/index.ts b/src/config/index.ts index c0b3ff0f..cebdafb4 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -47,3 +47,8 @@ export const VITE_APP_ANDROID_APIKEY = window.VITE_APP_ANDROID_APIKEY || import.meta.env.VITE_APP_ANDROID_APIKEY || null; + +export const VITE_APP_PUBLIC_IMG_URL = + window.VITE_APP_PUBLIC_IMG_URL || + import.meta.env.VITE_APP_PUBLIC_IMG_URL || + null; diff --git a/src/index.tsx b/src/index.tsx index 432bc9ba..a5171d86 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,7 +6,7 @@ import WebFont from "webfontloader"; import "./i18n"; import "./sentry"; import { GlobalThemeProvider } from "@escolalms/components/lib/theme/provider"; -import { API_URL } from "./config"; +import { API_URL, VITE_APP_PUBLIC_IMG_URL } from "./config"; declare global { interface Window { @@ -21,6 +21,7 @@ declare global { VITE_APP_FIREBASE_APPID: string; VITE_APP_IOS_APIKEY: string; VITE_APP_ANDROID_APIKEY: string; + VITE_APP_PUBLIC_IMG_URL: string; } } @@ -35,7 +36,11 @@ WebFont.load({ ReactDOM.createRoot(document.getElementById("root") as Element).render( {API_URL ? ( - +