added <Loader> component
This commit is contained in:
1 parent
71fc0ba437
commit
e5550b72ba
9 files changed
+24
-17
No files matched your search
@@ -6,7 +6,8 @@ import Shell from "../../components/Shell";
|
||||
import { useRouter } from "next/router";
|
||||
import { useRef, useState } from "react";
|
||||
import { getSession, useSession } from "next-auth/client";
|
||||
import { ClockIcon, PlusIcon } from "@heroicons/react/outline";
|
||||
import { ClockIcon } from "@heroicons/react/outline";
|
||||
import Loader from '@components/Loader';
|
||||
|
||||
export default function Availability(props) {
|
||||
const [session, loading] = useSession();
|
||||
@@ -28,7 +29,7 @@ export default function Availability(props) {
|
||||
const bufferMinsRef = useRef<HTMLInputElement>();
|
||||
|
||||
if (loading) {
|
||||
return <div className="loader"><span className="loader-inner"></span></div>;
|
||||
return <Loader/>;
|
||||
}
|
||||
|
||||
function toggleAddModal() {
|
||||
|
||||
@@ -6,6 +6,7 @@ import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { GetServerSideProps } from "next";
|
||||
import prisma from "@lib/prisma";
|
||||
import Loader from '@components/Loader';
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function Troubleshoot({ user }) {
|
||||
@@ -14,7 +15,7 @@ export default function Troubleshoot({ user }) {
|
||||
const [selectedDate, setSelectedDate] = useState(dayjs());
|
||||
|
||||
if (loading) {
|
||||
return <div className="loader"><span className="loader-inner"></span></div>;
|
||||
return <Loader/>;
|
||||
}
|
||||
|
||||
function convertMinsToHrsMins(mins) {
|
||||
@@ -80,11 +81,7 @@ export default function Troubleshoot({ user }) {
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{availability.length === 0 && (
|
||||
<div className="loader">
|
||||
<span className="loader-inner"></span>
|
||||
</div>
|
||||
)}
|
||||
{availability.length === 0 && <Loader />}
|
||||
<div className="bg-black overflow-hidden rounded-sm">
|
||||
<div className="px-4 sm:px-6 py-2 text-white">
|
||||
Your day ends at {convertMinsToHrsMins(user.endTime)}
|
||||
|
||||
Reference in new issue
Block a user