Skip to content

Commit

Permalink
Merge pull request #14 from mocusez/dev-1113
Browse files Browse the repository at this point in the history
chore: work before the data interaction
  • Loading branch information
Poordeveloper authored Nov 16, 2023
2 parents 763e440 + 36d426f commit 8c221ec
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 24 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@radix-ui/react-tooltip": "^1.0.7",
"@t3-oss/env-nextjs": "^0.7.0",
"@tanstack/react-query": "^4.32.6",
"@tanstack/react-table": "^8.10.7",
"@trpc/client": "^10.37.1",
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
Expand Down
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions src/app/[locale]/(dashboard)/layout.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/app/[locale]/(dashboard)/page.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions src/app/[locale]/(mainboard)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { api } from "~/trpc/server";

export default async function Home() {
return (
<div className="flex flex-col">
<p>Hello</p>
</div>
);
}
23 changes: 23 additions & 0 deletions src/app/[locale]/(mainboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { redirect } from "next/navigation";
import { BodyLayout } from "~/components/body-layout";
import { SiteFooter } from "~/components/site-footer";
import { getServerAuthSession } from "~/server/auth";

export default async function Layout({
children,
}: {
children: React.ReactNode;
}) {
//Check if user is logged in
const session = await getServerAuthSession();
if (!session) {
redirect("/login");
}

return (
<>
<BodyLayout>{children}</BodyLayout>
<SiteFooter className="border-t" />
</>
);
}
3 changes: 3 additions & 0 deletions src/app/[locale]/(mainboard)/machines/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default async function Machines() {
return <div>Machines</div>;
}
5 changes: 5 additions & 0 deletions src/app/[locale]/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from "next/navigation";

export async function GET() {
redirect("/dashboard");
}
4 changes: 1 addition & 3 deletions src/components/body-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export function BodyLayout({ children }: { children: React.ReactNode }) {
</nav>
</Collapsible>
</aside>
<main className="flex min-h-screen w-full flex-col overflow-y-auto ">
{children}
</main>
<main className="flex w-full flex-col overflow-y-auto ">{children}</main>
</div>
);
}
2 changes: 1 addition & 1 deletion src/config/control-board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const controlboardConfig: ControlBoardConfig = {
sidebarUpNav: [
{
title: "Dashboard",
href: "/",
href: "/dashboard",
icon: "dashboard",
},
{
Expand Down

0 comments on commit 8c221ec

Please sign in to comment.