Commit 1d27b14e authored by gsf20's avatar gsf20
Browse files

ADD description when creating collection

parent f9a6c346
Pipeline #38664 passed with stage
in 1 minute and 59 seconds
Showing with 17 additions and 7 deletions
+17 -7
......@@ -12,6 +12,7 @@ import mecredApi from "@/axiosConfig";
*/
export default function CreateCollectionModal({ open, onClose, idLogin }) {
const [name, setName] = useState("")
const [description, setDescription] = useState("")
const token = getStoredValue("access_token");
const client = getStoredValue("client");
......@@ -33,7 +34,8 @@ export default function CreateCollectionModal({ open, onClose, idLogin }) {
"name": name,
"owner_id": idLogin,
"owner_type": "User",
"privacy": e.target["privacy-radio-group"].value
"privacy": e.target["privacy-radio-group"].value,
"description": e.target["description"].value
}
};
......@@ -50,16 +52,17 @@ export default function CreateCollectionModal({ open, onClose, idLogin }) {
},
})
};
return (
<Modal
open={open}
onClose={onClose}
className="grid place-items-center m-5"
>
<div className="flex flex-col bg-main p-5 rounded-lg w-[40%]">
<div className="flex flex-col bg-main p-5 gap-2 rounded-lg w-[40%]">
<div className="text-2xl font-bold text-main-text">Criar Coleção</div>
<p className="text-lg text-main-text font-bold mb-1 mt-4">Nome da Coleção</p>
<form onSubmit={handleSubmit}>
<p className="text-lg text-main-text font-bold mt-4">Nome da Coleção</p>
<TextField
size="small"
fullWidth
......@@ -68,8 +71,8 @@ export default function CreateCollectionModal({ open, onClose, idLogin }) {
helperText={`${name.length}/150`}
error={name.length > 150}
/>
<p className="text-lg text-main-text font-bold mb-3 mt-4">Esta coleção é:</p>
<FormLabel >
<p className="text-lg text-main-text font-bold mt-4">Esta coleção é:</p>
<FormLabel>
<RadioGroup name="privacy-radio-group">
<FormControlLabel
value="public"
......@@ -83,7 +86,14 @@ export default function CreateCollectionModal({ open, onClose, idLogin }) {
/>
</RadioGroup>
</FormLabel>
<div className="flex justify-center space-x-2">
<p className="text-lg text-main-text font-bold mt-4">Descrição</p>
<TextField
size="small"
name="description"
placeholder="(Opcional)"
fullWidth
/>
<div className="flex justify-center space-x-2 mt-4">
<button
className=" border text-sm p-2 text-main border-main rounded-lg normal-case h-9 font-bold bg-secondary hover:bg-secondary-hover"
type="submit"
......@@ -103,4 +113,4 @@ export default function CreateCollectionModal({ open, onClose, idLogin }) {
</div>
</Modal>
)
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment