Skip to content

feat(next): done - add title to pages #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/web/src/app/[orgShortCode]/convo/[convoId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MessagesPanel } from './_components/messages-panel';
import TopBar from './_components/top-bar';
import { ReplyBox } from './_components/reply-box';
import { Button } from '@/src/components/shadcn-ui/button';
import Metadata from '@/src/components/metadata';

const STORAGE_URL = env('NEXT_PUBLIC_STORAGE_URL');

Expand Down Expand Up @@ -79,6 +80,15 @@ function ConvoView({ convoId }: { convoId: TypeId<'convos'> }) {

return (
<div className="flex h-full max-h-full w-full max-w-full flex-col overflow-hidden rounded-2xl">
<Metadata
title={
'Convo' +
(convoData?.data.subjects.length
? ` - ${convoData?.data.subjects.map((s) => s.subject).join(', ')}`
: ' - UnInbox')
}
description=""
/>
<TopBar
isConvoLoading={convoDataLoading}
convoId={convoId}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
import { type TypeId } from '@u22n/utils/typeid';
Expand Down Expand Up @@ -29,6 +30,10 @@ export default function Page({

return (
<div className="flex h-full w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Addresses"
description="Manage your organization"
/>
<div className="flex w-full gap-4 py-2">
<Button
asChild
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand All @@ -15,6 +16,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Addresses"
description="Manage your organization"
/>
<div className="flex w-full justify-between">
<div className="flex flex-col gap-2">
<h1 className="font-display text-3xl leading-5">Addresses</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { Button } from '@/src/components/shadcn-ui/button';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand Down Expand Up @@ -46,6 +47,10 @@ export default function Page({

return (
<div className="flex h-full w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Domains"
description="Manage your organization"
/>
<div className="flex w-full gap-4 py-2">
<Button
asChild
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand All @@ -15,6 +16,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Domains"
description="Manage your organization"
/>
<div className="flex w-full justify-between">
<div className="flex flex-col gap-2">
<h1 className="font-display text-3xl leading-5">Domains</h1>
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/app/[orgShortCode]/settings/org/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { useRouter } from 'next/navigation';
import { useState, useMemo } from 'react';
import { Button } from '@/src/components/shadcn-ui/button';
Expand Down Expand Up @@ -67,6 +68,10 @@ export default function ProfileComponent() {

return (
<div className="flex h-full w-full flex-col items-start gap-4 overflow-y-auto p-4">
<Metadata
title="Org Settings - Profile"
description="Manage your organization"
/>
<PageTitle title="Your Profile" />

<div className="flex flex-col gap-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { Button } from '@/src/components/shadcn-ui/button';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand Down Expand Up @@ -30,6 +31,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Billing"
description="Manage your organization"
/>
<PageTitle
title="Billing"
description="Manage your organization's billing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand All @@ -15,6 +16,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Invites"
description="Manage your organization"
/>
<div className="flex w-full justify-between">
<div className="flex flex-col gap-2">
<h1 className="font-display text-3xl leading-5">Invites</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand All @@ -16,6 +17,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Members"
description="Manage your organization"
/>
<div className="flex w-full justify-between">
<div className="flex flex-col gap-2">
<h1 className="font-display text-3xl leading-5">Members</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { Button } from '@/src/components/shadcn-ui/button';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
Expand Down Expand Up @@ -32,6 +33,10 @@ export default function Page({

return (
<div className="flex h-full w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Teams"
description="Manage your organization"
/>
<div className="flex w-full gap-4">
<Button
asChild
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { api } from '@/src/lib/trpc';
import { useGlobalStore } from '@/src/providers/global-store-provider';
Expand All @@ -15,6 +16,10 @@ export default function Page() {

return (
<div className="flex w-full flex-col gap-2 p-4">
<Metadata
title="Org Settings - Teams"
description="Manage your organization"
/>
<div className="flex w-full justify-between">
<div className="flex flex-col gap-2">
<h1 className="font-display text-3xl leading-5">Teams</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { DataTable } from '@/src/components/shared/table';
import { useGlobalStore } from '@/src/providers/global-store-provider';
import { api } from '@/src/lib/trpc';
Expand Down Expand Up @@ -32,6 +33,10 @@ export default function Page() {

return (
<div className="flex flex-col gap-4 p-4">
<Metadata
title="Settings - Addresses"
description="Manage your account"
/>
<PageTitle title="Your Addresses" />

{personalAddressesLoading && <Skeleton className="h-10 w-full" />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { AvatarModal } from '@/src/components/shared/avatar-modal';
import { Camera } from '@phosphor-icons/react';
import { useEffect, useState, useMemo } from 'react';
Expand Down Expand Up @@ -84,6 +85,10 @@ export default function Page() {

return (
<div className="flex flex-col gap-3 p-4">
<Metadata
title="Settings - Profile"
description="Manage your account"
/>
<PageTitle title="Your Profile" />

<div className="flex flex-col gap-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import Metadata from '@/src/components/metadata';
import { useEffect, useState } from 'react';
import { api } from '@/src/lib/trpc';
import { VerificationModal } from './_components/verification-modal';
Expand Down Expand Up @@ -158,6 +159,10 @@ export default function Page() {

return (
<div className="flex flex-col gap-4 p-4">
<Metadata
title="Settings - Security"
description="Manage your account"
/>
<PageTitle
title="Security"
description="Manage your account security"
Expand Down
11 changes: 7 additions & 4 deletions apps/web/src/app/layout.tsx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug opening convos because the "TooltipProvider" wasn't present

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this issue in a recent PR, this issue was introduced in a previous PR. The fixed PR is not merged yet.
You can fix the issue in your PR for now. I will rebase this PR before merging

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TooltipProvider } from '@/src/components/shadcn-ui/tooltip';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import localFont from 'next/font/local';
Expand Down Expand Up @@ -55,10 +56,12 @@ export default function RootLayout({
defaultTheme="system"
disableTransitionOnChange>
<div className="flex h-svh w-full flex-col">
<TRPCReactProvider>
{children}
<Toaster />
</TRPCReactProvider>
<TooltipProvider>
<TRPCReactProvider>
{children}
<Toaster />
</TRPCReactProvider>
</TooltipProvider>
</div>
</ThemeProvider>
</CookiesProvider>
Expand Down
15 changes: 15 additions & 0 deletions apps/web/src/components/metadata.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
interface MetadataProps {
title: string;
description: string;
}
export default function Metadata({ title, description }: MetadataProps) {
return (
<>
<title>{title}</title>
<meta
name="description"
content={description}
/>
</>
);
}