Skip to content

Commit

Permalink
Merge pull request #3 from JohnMwendwa/bg-color
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwendwa authored Sep 16, 2023
2 parents 8d3d8aa + 3e70a5b commit d68b366
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/components/BookCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import Link from "next/link";
import { FaEdit, FaTrash, FaCheckSquare } from "react-icons/fa";
import { FaEdit, FaTrash, FaCheckSquare, FaRegSquare } from "react-icons/fa";
import { useSession } from "next-auth/react";
import { toast } from "react-toastify";
import { useRouter } from "next/router";
Expand Down Expand Up @@ -119,20 +119,21 @@ const BookCard = ({ _id, title, author, start, end }) => {
<div className="flex justify-start border-t-2 pt-3 mt-4 text-xl">
<span className="mr-4" title="edit book">
<Link href={`/admin/${_id}/edit`}>
<FaEdit className="text-blue-400 cursor-pointer" />
<FaEdit className="text-blue-400 cursor-pointer text-2xl" />
</Link>
</span>
<span className="mr-4" title="delete book">
<FaTrash
className="text-red-600 cursor-pointer"
className="text-red-600 cursor-pointer text-2xl"
onClick={handleDeleteBook}
/>
</span>
<span title="mark as complete">
<FaCheckSquare
className="text-green-600 cursor-pointer"
onClick={handleCompleteBook}
/>
<span title="mark as complete" onClick={handleCompleteBook}>
{end ? (
<FaCheckSquare className="text-green-600 cursor-pointer text-2xl" />
) : (
<FaRegSquare className="text-green-600 cursor-pointer text-2xl" />
)}
</span>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Footer from "./Footer";

const Layout = ({ children }) => {
return (
<div className="flex flex-col min-h-screen dynamic">
<div className="flex flex-col min-h-screen dynamic bg-gray-100">
<Nav />
<ToastContainer />
<main className="grid flex-1 p-4 mt-16">{children}</main>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/books/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {

// Update book finish date
const book = await Book.findById(id);
book.end = new Date();
book.end ? (book.end = null) : (book.end = new Date());
await book.save();

return res.status(201).json({
Expand Down

0 comments on commit d68b366

Please sign in to comment.