diff --git a/MyApp.Client/pages/admin.tsx b/MyApp.Client/app/admin/page.tsx similarity index 98% rename from MyApp.Client/pages/admin.tsx rename to MyApp.Client/app/admin/page.tsx index d5cd8ed..da6be96 100644 --- a/MyApp.Client/pages/admin.tsx +++ b/MyApp.Client/app/admin/page.tsx @@ -1,3 +1,5 @@ +'use client' + import { SecondaryButton } from "@servicestack/react" import Page from "@/components/layout-page" import { ValidateAuth, appAuth } from "@/lib/auth" diff --git a/MyApp.Client/pages/bookings-auto.tsx b/MyApp.Client/app/bookings-auto/page.tsx similarity index 88% rename from MyApp.Client/pages/bookings-auto.tsx rename to MyApp.Client/app/bookings-auto/page.tsx index 01ba69c..18854d5 100644 --- a/MyApp.Client/pages/bookings-auto.tsx +++ b/MyApp.Client/app/bookings-auto/page.tsx @@ -1,12 +1,12 @@ +'use client' + import Link from "next/link" import { AutoQueryGrid } from "@servicestack/react" import Page from "@/components/layout-page" import { ValidateAuth } from "@/lib/auth" import SrcPage from "@/components/src-page" -function Index() { - - +function BookingsAuto() { return (
@@ -26,5 +26,4 @@ function Index() { ) } -export default ValidateAuth(Index, {role: 'Employee'}) - +export default ValidateAuth(BookingsAuto, {role: 'Employee'}) diff --git a/MyApp.Client/pages/bookings-custom.tsx b/MyApp.Client/app/bookings-custom/page.tsx similarity index 96% rename from MyApp.Client/pages/bookings-custom.tsx rename to MyApp.Client/app/bookings-custom/page.tsx index 128df9b..cc724ec 100644 --- a/MyApp.Client/pages/bookings-custom.tsx +++ b/MyApp.Client/app/bookings-custom/page.tsx @@ -1,11 +1,13 @@ -import { useState, useEffect } from "react" +'use client' + +import { useState } from "react" import Link from "next/link" import { useFormatters, AutoQueryGrid, TextLink, PreviewFormat, AutoEditForm, Icon } from "@servicestack/react" import Page from "@/components/layout-page" import { ValidateAuth } from "@/lib/auth" import SrcPage from "@/components/src-page" -function Index() { +function BookingsCustom() { const { currency } = useFormatters() const [coupon, setCoupon] = useState(null) @@ -76,7 +78,7 @@ function Index() { onSave={() => setCoupon(null)} /> )} - +
@@ -85,5 +87,4 @@ function Index() { ) } -export default ValidateAuth(Index, {role: 'Employee'}) - +export default ValidateAuth(BookingsCustom, {role: 'Employee'}) diff --git a/MyApp.Client/pages/features.mdx b/MyApp.Client/app/features/page.mdx similarity index 98% rename from MyApp.Client/pages/features.mdx rename to MyApp.Client/app/features/page.mdx index 0cdf101..7837dec 100644 --- a/MyApp.Client/pages/features.mdx +++ b/MyApp.Client/app/features/page.mdx @@ -1,4 +1,4 @@ -import Layout from "../components/layout-article" +import Layout from "@/components/layout-article" export const meta = { title: 'Template Features' diff --git a/MyApp.Client/pages/forbidden.tsx b/MyApp.Client/app/forbidden/page.tsx similarity index 86% rename from MyApp.Client/pages/forbidden.tsx rename to MyApp.Client/app/forbidden/page.tsx index 16c6a8a..ebb16d6 100644 --- a/MyApp.Client/pages/forbidden.tsx +++ b/MyApp.Client/app/forbidden/page.tsx @@ -1,5 +1,5 @@ -export default () => { - return (<> +export default function Forbidden() { + return (

403

@@ -7,7 +7,6 @@ export default () => {

You do not have access to this page.

-
- + ) } diff --git a/MyApp.Client/app/layout.tsx b/MyApp.Client/app/layout.tsx new file mode 100644 index 0000000..984b5e8 --- /dev/null +++ b/MyApp.Client/app/layout.tsx @@ -0,0 +1,42 @@ +import "../styles/index.css" +import "../styles/main.css" +import "../styles/prism-dark-blue.css" +import type { Metadata } from 'next' +import Providers from './providers' + +export const metadata: Metadata = { + title: 'Next.js Example', + description: 'Next.js App Router Example', +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + + +