From 8772a0722ecfb6bceed0cfccfce66d0e7cdba331 Mon Sep 17 00:00:00 2001 From: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:25:12 +0200 Subject: [PATCH] fix(admin-ui): Wrap invite route in AnalyticsProvider (#5111) * fix(admin-ui): Wrap invite route in AnalyticsProvider * Create nervous-keys-impress.md --- .changeset/nervous-keys-impress.md | 6 + packages/admin-ui/ui/src/pages/invite.tsx | 158 +++++++++++----------- 2 files changed, 88 insertions(+), 76 deletions(-) create mode 100644 .changeset/nervous-keys-impress.md diff --git a/.changeset/nervous-keys-impress.md b/.changeset/nervous-keys-impress.md new file mode 100644 index 0000000000..d18e27ec9c --- /dev/null +++ b/.changeset/nervous-keys-impress.md @@ -0,0 +1,6 @@ +--- +"@medusajs/admin-ui": patch +"@medusajs/admin": patch +--- + +fix(admin-ui): Wrap invite route in AnalyticsProvider diff --git a/packages/admin-ui/ui/src/pages/invite.tsx b/packages/admin-ui/ui/src/pages/invite.tsx index b18303768d..13d0657f71 100644 --- a/packages/admin-ui/ui/src/pages/invite.tsx +++ b/packages/admin-ui/ui/src/pages/invite.tsx @@ -13,11 +13,15 @@ import useNotification from "../hooks/use-notification" import { getErrorMessage } from "../utils/error-messages" import FormValidator from "../utils/form-validator" import { useAdminCreateAnalyticsConfig } from "../services/analytics" -import { useAnalytics } from "../providers/analytics-provider" +import { + AnalyticsProvider, + useAnalytics, +} from "../providers/analytics-provider" import AnalyticsConfigForm, { AnalyticsConfigFormType, } from "../components/organisms/analytics-config-form" import { nestedForm } from "../utils/nested-form" +import { WRITE_KEY } from "../constants/analytics" type FormValues = { password: string @@ -151,88 +155,90 @@ const InvitePage = () => { } return ( - - - {signUp ? ( -
-
-

- Create your Medusa account + + + + {signUp ? ( + +
+

+ Create your Medusa account +

+
+
+ +
+
+ +
+
+ + +
+
+
+ +
+ +

+ Already signed up? Log in +

+
+ + ) : ( +
+

+ {first_run + ? `Let's get you started!` + : `You have been invited to join the team`}

-
-
- -
-
- -
-
- - -
-
-
- -
+ {first_run ? ( +

+ Create an admin account to access your
Medusa dashboard. +

+ ) : ( +

+ You can now join the team. Sign up below and get started +
+ with your Medusa account right away. +

+ )} -

- Already signed up? Log in -

- - ) : ( -
-

- {first_run - ? `Let's get you started!` - : `You have been invited to join the team`} -

- {first_run ? ( -

- Create an admin account to access your
Medusa dashboard. -

- ) : ( -

- You can now join the team. Sign up below and get started -
- with your Medusa account right away. -

- )} - -
- )} -
+ )} + +
) }