Skip to content

Commit

Permalink
Added prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Fmacmak committed Jul 29, 2024
1 parent 9321182 commit aab1a58
Show file tree
Hide file tree
Showing 54 changed files with 3,832 additions and 2,130 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
]
"extends": ["next/core-web-vitals", "next/typescript"]
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindConfig": "./tailwind.config.ts"

}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## Next.js Busbuzzer
## Next.js Busbuzzer
4 changes: 2 additions & 2 deletions app/dashboard/(overview)/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DashboardSkeleton from '@/app/ui/skeletons';
import DashboardSkeleton from "@/app/ui/skeletons";

export default function Loading() {
return <DashboardSkeleton />;
}
17 changes: 10 additions & 7 deletions app/dashboard/(overview)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import CardWrapper from '@/app/ui/dashboard/cards';
import RevenueChart from '@/app/ui/dashboard/revenue-chart';
import LatestInvoices from '@/app/ui/dashboard/latest-invoices';
import { afacad } from '@/app/ui/fonts';
import { Suspense } from 'react';
import { RevenueChartSkeleton, LatestInvoicesSkeleton, CardsSkeleton } from '@/app/ui/skeletons';
import CardWrapper from "@/app/ui/dashboard/cards";
import RevenueChart from "@/app/ui/dashboard/revenue-chart";
import LatestInvoices from "@/app/ui/dashboard/latest-invoices";
import { afacad } from "@/app/ui/fonts";
import { Suspense } from "react";
import {
RevenueChartSkeleton,
LatestInvoicesSkeleton,
CardsSkeleton,
} from "@/app/ui/skeletons";

