Skip to content

Commit

Permalink
feat: the update function and the corresponding form have been created
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Jan 24, 2024
1 parent 360062e commit 4c48287
Show file tree
Hide file tree
Showing 8 changed files with 856 additions and 62 deletions.
68 changes: 68 additions & 0 deletions src/components/ModalForm.tsx
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>
</>
);
}
Loading

1 comment on commit 4c48287

@vercel
Copy link

@vercel vercel bot commented on 4c48287 Jan 24, 2024

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

Please sign in to comment.