Skip to content

The Open Source DocuSign Alternative.

chore: implemented feedback plus some restructuring

Catalin Pit3b82ba57f39c
diff --git a/apps/web/src/app/(dashboard)/settings/token/page.tsx b/apps/web/src/app/(dashboard)/settings/tokens/page.tsx
similarity index 100%
rename from apps/web/src/app/(dashboard)/settings/token/page.tsx
rename to apps/web/src/app/(dashboard)/settings/tokens/page.tsx
diff --git a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
index e488ba6e9..7c06557b1 100644
--- a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
+++ b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
@@ -3,6 +3,7 @@
import Link from 'next/link';
import {
+ Braces,
CreditCard,
Lock,
LogOut,
@@ -97,6 +98,13 @@ export const ProfileDropdown = ({ user }: ProfileDropdownProps) => {
</Link>
</DropdownMenuItem>
+ <DropdownMenuItem asChild>
+ <Link href="/settings/tokens" className="cursor-pointer">
+ <Braces className="mr-2 h-4 w-4" />
+ API Tokens
+ </Link>
+ </DropdownMenuItem>
+
{isBillingEnabled && (
<DropdownMenuItem asChild>
<Link href="/settings/billing" className="cursor-pointer">
diff --git a/apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx b/apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx
index 848ff17cc..8bc395121 100644
--- a/apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx
+++ b/apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx
@@ -48,12 +48,12 @@ export const DesktopNav = ({ className, ...props }: DesktopNavProps) => {
</Button>
</Link>
- <Link href="/settings/token">
+ <Link href="/settings/tokens">
<Button
variant="ghost"
className={cn(
'w-full justify-start',
- pathname?.startsWith('/settings/token') && 'bg-secondary',
+ pathname?.startsWith('/settings/tokens') && 'bg-secondary',
)}
>
<Braces className="mr-2 h-5 w-5" />
diff --git a/apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx b/apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx
index 7482c2f10..9a4436626 100644
--- a/apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx
+++ b/apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx
@@ -51,12 +51,12 @@ export const MobileNav = ({ className, ...props }: MobileNavProps) => {
</Button>
</Link>
- <Link href="/settings/token">
+ <Link href="/settings/tokens">
<Button
variant="ghost"
className={cn(
'w-full justify-start',
- pathname?.startsWith('/settings/token') && 'bg-secondary',
+ pathname?.startsWith('/settings/tokens') && 'bg-secondary',
)}
>
<Braces className="mr-2 h-5 w-5" />
diff --git a/apps/web/src/components/(dashboard)/settings/token/delete-token-dialog.tsx b/apps/web/src/components/(dashboard)/settings/token/delete-token-dialog.tsx
index ba0a4cc99..40c797742 100644
--- a/apps/web/src/components/(dashboard)/settings/token/delete-token-dialog.tsx
+++ b/apps/web/src/components/(dashboard)/settings/token/delete-token-dialog.tsx
@@ -148,7 +148,7 @@ export default function DeleteTokenDialog({ token, onDelete, children }: DeleteT
/>
<DialogFooter>
- <div className="flex w-full flex-1 flex-nowrap gap-4">
+ <div className="flex w-full flex-nowrap gap-4">
<Button
type="button"
variant="secondary"
@@ -161,6 +161,7 @@ export default function DeleteTokenDialog({ token, onDelete, children }: DeleteT
<Button
type="submit"
variant="destructive"
+ className="flex-1"
disabled={!form.formState.isValid}
loading={form.formState.isSubmitting}
>
diff --git a/packages/lib/server-only/public-api/create-api-token.ts b/packages/lib/server-only/public-api/create-api-token.ts
index 9fe74c1f6..9f34481e9 100644
--- a/packages/lib/server-only/public-api/create-api-token.ts
+++ b/packages/lib/server-only/public-api/create-api-token.ts
@@ -25,7 +25,7 @@ export const createApiToken = async ({ userId, tokenName }: CreateApiTokenInput)
});
if (!dbToken) {
- throw new Error(`Failed to create the API token`);
+ throw new Error('Failed to create the API token');
}
return {