@@ -55,43 +54,14 @@ export default function RobotHeader({
{url?.organizationName} Organization
-
Ankara, Turkiye
+ );
+}
diff --git a/src/components/VersionViewer/VersionViewer.tsx b/src/components/VersionViewer/VersionViewer.tsx
index 199f0117..b3454624 100644
--- a/src/components/VersionViewer/VersionViewer.tsx
+++ b/src/components/VersionViewer/VersionViewer.tsx
@@ -1,23 +1,24 @@
-import React from "react";
+import React, { ReactElement } from "react";
import packageJSON from "../../../package.json";
+import { envFrontendUrl, isProduction } from "../../helpers/envProvider";
+
+export default function VersionViewer(): ReactElement {
+ const developmentURL = `http://localhost:3000${
+ window.location.href?.split("robolaunch.cloud")[1] || ""
+ }`;
+
+ const productionURL = `${envFrontendUrl}${
+ window.location.href?.split("3000")[1] || ""
+ }`;
-export default function VersionViewer() {
return (
{
- if (process.env.NODE_ENV === "development") {
- window.location.href = `${process.env.REACT_APP_FRONTEND_URL}${
- window.location.href?.split("3000")[1] || ""
- }`;
- } else if (process.env.NODE_ENV === "production") {
- window.location.href = `http://localhost:3000${
- window.location.href?.split("robolaunch.cloud")[1] || ""
- }`;
- }
+ window.location.href = isProduction ? developmentURL : productionURL;
}}
className="fixed bottom-0 right-1 z-50 text-[0.64rem] text-layer-light-700 cursor-crosshair"
>
- {process.env.NODE_ENV === "production" ? "P" : "D"} {packageJSON?.version}
+ {isProduction ? "P" : "D"} {packageJSON?.version}
);
}
diff --git a/src/helpers/envProvider.ts b/src/helpers/envProvider.ts
index 7ad728ac..84a84368 100644
--- a/src/helpers/envProvider.ts
+++ b/src/helpers/envProvider.ts
@@ -1,2 +1,7 @@
export const envOnPremise: boolean =
process.env.REACT_APP_ON_PREMISE === "true" ? true : false;
+
+export const envFrontendUrl: string = process.env.REACT_APP_FRONTEND_URL || "";
+
+export const isProduction: boolean =
+ process.env.NODE_ENV === "production" ? true : false;
diff --git a/src/pages/RobotPage/Overview/Overview.tsx b/src/pages/RobotPage/Overview/Overview.tsx
index 2805defe..3e0d86d5 100644
--- a/src/pages/RobotPage/Overview/Overview.tsx
+++ b/src/pages/RobotPage/Overview/Overview.tsx
@@ -35,12 +35,32 @@ export default function Overview({
component={
envOnPremise ? (