Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Improve onboarding layout and workspace form labels

Marcus Farrell5728593fdab9
diff --git a/apps/web/app/app.dub.co/(onboarding)/layout.tsx b/apps/web/app/app.dub.co/(onboarding)/layout.tsx
index 8e65fe3194..2e2d5102eb 100644
--- a/apps/web/app/app.dub.co/(onboarding)/layout.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/layout.tsx
@@ -1,34 +1,43 @@
"use client";
import Toolbar from "@/ui/layout/toolbar/toolbar";
-import { PropsWithChildren } from "react";
+import { PropsWithChildren, useState } from "react";
import { usePathname } from "next/navigation";
-import { signOut } from "next-auth/react";
+import { signOut, useSession } from "next-auth/react";
import { Button } from "@dub/ui";
export default function Layout({ children }: PropsWithChildren) {
const pathname = usePathname();
const isWorkspacePage = pathname === "/onboarding/workspace";
+ const { data: session } = useSession();
+ const [isLoading, setIsLoading] = useState(false);
return (
<>
{children}
<Toolbar show={["help"]} />
{isWorkspacePage && (
- <div className="fixed bottom-0 left-0 z-40 m-5">
+ <div className="fixed bottom-0 left-0 z-40 m-5 flex flex-col gap-2">
+ <div className="flex items-center gap-1 text-neutral-600 text-xs">
+ You're signed in as{" "}
+ {session ? (
+ <b className="text-neutral-800">{session.user?.email}</b>
+ ) : (
+ <span className="h-3 w-32 rounded-md border border-neutral-300 bg-neutral-200" />
+ )}
+ </div>
<Button
variant="secondary"
- text="Back to sign in"
- size="sm"
- onClick={() =>
+ text="Sign in as a different user"
+ onClick={() => {
+ setIsLoading(true);
signOut({
callbackUrl: "/login",
- })
- }
- className="h-8 text-xs rounded-lg px-3 shadow-sm"
- >
- Back to sign in
- </Button>
+ });
+ }}
+ loading={isLoading}
+ className="h-8 text-xs rounded-lg px-3 shadow-sm w-fit"
+ />
</div>
)}
</>
diff --git a/apps/web/ui/workspaces/create-workspace-form.tsx b/apps/web/ui/workspaces/create-workspace-form.tsx
index 9eebc0e207..367970d0b8 100644
--- a/apps/web/ui/workspaces/create-workspace-form.tsx
+++ b/apps/web/ui/workspaces/create-workspace-form.tsx
@@ -116,7 +116,7 @@ export function CreateWorkspaceForm({
<div>
<label htmlFor="name" className="flex items-center space-x-2">
<p className="block text-sm font-medium text-neutral-700">
- Workspace Name
+ Workspace name
</p>
</label>
<div className="mt-2 flex rounded-md shadow-sm">
@@ -138,7 +138,7 @@ export function CreateWorkspaceForm({
<div>
<label htmlFor="slug" className="flex items-center space-x-2">
<p className="block text-sm font-medium text-neutral-700">
- Slug
+ Workspace slug
</p>
</label>
<div className="relative mt-2 flex rounded-md shadow-sm">
@@ -204,7 +204,7 @@ export function CreateWorkspaceForm({
<div>
<label>
<p className="block text-sm font-medium text-neutral-700">
- Logo
+ Workspace logo
</p>
<div className="mt-1.5 flex items-center gap-5">
<Controller