From 80d64e04441ced7caecd238ae232e749d8e0dddf Mon Sep 17 00:00:00 2001 From: realtradam Date: Tue, 21 May 2024 23:32:53 -0400 Subject: initial setup of seperating frontend --- src/components/Layout.jsx | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/components/Layout.jsx (limited to 'src/components/Layout.jsx') diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx new file mode 100644 index 0000000..79e7813 --- /dev/null +++ b/src/components/Layout.jsx @@ -0,0 +1,60 @@ +import React from "react"; +import { Outlet, Link } from "react-router-dom"; +import Button from "./Button"; +export default function Layout ({userData}) +{ + console.log(userData); + //const [userData, setUserData] = useState({ name: "" }); + + // if the user tries to access the isolated domain then we redirect them + // this is NOT done for security, only for good UX + // rails serves the react app no matter what + // so the app would be broken when served on the isolated domain + const domain = window.location.host; + console.log(domain); + if(domain === "localhost:3000") + { + window.location.replace("http://127.0.0.1:3000"); + } + + return ( + <> +
+ + +
+
+
+
+
+
+
+ + + ) +}; -- cgit v1.2.3