diff --git a/src/NavBar/WebhookStoreUrl/WebhookStoreUrl.component.tsx b/src/NavBar/WebhookStoreUrl/WebhookStoreUrl.component.tsx
index b13a303..4737e92 100644
--- a/src/NavBar/WebhookStoreUrl/WebhookStoreUrl.component.tsx
+++ b/src/NavBar/WebhookStoreUrl/WebhookStoreUrl.component.tsx
@@ -2,11 +2,12 @@ import { Label } from "@pluralsight/ps-design-system-text";
import TextInput from "@pluralsight/ps-design-system-textinput";
import React, { useContext } from "react";
import { WebhookStoreUrlContext } from "./WebhookStoreUrl.context";
+import NavItem from "@pluralsight/ps-design-system-navitem";
export function WebhookStoreUrlInput() {
const { value, setValue } = useContext(WebhookStoreUrlContext);
return (
- <>
+
);
}
diff --git a/src/TopNav.tsx b/src/TopNav.tsx
index ab07548..aca1027 100644
--- a/src/TopNav.tsx
+++ b/src/TopNav.tsx
@@ -7,6 +7,7 @@ import NavItem from "@pluralsight/ps-design-system-navitem";
import { ProxyStatus } from "./NavBar/ProxyStatus/ProxyStatus.component";
import { LoginOrDisplayUser } from "./NavBar/User/LoginOrDisplayUser";
import { StoreConfigNavItem } from "./NavBar/StoreConfig/StoreConfigNavItem";
+import { ENVIRONMENT_KEY } from "./local-storage";
function SkillsLogo() {
return (
@@ -66,13 +67,12 @@ function SkillsBranding(props: any) {
}
export default function TopNav() {
+ const isDevEnv = localStorage.getItem(ENVIRONMENT_KEY) === "development";
return (
}
items={[
-
-
- ,
+ isDevEnv ? : null,
,
,
]}
diff --git a/src/local-storage.ts b/src/local-storage.ts
index e2d7cd8..b87a8c4 100644
--- a/src/local-storage.ts
+++ b/src/local-storage.ts
@@ -1,2 +1,3 @@
export const IDENTITY_TOKEN_KEY = "identityToken";
export const ACCESS_TOKEN_KEY = "accessToken";
+export const ENVIRONMENT_KEY = "environment";
diff --git a/src/main.tsx b/src/main.tsx
index 2f1c381..369bc5b 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -5,6 +5,7 @@ import App from "./App";
import Honeybadger from "@honeybadger-io/js";
import { HoneybadgerErrorBoundary } from "@honeybadger-io/react";
import posthog from "posthog-js";
+import { ENVIRONMENT_KEY } from "./local-storage";
const autoRedirectOnGithubAuth =
window.location.hostname === "github.webhook.store";
@@ -21,7 +22,18 @@ posthog.init(import.meta.env.VITE_POSTHOG_API_KEY as string, {
api_host: "https://app.posthog.com",
});
-posthog.capture("my event", { property: "value" });
+const initEnvInLocalStorage = () => {
+ const env = localStorage.getItem(ENVIRONMENT_KEY);
+ if (!env) {
+ if (window.location.origin.startsWith("http://localhost:")) {
+ localStorage.setItem(ENVIRONMENT_KEY, "development");
+ } else {
+ localStorage.setItem(ENVIRONMENT_KEY, "production");
+ }
+ }
+};
+
+initEnvInLocalStorage();
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement