Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
kingp08 committed Jun 3, 2024
0 parents commit b0503b8
Showing 262 changed files with 30,293 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
14 changes: 14 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"development"
],
"hints": {
"axe/forms": [
"default",
{
"select-name": "off",
"label": "off"
}
]
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# dental_frontend
7 changes: 7 additions & 0 deletions app/bookings/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ReactNode } from "react";

export default function BookingLayout({ children }: { children: ReactNode }) {
return (
<section className="grid grid-cols-9 gap-4 w-full">{children}</section>
);
}
9 changes: 9 additions & 0 deletions app/bookings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import BookingCard from "@/components/bookings";

export default function Booking() {
return (
<>
<BookingCard />
</>
);
}
5 changes: 5 additions & 0 deletions app/calendar/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ILayoutProps } from "@/utils/interfaces";

export default function CalendarLayout({ children }: ILayoutProps) {
return <section className="grow h-auto lg:h-full w-full">{children}</section>;
}
59 changes: 59 additions & 0 deletions app/calendar/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"use client";
import { useEffect } from "react";
import { Card, CardBody } from "@/libraries/material-tailwind";
import { toast } from "@/libraries/react-toastify";
import api from "@/utils/api";
import { getErrorMessage } from "@/utils/functions";
import useLoading from "@/hooks/useLoading";
import { useCalendar } from "@/contexts/CalendarContext";
import BCalendar from "@/components/custom/calendars/BCalendar";
import { IEvent } from "@/utils/interfaces";
import { useUser } from "@/contexts/UserContext";

let isFirstLoad = true;

export default function CalendarPage() {
const { setIsLoading } = useLoading();
const { setEvents } = useCalendar();
const {userData} = useUser();

useEffect(() => {
if(!userData || userData?.userType == 1) return ;
if (isFirstLoad) {
setIsLoading(true);
api
.post("/calendar/events/list")
.then((res) => {
const processedData: Array<IEvent> = res.data.map(
(dataItem: {
id: string;
title: string;
doubleBooked: boolean;
date: string;
}) => ({
id: dataItem.id,
title: dataItem.title,
doubleBooked: dataItem.doubleBooked,
start: new Date(`${dataItem.date}T00:00:00.00Z`),
end: new Date(`${dataItem.date}T23:59:59.00Z`),
})
);
setEvents(processedData);
setIsLoading(false);
})
.catch((err) => {
toast.error(getErrorMessage(err));
setIsLoading(false);
});
}
isFirstLoad = false;
}, []);

return (
<Card placeholder="" className="h-full">
<CardBody placeholder="" className="h-full">
<BCalendar />
</CardBody>
</Card>
);
}
9 changes: 9 additions & 0 deletions app/create-password/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReactNode } from "react";

interface IProps {
children: ReactNode;
}

export default function CreatePasswordLayout({ children }: IProps) {
return children;
}
73 changes: 73 additions & 0 deletions app/create-password/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"use client";
import Image from "next/image";
import LeftSection from "@/components/layout/AuthLayout/LeftSection";
import { Typography } from "@/libraries/material-tailwind";
import CreatePasswordForm from "@/components/create-password/CreatePasswordForm";
import Loading from "@/components/custom/Loading";
import { useState } from "react";

export default function CreatePasswordPage() {
const [loading, setLoading] = useState<boolean>(false);

return (
<>
<LeftSection className="flex flex-col justify-center items-center gap-4">
<div className="flex flex-col items-center gap-4 relative z-4">
<Image
src="/assets/images/logo-white.png"
width={54}
height={54}
className="w-auto h-auto"
alt=""
priority={true}
/>
<Typography
variant="h1"
placeholder=""
className="text-white text-3xl font-extrabold text-center"
>
Dental Jobs
</Typography>
</div>
<div className="relative">
<Image
src="/assets/images/calendar.png"
width={383}
height={406}
className="w-auto h-auto"
alt=""
/>
<Image
src="/assets/images/comment-of-calendar.png"
width={260}
height={100}
className="w-auto h-auto absolute top-[11%] -right-[41%]"
alt=""
/>
</div>
<Typography
placeholder=""
className="text-center text-gray-200 font-semibold text-lg"
>
Habitasse leo mi enim condimentum rhoncus. Sed non tortor gravida .
</Typography>
</LeftSection>
<section className="flex flex-col items-center justify-center py-16 z-10 bg-[#F5F7F9] h-screen overflow-auto">
{loading ? (
<Loading />
) : (
<div className="w-1/2 flex flex-col items-center gap-10">
<Typography
placeholder=""
variant="h2"
className="font-bold text-3xl text-center text-dark"
>
Create New Password
</Typography>
<CreatePasswordForm setLoading={setLoading} />
</div>
)}
</section>
</>
);
}
9 changes: 9 additions & 0 deletions app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReactNode } from "react";

export default function DashboardLayout({ children }: { children: ReactNode }) {
return (
<section className="grid grid-cols-12 xl:grid-cols-9 gap-4">
{children}
</section>
);
}
28 changes: 28 additions & 0 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"use client";
import AvatarCard from "@/components/dashboard/AvatarCard";
import BookingsCard from "@/components/dashboard/BookingsCard";
import CalendarCard from "@/components/dashboard/CalendarCard";
import CompleteProfileCard from "@/components/dashboard/CompleteProfileCard";
import JobPostingCard from "@/components/dashboard/JobPostingCard";
import { useUser } from "@/contexts/UserContext";
import { useEffect } from "react";

export default function DashboardPage() {
const { userData } = useUser();

useEffect(() => {
if (!userData || userData?.userType == 1) return;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
<>
<AvatarCard className="col-span-12 md:col-span-6 xl:col-span-2" />
<CompleteProfileCard className="col-span-12 md:col-span-6 xl:col-span-4" />
<BookingsCard className="col-span-12 lg:col-span-6 xl:col-span-3 flex lg:hidden xl:flex" />
<JobPostingCard className="col-span-12 xl:col-span-7" />
<BookingsCard className="col-span-12 lg:col-span-6 xl:col-span-3 hidden lg:flex xl:hidden" />
<CalendarCard className="col-span-12 lg:col-span-6 xl:col-span-2" />
</>
);
}
Binary file added app/favicon.ico
Binary file not shown.
9 changes: 9 additions & 0 deletions app/forgot-password/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReactNode } from "react";

interface IProps {
children: ReactNode;
}

export default function ForgotPasswordLayout({ children }: IProps) {
return children;
}
72 changes: 72 additions & 0 deletions app/forgot-password/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"use client";
import { useState } from "react";
import Image from "next/image";
import LeftSection from "@/components/layout/AuthLayout/LeftSection";
import { Typography } from "@/libraries/material-tailwind";
import ForgotPasswordForm from "@/components/forgot-password/ForgotPasswordForm";
import Loading from "@/components/custom/Loading";

export default function ForgotPasswordPage() {
const [loading, setLoading] = useState<boolean>(false);
return (
<>
<LeftSection className="flex flex-col justify-center items-center gap-4">
<div className="flex flex-col items-center gap-4 relative z-4">
<Image
src="/assets/images/logo-white.png"
width={54}
height={54}
className="w-auto h-auto"
alt=""
priority={true}
/>
<Typography
variant="h1"
placeholder=""
className="text-white text-3xl font-extrabold text-center"
>
Dental Jobs
</Typography>
</div>
<div className="relative">
<Image
src="/assets/images/calendar.png"
width={383}
height={406}
className="w-auto h-auto"
alt=""
/>
<Image
src="/assets/images/comment-of-calendar.png"
width={260}
height={100}
className="w-auto h-auto absolute top-[11%] -right-[41%]"
alt=""
/>
</div>
<Typography
placeholder=""
className="text-center text-gray-200 font-semibold text-lg"
>
Habitasse leo mi enim condimentum rhoncus. Sed non tortor gravida .
</Typography>
</LeftSection>
<section className="flex flex-col items-center justify-center py-16 z-10 bg-[#F5F7F9] h-screen overflow-auto">
{loading ? (
<Loading />
) : (
<div className="w-1/2 flex flex-col items-center gap-10">
<Typography
placeholder=""
variant="h2"
className="font-bold text-3xl text-center text-dark"
>
Forgot Password?
</Typography>
<ForgotPasswordForm setLoading={setLoading} />
</div>
)}
</section>
</>
);
}
Loading

0 comments on commit b0503b8

Please sign in to comment.