Skip to content

Commit

Permalink
fix code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
marshalljordan1 committed Oct 11, 2023
1 parent 1289576 commit a49d7de
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 125 deletions.
68 changes: 32 additions & 36 deletions src/components/PasswordReminderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,46 +51,42 @@ const PasswordReminderComponent = ({
};

return (
<>
<div>
<div
className={`absolute z-50 right-0 top-full mt-6 w-80 rounded-xl bg-white border-2 `}
>
<div className="p-3 flex ">
<img
onClick={() => setIsPasswordReminder(false)}
src={cross}
className=" cursor-pointer w-3 ml-auto "
alt=""
<div>
<div
className={`absolute z-50 right-0 top-full mt-6 w-80 rounded-xl bg-white border-2 `}
>
<div className="p-3 flex ">
<img
onClick={() => setIsPasswordReminder(false)}
src={cross}
className=" cursor-pointer w-3 ml-auto "
alt=""
/>
</div>
<div className="flex flex-col justify-evenly h-60 px-5 py-0 ">
<h1 className="text-center font-bold text-xl">Recordar contraseña</h1>
<form onSubmit={handleFormSubmit}>
<input
type="email"
name="email"
className="input input-bordered placeholder-black w-full max-w-xs"
placeholder="Dirección de email"
value={email}
onChange={handleEmailChange}
/>
</div>
<div className="flex flex-col justify-evenly h-60 px-5 py-0 ">
<h1 className="text-center font-bold text-xl">
Recordar contraseña
</h1>
<form onSubmit={handleFormSubmit}>
<input
type="email"
name="email"
className="input input-bordered placeholder-black w-full max-w-xs"
placeholder="Dirección de email"
value={email}
onChange={handleEmailChange}
/>

<button
type="submit"
className="mt-5 btn btn-block normal-case bg-pink-it text-white"
>
<p>Recordar contraseña</p>
</button>
</form>
</div>
<button
type="submit"
className="mt-5 btn btn-block normal-case bg-pink-it text-white"
>
<p>Recordar contraseña</p>
</button>
</form>
</div>

<div className="opacity-25 fixed inset-0 z-40 bg-black"></div>
</div>
</>

<div className="opacity-25 fixed inset-0 z-40 bg-black"></div>
</div>
);
};

Expand Down
176 changes: 87 additions & 89 deletions src/components/apps/appsAdminView/modalApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,121 +34,119 @@ export default function ModalApps({
}, [appsInfo]);

return (
<>
<dialog id="my_modal_1" className="modal ">
{!loadingApps ? (
<form
method="dialog"
className="modal-box text-start flex flex-col h-4/5"
>
<button className="cursor-pointer bg-transparent ml-auto border-0 focus:outline-none hover:bg-transparent">
<img src={Cross} alt="Cross button" />
</button>
<dialog id="my_modal_1" className="modal ">
{!loadingApps ? (
<form
method="dialog"
className="modal-box text-start flex flex-col h-4/5"
>
<button className="cursor-pointer bg-transparent ml-auto border-0 focus:outline-none hover:bg-transparent">
<img src={Cross} alt="Cross button" />
</button>

<input
value={newInfoApps.title || " "}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, title: e.target.value })
}
className="focus:outline-none mb-2 text-black font-poppins font-bold"
type="text"
/>

<textarea
value={newInfoApps.description}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, description: e.target.value })
}
className="focus:outline-none mt-2 mb-4 w-full text-[#7e7e7e]"
/>

<div className="my-2">
<h3 className="font-bold mb-1">Url del proyecto</h3>
<input
value={newInfoApps.title || " "}
placeholder="Type here"
value={newInfoApps.url || " "}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, title: e.target.value })
setNewInfoApps({ ...newInfoApps, url: e.target.value })
}
className="focus:outline-none mb-2 text-black font-poppins font-bold"
type="text"
className="input input-bordered w-full py-2 "
/>
</div>

<textarea
value={newInfoApps.description}
<div className="my-4">
<h3 className="font-bold mb-1">Url del repositorio de GitHub</h3>
<input
placeholder="Type here"
value={newInfoApps.github || " "}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, description: e.target.value })
setNewInfoApps({ ...newInfoApps, github: e.target.value })
}
className="focus:outline-none mt-2 mb-4 w-full text-[#7e7e7e]"
type="text"
className="input input-bordered w-full py-2"
/>
</div>

<div className="my-2">
<h3 className="font-bold mb-1">Url del proyecto</h3>
<input
placeholder="Type here"
value={newInfoApps.url || " "}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, url: e.target.value })
}
type="text"
className="input input-bordered w-full py-2 "
/>
</div>

<div className="my-4">
<h3 className="font-bold mb-1">Url del repositorio de GitHub</h3>
<input
placeholder="Type here"
value={newInfoApps.github || " "}
onChange={(e) =>
setNewInfoApps({ ...newInfoApps, github: e.target.value })
}
type="text"
className="input input-bordered w-full py-2"
/>
</div>

<h3 className="font-bold mt-2 mb-3">Estado</h3>
<div className="flex w-fit rounded-full p-1 border border-[#7e7e7e]">
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "COMPLETED" });
}}
className={`
<h3 className="font-bold mt-2 mb-3">Estado</h3>
<div className="flex w-fit rounded-full p-1 border border-[#7e7e7e]">
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "COMPLETED" });
}}
className={`
${
newInfoApps.state == "COMPLETED"
? "font-bold bg-completed rounded-full p-3 cursor-pointer"
: "cursor-pointer p-3"
} text-sm`}
>
Completada
</p>
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "IN PROGRESS" });
}}
className={`
>
Completada
</p>
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "IN PROGRESS" });
}}
className={`
${
newInfoApps.state == "IN PROGRESS"
? "font-bold bg-building ml-2 rounded-full p-3 cursor-pointer"
: "cursor-pointer p-3 ml-2"
} text-sm`}
>
En progreso
</p>
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "SOON" });
}}
className={`
>
En progreso
</p>
<p
onClick={() => {
setNewInfoApps({ ...newInfoApps, state: "SOON" });
}}
className={`
${
newInfoApps.state == "SOON"
? "font-bold bg-soon ml-2 rounded-full p-3 cursor-pointer"
: "cursor-pointer p-3 ml-2"
} text-sm`}
>
Próximamente
</p>
</div>
>
Próximamente
</p>
</div>

<div className="flex place-content-center mt-6 gap-12">
<button className="btn normal-case xl:px-12 text-[#7e7e7e] border border-[#7e7e7e] bg-white">
Cancelar
</button>
<button
className="btn normal-case xl:px-12 text-white bg-pink-it"
onClick={() =>
putApiApps(newInfoApps, acces_token, dispatch, appsInfo.id)
}
>
Guardar
</button>
</div>
</form>
) : (
<span className=" loading loading-spinner loading-lg "></span>
)}
</dialog>
</>
<div className="flex place-content-center mt-6 gap-12">
<button className="btn normal-case xl:px-12 text-[#7e7e7e] border border-[#7e7e7e] bg-white">
Cancelar
</button>
<button
className="btn normal-case xl:px-12 text-white bg-pink-it"
onClick={() =>
putApiApps(newInfoApps, acces_token, dispatch, appsInfo.id)
}
>
Guardar
</button>
</div>
</form>
) : (
<span className=" loading loading-spinner loading-lg "></span>
)}
</dialog>
);
}

0 comments on commit a49d7de

Please sign in to comment.