From e6346b1d7d788754d0c2d11fc18724627ec5bf15 Mon Sep 17 00:00:00 2001 From: Factiven Date: Sat, 29 Apr 2023 14:30:08 +0700 Subject: Editor List v0.6 --- components/listEditor.js | 125 +++++++++++++++++++++++++++-------------------- components/modal.js | 4 +- 2 files changed, 75 insertions(+), 54 deletions(-) (limited to 'components') diff --git a/components/listEditor.js b/components/listEditor.js index 41a3172..64ca632 100644 --- a/components/listEditor.js +++ b/components/listEditor.js @@ -1,8 +1,9 @@ import { useState } from "react"; import useAlert from "./useAlert"; import { motion as m } from "framer-motion"; +import Image from "next/image"; -const ListEditor = ({ animeId, session, stats, prg, max }) => { +const ListEditor = ({ animeId, session, stats, prg, max, image = null }) => { const { message, type, showAlert } = useAlert(); const [status, setStatus] = useState(stats ?? ""); const [progress, setProgress] = useState(prg ?? 0); @@ -50,7 +51,7 @@ const ListEditor = ({ animeId, session, stats, prg, max }) => { }; return ( -
+
{message && ( { {message} )} -
+
List Editor
-
-
-
- - -
-
- - setProgress(e.target.value)} - className="rounded-sm px-2 py-1 bg-[#363642] w-[50%] sm:w-[150px] text-sm sm:text-base" - min="0" +
+ {image && ( +
+ image + image
-
- - +
+
+ + +
+
+ + setProgress(e.target.value)} + className="rounded-sm px-2 py-1 bg-[#363642] w-[50%] sm:w-[150px] text-sm sm:text-base" + min="0" + /> +
+
+ + +
); }; diff --git a/components/modal.js b/components/modal.js index 0a9d349..f237d77 100644 --- a/components/modal.js +++ b/components/modal.js @@ -3,13 +3,13 @@ export default function Modal({ open, onClose, children }) {
e.stopPropagation()} className={`shadow rounded-xl p-6 transition-all ${ - open ? "scale-125 opacity-100" : "scale-100 opacity-0" + open ? "scale-100 opacity-100" : "scale-75 opacity-0" }`} > {children} -- cgit v1.2.3