-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: the update function and the corresponding form have been created
- Loading branch information
Showing
8 changed files
with
856 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react'; | ||
import { | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalBody, | ||
ModalHeader, | ||
ModalCloseButton, | ||
useColorModeValue, | ||
} from '@chakra-ui/react'; | ||
|
||
import { FormEdit } from '@components/forms/FormEdit'; | ||
import { ModalOptionsAndConfirType } from '@components/types'; | ||
|
||
export function ModalForm({ | ||
isOpen, | ||
onClose, | ||
id, | ||
title, | ||
authors, | ||
synopsis, | ||
image, | ||
sourceLink, | ||
language, | ||
numberPages, | ||
year, | ||
category, | ||
format, | ||
}: ModalOptionsAndConfirType) { | ||
const bgColorBox = useColorModeValue('white', 'gray.900'); | ||
|
||
const img = { | ||
url: image?.url || [], | ||
public_id: image?.public_id || '', | ||
}; | ||
|
||
return ( | ||
<> | ||
<Modal | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
closeOnOverlayClick={false} | ||
size={{ base: 'sm', md: '4xl' }} | ||
> | ||
<ModalOverlay backdropFilter='blur(7px)' /> | ||
<ModalContent overflow='hidden'> | ||
<ModalHeader bg={bgColorBox}>Editar</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody bg={bgColorBox}> | ||
<FormEdit | ||
id={id || ''} | ||
title={title || ''} | ||
authors={authors || []} | ||
synopsis={synopsis || ''} | ||
image={img} | ||
sourceLink={sourceLink || ''} | ||
language={language || ''} | ||
numberPages={numberPages || ''} | ||
year={year || ''} | ||
category={category || []} | ||
format={format || ''} | ||
/> | ||
</ModalBody> | ||
</ModalContent> | ||
</Modal> | ||
</> | ||
); | ||
} |
Oops, something went wrong.
4c48287
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
xbu – ./
xbu-git-main-franqsanz.vercel.app
xbu-franqsanz.vercel.app
xbu.vercel.app