Skip to content

Commit

Permalink
format: code formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiranism committed May 15, 2024
1 parent b74d4f8 commit b995e2e
Show file tree
Hide file tree
Showing 92 changed files with 1,383 additions and 1,305 deletions.
12 changes: 11 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
{}
{
"arrowParens": "always",
"bracketSpacing": true,
"semi": true,
"useTabs": false,
"trailingComma": "none",
"singleQuote": true,
"tabWidth": 2,
"endOfLine": "lf",
"plugins": ["prettier-plugin-tailwindcss"]
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This is a starter template using the following stack:
- Linting - [ESLint](https://eslint.org)
- Formatting - [Prettier](https://prettier.io)

*If you are looking for a React admin dashboard starter, here is the [repo](https://github.com/Kiranism/react-shadcn-dashboard-starter).*
_If you are looking for a React admin dashboard starter, here is the [repo](https://github.com/Kiranism/react-shadcn-dashboard-starter)._

## Pages

Expand Down Expand Up @@ -56,4 +56,3 @@ Follow these steps to clone the repository and start the development server:
- `npm run dev`

You should now be able to access the application at http://localhost:3000.

28 changes: 14 additions & 14 deletions app/(auth)/(signin)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Metadata } from "next";
import Link from "next/link";
import UserAuthForm from "@/components/forms/user-auth-form";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { Metadata } from 'next';
import Link from 'next/link';
import UserAuthForm from '@/components/forms/user-auth-form';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';

export const metadata: Metadata = {
title: "Authentication",
description: "Authentication forms built using the components.",
title: 'Authentication',
description: 'Authentication forms built using the components.'
};

export default function AuthenticationPage() {
Expand All @@ -15,13 +15,13 @@ export default function AuthenticationPage() {
<Link
href="/examples/authentication"
className={cn(
buttonVariants({ variant: "ghost" }),
"absolute right-4 hidden top-4 md:right-8 md:top-8",
buttonVariants({ variant: 'ghost' }),
'absolute right-4 top-4 hidden md:right-8 md:top-8'
)}
>
Login
</Link>
<div className="relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex">
<div className="relative hidden h-full flex-col bg-muted p-10 text-white lg:flex dark:border-r">
<div className="absolute inset-0 bg-zinc-900" />
<div className="relative z-20 flex items-center text-lg font-medium">
<svg
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function AuthenticationPage() {
</blockquote>
</div>
</div>
<div className="p-4 lg:p-8 h-full flex items-center">
<div className="flex h-full items-center p-4 lg:p-8">
<div className="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]">
<div className="flex flex-col space-y-2 text-center">
<h1 className="text-2xl font-semibold tracking-tight">
Expand All @@ -61,14 +61,14 @@ export default function AuthenticationPage() {
</div>
<UserAuthForm />
<p className="px-8 text-center text-sm text-muted-foreground">
By clicking continue, you agree to our{" "}
By clicking continue, you agree to our{' '}
<Link
href="/terms"
className="underline underline-offset-4 hover:text-primary"
>
Terms of Service
</Link>{" "}
and{" "}
</Link>{' '}
and{' '}
<Link
href="/privacy"
className="underline underline-offset-4 hover:text-primary"
Expand Down
14 changes: 7 additions & 7 deletions app/(dashboard)/dashboard/employee/[employeeId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import BreadCrumb from "@/components/breadcrumb";
import { ProductForm } from "@/components/forms/product-form";
import React from "react";
import BreadCrumb from '@/components/breadcrumb';
import { ProductForm } from '@/components/forms/product-form';
import React from 'react';

export default function Page() {
const breadcrumbItems = [
{ title: "Employee", link: "/dashboard/employee" },
{ title: "Create", link: "/dashboard/employee/create" },
{ title: 'Employee', link: '/dashboard/employee' },
{ title: 'Create', link: '/dashboard/employee/create' }
];
return (
<div className="flex-1 space-y-4 p-8">
<BreadCrumb items={breadcrumbItems} />
<ProductForm
categories={[
{ _id: "shirts", name: "shirts" },
{ _id: "pants", name: "pants" },
{ _id: 'shirts', name: 'shirts' },
{ _id: 'pants', name: 'pants' }
]}
initialData={null}
key={null}
Expand Down
30 changes: 15 additions & 15 deletions app/(dashboard)/dashboard/employee/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import BreadCrumb from "@/components/breadcrumb";
import { columns } from "@/components/tables/employee-tables/columns";
import { EmployeeTable } from "@/components/tables/employee-tables/employee-table";
import { buttonVariants } from "@/components/ui/button";
import { Heading } from "@/components/ui/heading";
import { Separator } from "@/components/ui/separator";
import { Employee } from "@/constants/data";
import { cn } from "@/lib/utils";
import { Plus } from "lucide-react";
import Link from "next/link";
import BreadCrumb from '@/components/breadcrumb';
import { columns } from '@/components/tables/employee-tables/columns';
import { EmployeeTable } from '@/components/tables/employee-tables/employee-table';
import { buttonVariants } from '@/components/ui/button';
import { Heading } from '@/components/ui/heading';
import { Separator } from '@/components/ui/separator';
import { Employee } from '@/constants/data';
import { cn } from '@/lib/utils';
import { Plus } from 'lucide-react';
import Link from 'next/link';

const breadcrumbItems = [{ title: "Employee", link: "/dashboard/employee" }];
const breadcrumbItems = [{ title: 'Employee', link: '/dashboard/employee' }];

type paramsProps = {
searchParams: {
Expand All @@ -25,15 +25,15 @@ export default async function page({ searchParams }: paramsProps) {

const res = await fetch(
`https://api.slingacademy.com/v1/sample-data/users?offset=${offset}&limit=${pageLimit}` +
(country ? `&search=${country}` : ""),
(country ? `&search=${country}` : '')
);
const employeeRes = await res.json();
const totalUsers = employeeRes.total_users; //1000
const pageCount = Math.ceil(totalUsers / pageLimit);
const employee: Employee[] = employeeRes.users;
return (
<>
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<div className="flex-1 space-y-4 p-4 pt-6 md:p-8">
<BreadCrumb items={breadcrumbItems} />

<div className="flex items-start justify-between">
Expand All @@ -43,8 +43,8 @@ export default async function page({ searchParams }: paramsProps) {
/>

<Link
href={"/dashboard/employee/new"}
className={cn(buttonVariants({ variant: "default" }))}
href={'/dashboard/employee/new'}
className={cn(buttonVariants({ variant: 'default' }))}
>
<Plus className="mr-2 h-4 w-4" /> Add New
</Link>
Expand Down
12 changes: 6 additions & 6 deletions app/(dashboard)/dashboard/kanban/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import BreadCrumb from "@/components/breadcrumb";
import { KanbanBoard } from "@/components/kanban/kanban-board";
import NewTaskDialog from "@/components/kanban/new-task-dialog";
import { Heading } from "@/components/ui/heading";
import BreadCrumb from '@/components/breadcrumb';
import { KanbanBoard } from '@/components/kanban/kanban-board';
import NewTaskDialog from '@/components/kanban/new-task-dialog';
import { Heading } from '@/components/ui/heading';

const breadcrumbItems = [{ title: "Kanban", link: "/dashboard/kanban" }];
const breadcrumbItems = [{ title: 'Kanban', link: '/dashboard/kanban' }];
export default function page() {
return (
<>
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<div className="flex-1 space-y-4 p-4 pt-6 md:p-8">
<BreadCrumb items={breadcrumbItems} />
<div className="flex items-start justify-between">
<Heading title={`Kanban`} description="Manage tasks by dnd" />
Expand Down
12 changes: 6 additions & 6 deletions app/(dashboard)/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Header from "@/components/layout/header";
import Sidebar from "@/components/layout/sidebar";
import type { Metadata } from "next";
import Header from '@/components/layout/header';
import Sidebar from '@/components/layout/sidebar';
import type { Metadata } from 'next';

export const metadata: Metadata = {
title: "Next Shadcn Dashboard Starter",
description: "Basic dashboard with Next.js and Shadcn",
title: 'Next Shadcn Dashboard Starter',
description: 'Basic dashboard with Next.js and Shadcn'
};

export default function DashboardLayout({
children,
children
}: {
children: React.ReactNode;
}) {
Expand Down
22 changes: 11 additions & 11 deletions app/(dashboard)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { CalendarDateRangePicker } from "@/components/date-range-picker";
import { Overview } from "@/components/overview";
import { RecentSales } from "@/components/recent-sales";
import { Button } from "@/components/ui/button";
import { CalendarDateRangePicker } from '@/components/date-range-picker';
import { Overview } from '@/components/overview';
import { RecentSales } from '@/components/recent-sales';
import { Button } from '@/components/ui/button';
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
CardTitle
} from '@/components/ui/card';
import { ScrollArea } from '@/components/ui/scroll-area';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';

export default function page() {
return (
<ScrollArea className="h-full">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<div className="flex-1 space-y-4 p-4 pt-6 md:p-8">
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">
Hi, Welcome back 👋
</h2>
<div className="hidden md:flex items-center space-x-2">
<div className="hidden items-center space-x-2 md:flex">
<CalendarDateRangePicker />
<Button>Download</Button>
</div>
Expand Down Expand Up @@ -136,7 +136,7 @@ export default function page() {
</CardContent>
</Card>
</div>
<div className="grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-7">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-7">
<Card className="col-span-4">
<CardHeader>
<CardTitle>Overview</CardTitle>
Expand Down
10 changes: 5 additions & 5 deletions app/(dashboard)/dashboard/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import BreadCrumb from "@/components/breadcrumb";
import { CreateProfileOne } from "@/components/forms/user-profile-stepper/create-profile";
import { ScrollArea } from "@/components/ui/scroll-area";
import BreadCrumb from '@/components/breadcrumb';
import { CreateProfileOne } from '@/components/forms/user-profile-stepper/create-profile';
import { ScrollArea } from '@/components/ui/scroll-area';

const breadcrumbItems = [{ title: "Profile", link: "/dashboard/profile" }];
const breadcrumbItems = [{ title: 'Profile', link: '/dashboard/profile' }];
export default function page() {
return (
<ScrollArea className="h-full">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<div className="flex-1 space-y-4 p-4 pt-6 md:p-8">
<BreadCrumb items={breadcrumbItems} />
<CreateProfileOne categories={[]} initialData={null} />
</div>
Expand Down
16 changes: 8 additions & 8 deletions app/(dashboard)/dashboard/user/[userId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import BreadCrumb from "@/components/breadcrumb";
import { ProductForm } from "@/components/forms/product-form";
import { ScrollArea } from "@/components/ui/scroll-area";
import React from "react";
import BreadCrumb from '@/components/breadcrumb';
import { ProductForm } from '@/components/forms/product-form';
import { ScrollArea } from '@/components/ui/scroll-area';
import React from 'react';

export default function Page() {
const breadcrumbItems = [
{ title: "User", link: "/dashboard/user" },
{ title: "Create", link: "/dashboard/user/create" },
{ title: 'User', link: '/dashboard/user' },
{ title: 'Create', link: '/dashboard/user/create' }
];
return (
<ScrollArea className="h-full">
<div className="flex-1 space-y-4 p-5">
<BreadCrumb items={breadcrumbItems} />
<ProductForm
categories={[
{ _id: "shirts", name: "shirts" },
{ _id: "pants", name: "pants" },
{ _id: 'shirts', name: 'shirts' },
{ _id: 'pants', name: 'pants' }
]}
initialData={null}
key={null}
Expand Down
10 changes: 5 additions & 5 deletions app/(dashboard)/dashboard/user/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import BreadCrumb from "@/components/breadcrumb";
import { UserClient } from "@/components/tables/user-tables/client";
import { users } from "@/constants/data";
import BreadCrumb from '@/components/breadcrumb';
import { UserClient } from '@/components/tables/user-tables/client';
import { users } from '@/constants/data';

const breadcrumbItems = [{ title: "User", link: "/dashboard/user" }];
const breadcrumbItems = [{ title: 'User', link: '/dashboard/user' }];
export default function page() {
return (
<>
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<div className="flex-1 space-y-4 p-4 pt-6 md:p-8">
<BreadCrumb items={breadcrumbItems} />
<UserClient data={users} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { authOptions } from "@/lib/auth-options";
import NextAuth from "next-auth/next";
import { authOptions } from '@/lib/auth-options';
import NextAuth from 'next-auth/next';

const handler = NextAuth(authOptions);

Expand Down
10 changes: 5 additions & 5 deletions app/api/uploadthing/core.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { createUploadthing, type FileRouter } from "uploadthing/next";
import { createUploadthing, type FileRouter } from 'uploadthing/next';

const f = createUploadthing();

const auth = () => ({ id: "fakeId" }); // Fake auth function
const auth = () => ({ id: 'fakeId' }); // Fake auth function

// FileRouter for your app, can contain multiple FileRoutes
export const ourFileRouter = {
// Define as many FileRoutes as you like, each with a unique routeSlug
imageUploader: f({ image: { maxFileSize: "4MB", maxFileCount: 3 } })
imageUploader: f({ image: { maxFileSize: '4MB', maxFileCount: 3 } })
// Set permissions and file types for this FileRoute
.middleware(async ({}) => {
// This code runs on your server before upload
const user = await auth();

// If you throw, the user will not be able to upload
if (!user) throw new Error("Unauthorized");
if (!user) throw new Error('Unauthorized');

// Whatever is returned here is accessible in onUploadComplete as `metadata`
return { userId: user.id };
})
.onUploadComplete(async () => {
// This code RUNS ON YOUR SERVER after upload
}),
})
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;
6 changes: 3 additions & 3 deletions app/api/uploadthing/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createNextRouteHandler } from "uploadthing/next";
import { createNextRouteHandler } from 'uploadthing/next';

import { ourFileRouter } from "./core";
import { ourFileRouter } from './core';

// Export routes for Next App Router
export const { GET, POST } = createNextRouteHandler({
router: ourFileRouter,
router: ourFileRouter
});
2 changes: 1 addition & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
@apply border-border;
}
body {
@apply bg-background text-foreground box-border;
@apply box-border bg-background text-foreground;
}
}

Expand Down
Loading

0 comments on commit b995e2e

Please sign in to comment.