export default async function Page() {

return (
<main>
<h1 className={`${afacad.className} mb-4 text-xl md:text-2xl`}>
Expand Down
19 changes: 10 additions & 9 deletions app/dashboard/drivers/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// import { fetchInvoicesPages } from '@/app/lib/data';
import Pagination from '@/app/ui/invoices/pagination';
import Search from '@/app/ui/search';
import Pagination from "@/app/ui/invoices/pagination";
import Search from "@/app/ui/search";
// import Table from '@/app/ui/invoices/table';
import { CreateDriver } from '@/app/ui/invoices/buttons';
import { afacad } from '@/app/ui/fonts';
import { CreateDriver } from "@/app/ui/invoices/buttons";
import { afacad } from "@/app/ui/fonts";
// import { } from '@/app/ui/skeletons';
import { Suspense } from 'react';
import { Suspense } from "react";

export default async function Page({searchParams}: {
export default async function Page({
searchParams,
}: {
searchParams?: {
query?: string;
page?: string;
};
}) {

const query = searchParams?.query || '';
const query = searchParams?.query || "";
const currentPage = Number(searchParams?.page) || 1;
// const totalPages = await fetchInvoicesPages(query);

Expand All @@ -27,7 +28,7 @@ export default async function Page({searchParams}: {
<Search placeholder="Search drivers..." />
<CreateDriver />
</div>
{/* <Suspense key={query + currentPage} fallback={<InvoicesTableSkeleton />}>
{/* <Suspense key={query + currentPage} fallback={<InvoicesTableSkeleton />}>
<Table query={query} currentPage={currentPage} />
</Suspense> */}
<div className="mt-5 flex w-full justify-center">
Expand Down
6 changes: 3 additions & 3 deletions app/dashboard/invoices/[id]/edit/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link';
import { FaceFrownIcon } from '@heroicons/react/24/outline';
import Link from "next/link";
import { FaceFrownIcon } from "@heroicons/react/24/outline";

export default function NotFound() {
return (
<main className="flex h-full flex-col items-center justify-center gap-2">
Expand Down
59 changes: 29 additions & 30 deletions app/dashboard/invoices/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
import Form from '@/app/ui/invoices/edit-form';
import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
import { fetchCustomers, fetchInvoiceById } from '@/app/lib/data';
import { notFound } from 'next/navigation';

import Form from "@/app/ui/invoices/edit-form";
import Breadcrumbs from "@/app/ui/invoices/breadcrumbs";
import { fetchCustomers, fetchInvoiceById } from "@/app/lib/data";
import { notFound } from "next/navigation";

export default async function Page({ params }: { params: { id: string } }) {
const id = params.id;
const [invoice, customers] = await Promise.all([
fetchInvoiceById(id),
fetchCustomers(),
]);
console.log(invoice)
if (!invoice) {
notFound();
}
return (
<main>
<Breadcrumbs
breadcrumbs={[
{ label: 'Invoices', href: '/dashboard/invoices' },
{
label: 'Edit Invoice',
href: `/dashboard/invoices/${id}/edit`,
active: true,
},
]}
/>
{/* <Form /> */}
<Form invoice={invoice} customers={customers} />
</main>
);
const id = params.id;
const [invoice, customers] = await Promise.all([
fetchInvoiceById(id),
fetchCustomers(),
]);
console.log(invoice);
if (!invoice) {
notFound();
}
return (
<main>
<Breadcrumbs
breadcrumbs={[
{ label: "Invoices", href: "/dashboard/invoices" },
{
label: "Edit Invoice",
href: `/dashboard/invoices/${id}/edit`,
active: true,
},
]}
/>
{/* <Form /> */}
<Form invoice={invoice} customers={customers} />
</main>
);
}
16 changes: 8 additions & 8 deletions app/dashboard/invoices/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Form from '@/app/ui/invoices/create-form';
import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
import { fetchCustomers } from '@/app/lib/data';
import Form from "@/app/ui/invoices/create-form";
import Breadcrumbs from "@/app/ui/invoices/breadcrumbs";
import { fetchCustomers } from "@/app/lib/data";

export default async function Page() {
const customers = await fetchCustomers();

return (
<main>
<Breadcrumbs
breadcrumbs={[
{ label: 'Invoices', href: '/dashboard/invoices' },
{ label: "Invoices", href: "/dashboard/invoices" },
{
label: 'Create Invoice',
href: '/dashboard/invoices/create',
label: "Create Invoice",
href: "/dashboard/invoices/create",
active: true,
},
]}
Expand Down
10 changes: 5 additions & 5 deletions app/dashboard/invoices/error.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import { useEffect } from 'react';
"use client";

import { useEffect } from "react";

export default function Error({
error,
reset,
Expand All @@ -13,7 +13,7 @@ export default function Error({
// Optionally log the error to an error reporting service
console.error(error);
}, [error]);

return (
<main className="flex h-full flex-col items-center justify-center">
<h2 className="text-center">Something went wrong!</h2>
Expand Down
25 changes: 13 additions & 12 deletions app/dashboard/invoices/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { fetchInvoicesPages } from '@/app/lib/data';
import Pagination from '@/app/ui/invoices/pagination';
import Search from '@/app/ui/search';
import Table from '@/app/ui/invoices/table';
import { CreateInvoice } from '@/app/ui/invoices/buttons';
import { afacad } from '@/app/ui/fonts';
import { InvoicesTableSkeleton } from '@/app/ui/skeletons';
import { Suspense } from 'react';
import { fetchInvoicesPages } from "@/app/lib/data";
import Pagination from "@/app/ui/invoices/pagination";
import Search from "@/app/ui/search";
import Table from "@/app/ui/invoices/table";
import { CreateInvoice } from "@/app/ui/invoices/buttons";
import { afacad } from "@/app/ui/fonts";
import { InvoicesTableSkeleton } from "@/app/ui/skeletons";
import { Suspense } from "react";

export default async function Page({searchParams}: {
export default async function Page({
searchParams,
}: {
searchParams?: {
query?: string;
page?: string;
};
}) {

const query = searchParams?.query || '';
const query = searchParams?.query || "";
const currentPage = Number(searchParams?.page) || 1;
const totalPages = await fetchInvoicesPages(query);

Expand All @@ -27,7 +28,7 @@ export default async function Page({searchParams}: {
<Search placeholder="Search invoices..." />
<CreateInvoice />
</div>
<Suspense key={query + currentPage} fallback={<InvoicesTableSkeleton />}>
<Suspense key={query + currentPage} fallback={<InvoicesTableSkeleton />}>
<Table query={query} currentPage={currentPage} />
</Suspense>
<div className="mt-5 flex w-full justify-center">
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SideNav from '@/app/ui/dashboard/sidenav';
import SideNav from "@/app/ui/dashboard/sidenav";
export const experimental_ppr = true;

export default function Layout({ children }: { children: React.ReactNode }) {
Expand Down
15 changes: 6 additions & 9 deletions app/dashboard/school-routes/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { afacad } from '@/app/ui/fonts';


import { afacad } from "@/app/ui/fonts";

export default function Page() {

return (
<div className="w-full">
return (
<div className="w-full">
<div className="flex w-full items-center justify-between">
<h1 className={`${afacad.className} text-2xl`}>School Routes</h1>
</div>
</div>
)
}
</div>
);
}
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@/app/ui/global.css';
import { inter } from '@/app/ui/fonts';
import "@/app/ui/global.css";
import { inter } from "@/app/ui/fonts";

export default function RootLayout({
children,
Expand Down
Loading

0 comments on commit aab1a58

Please sign in to comment.