Skip to content

Commit

Permalink
feat: add hook use report modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 5, 2022
1 parent 0d33d09 commit 353d0db
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/hooks/useReport.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useState } from 'react';

import { useFormik } from 'formik';

export function useReport() {
Expand All @@ -11,7 +13,44 @@ export function useReport() {
},
});

const [modalIsOpen, setIsOpen] = useState(false);

function openModal() {
setIsOpen(true);
}

function closeModal() {
setIsOpen(false);
}

const customStyles = {
content: {
inset: 'initial',
border: 'none',
background: '#312e38',
overflow: 'auto',
borderRadius: '4px',
outline: 'none',
padding: '0px',
height: '65vh',
width: '25rem',
alignItems: 'center',
justifyContent: 'center',
},
overlay: {
display: 'flex',
inset: '0px',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.7)',
},
};

return {
formikReportBug,
modalIsOpen,
openModal,
closeModal,
customStyles,
};
}

0 comments on commit 353d0db

Please sign in to comment.