From 08ee5342336cc51241f3751fe3606de70612b055 Mon Sep 17 00:00:00 2001
From: Winston Hsiao
Date: Sun, 10 Nov 2024 10:39:41 -0500
Subject: [PATCH] Improve onboarding flow and adjust to new styling
---
frontend/src/components/pages/Profile.tsx | 24 ++++++-----
.../src/components/pages/SellerDashboard.tsx | 41 +++++++++----------
.../src/components/pages/SellerOnboarding.tsx | 15 ++++---
frontend/src/components/ui/button.tsx | 2 +-
frontend/src/lib/types/routes.ts | 1 -
5 files changed, 43 insertions(+), 40 deletions(-)
diff --git a/frontend/src/components/pages/Profile.tsx b/frontend/src/components/pages/Profile.tsx
index d5aac4f9..6454a14b 100644
--- a/frontend/src/components/pages/Profile.tsx
+++ b/frontend/src/components/pages/Profile.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
-import { useNavigate } from "react-router-dom";
+import { Link, useNavigate } from "react-router-dom";
import { useTypedParams } from "react-router-typesafe-routes/dom";
import MyListingGrid from "@/components/listings/MyListingGrid";
@@ -201,7 +201,7 @@ export const RenderProfile = (props: RenderProfileProps) => {
{user.username}
{user.permissions && (
-
+
{getRoleName(user.permissions)}
)}
@@ -391,9 +391,11 @@ export const RenderProfile = (props: RenderProfileProps) => {
Stripe account setup complete.
- ) : null}
+ ) : (
+ You must complete seller onboarding to sell robots
+ )}
-
+
{!user.stripe_connect_account_id ? (
-
+
) : !user.stripe_connect_onboarding_completed ? (
-
+
) : (
-
+
)}
diff --git a/frontend/src/components/pages/SellerDashboard.tsx b/frontend/src/components/pages/SellerDashboard.tsx
index 443f06e6..b0d02725 100644
--- a/frontend/src/components/pages/SellerDashboard.tsx
+++ b/frontend/src/components/pages/SellerDashboard.tsx
@@ -39,30 +39,27 @@ export default function SellerDashboard() {
}
return (
-
-
-
Seller Dashboard
+
+
+
Seller Dashboard
-
-
Account Status
-
-
-
- Your K-Scale seller account is active and ready to receive
- payments.
-
-
+
Account Status
+
+
+
+ Your K-Scale seller account is active and ready to receive payments.
+
+
-
+
diff --git a/frontend/src/components/pages/SellerOnboarding.tsx b/frontend/src/components/pages/SellerOnboarding.tsx
index 3db88462..e14f8998 100644
--- a/frontend/src/components/pages/SellerOnboarding.tsx
+++ b/frontend/src/components/pages/SellerOnboarding.tsx
@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import Spinner from "@/components/ui/Spinner";
+import { Button } from "@/components/ui/button";
import { useAlertQueue } from "@/hooks/useAlertQueue";
import { useAuthentication } from "@/hooks/useAuth";
import { useStripeConnect } from "@/hooks/useStripeConnect";
@@ -82,7 +83,7 @@ export default function SellerOnboarding() {
return (
-
Start Selling on K-Scale
+
Start Selling on K-Scale
{!connectedAccountId && (
@@ -91,15 +92,15 @@ export default function SellerOnboarding() {
robots and receiving payments.
-
+
)}
@@ -108,6 +109,10 @@ export default function SellerOnboarding() {
{
setOnboardingExited(true);
+ auth.fetchCurrentUser();
+ if (auth.currentUser?.stripe_connect_onboarding_completed) {
+ navigate(ROUTES.SELL.DASHBOARD.path);
+ }
}}
/>
@@ -122,7 +127,7 @@ export default function SellerOnboarding() {
Connected account ID:{" "}
-
+
{connectedAccountId}
diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsx
index 24b2688c..0221c1e5 100644
--- a/frontend/src/components/ui/button.tsx
+++ b/frontend/src/components/ui/button.tsx
@@ -14,7 +14,7 @@ const buttonVariants = cva(
selected: "bg-gray-12 text-gray-1 border border-gray-1",
destructive:
"bg-destructive text-gray-1 shadow-sm hover:bg-destructive/90",
- outline: "border border-gray-1 bg-gray-12 text-gray-1",
+ outline: "border border-gray-1 bg-gray-12 text-gray-1 hover:bg-gray-11",
ghost: "text-gray-1 border border-transparent hover:border-gray-1",
link: "text-gray-1 underline-offset-4 hover:underline",
},
diff --git a/frontend/src/lib/types/routes.ts b/frontend/src/lib/types/routes.ts
index 9a505d54..ec6a6647 100644
--- a/frontend/src/lib/types/routes.ts
+++ b/frontend/src/lib/types/routes.ts
@@ -50,7 +50,6 @@ const ROUTES = {
"sell",
{},
{
- DASHBOARD: route("dashboard"),
ONBOARDING: route("onboarding"),
DASHBOARD: route("dashboard"),
DELETE: route("delete"),