Updated site
This commit is contained in:
@@ -9,7 +9,6 @@ services:
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
|
||||
- PG_USER=${PG_USER}
|
||||
- PG_PASSWORD=${PG_PASSWORD}
|
||||
- PG_HOST=${PG_HOST}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import type { Metadata } from "next"
|
||||
import { UrlFormCard } from "../../_components/url-form-card"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create"
|
||||
}
|
||||
|
||||
export default async function DashboardCreatePage() {
|
||||
const { session, redirectToSignIn } = await getSession()
|
||||
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import { getUrlById } from "@/lib/db/urls"
|
||||
import type { Metadata } from "next"
|
||||
import { notFound } from "next/navigation"
|
||||
import { UrlFormCard } from "../../../_components/url-form-card"
|
||||
|
||||
export async function generateMetadata({
|
||||
params
|
||||
}: {
|
||||
params: Promise<{ id: string }>
|
||||
}): Promise<Metadata> {
|
||||
const { id } = await params
|
||||
const url = await getUrlById(id)
|
||||
|
||||
return {
|
||||
title: url === undefined ? "Link doesn't exist" : `Edit ${url.title}`
|
||||
}
|
||||
}
|
||||
|
||||
export default async function EditPage({
|
||||
params
|
||||
}: {
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import { getAllUrls } from "@/lib/db/urls"
|
||||
import type { Metadata } from "next"
|
||||
import { UrlsDataTable } from "../../_components/urls-data-table"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "List"
|
||||
}
|
||||
|
||||
export default async function DashboardListPage() {
|
||||
const { session, redirectToSignIn } = await getSession()
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import { getDashboardStats } from "@/lib/dashboard/stats"
|
||||
import { LinkIcon, MousePointerClick, TrendingUp } from "lucide-react"
|
||||
import type { Metadata } from "next"
|
||||
import { UrlFormCard } from "../_components/simple-url-form-card"
|
||||
import { StatsCard } from "../_components/stats-card"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Dashboard"
|
||||
}
|
||||
|
||||
export default async function Dashboard() {
|
||||
const { session, redirectToSignIn } = await getSession()
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import type { Metadata } from "next"
|
||||
import DashBoardTitle from "../../_components/dashboard-title"
|
||||
import { PasskeyAdd } from "../../_components/passkey"
|
||||
import PasskeysList from "../../_components/passkeys-list"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Auth"
|
||||
}
|
||||
|
||||
export default async function UserAuthPage() {
|
||||
const { session, redirectToSignIn } = await getSession()
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { getSession } from "@/lib/auth/session"
|
||||
import type { Metadata } from "next"
|
||||
import DashBoardTitle from "../_components/dashboard-title"
|
||||
import UserProfile from "../_components/user-profile"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "User Profile"
|
||||
}
|
||||
|
||||
export default async function UserPage() {
|
||||
const { session, redirectToSignIn } = await getSession()
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Metadata } from "next"
|
||||
import { ReactNode } from "react"
|
||||
import "./globals.css"
|
||||
import { Toaster } from "@/components/ui/sonner"
|
||||
import { env } from "@/lib/env/client"
|
||||
import { ThemeProvider } from "next-themes"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -15,8 +14,7 @@ export const metadata: Metadata = {
|
||||
keywords: ["URL shortener", "link management", "analytics", "custom slugs", "link tracking", "short links"],
|
||||
authors: [{ name: "Taken" }],
|
||||
creator: "Taken",
|
||||
publisher: "Taken",
|
||||
metadataBase: new URL(env.NEXT_PUBLIC_BASE_URL)
|
||||
publisher: "Taken"
|
||||
}
|
||||
|
||||
export default function RootLayout({
|
||||
|
||||
12
src/lib/env/client.ts
vendored
12
src/lib/env/client.ts
vendored
@@ -1,12 +0,0 @@
|
||||
import { createEnv } from "@t3-oss/env-nextjs"
|
||||
import { z } from "zod"
|
||||
|
||||
export const env = createEnv({
|
||||
client: {
|
||||
NEXT_PUBLIC_BASE_URL: z.url().default("https://l.mairimashita.org")
|
||||
},
|
||||
runtimeEnv: {
|
||||
NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL
|
||||
},
|
||||
emptyStringAsUndefined: true
|
||||
})
|
||||
Reference in New Issue
Block a user