Skip to content

Commit

Permalink
feat: add hook use barbeiro
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 7, 2022
1 parent 86722be commit 2303e97
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/hooks/useBarbeiro.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { useState } from 'react';

export function useBarbeiro() {
const [visible, setVisible] = useState(true);
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: '40vh',
width: '25rem',
alignItems: 'center',
justifyContent: 'center',
},
overlay: {
display: 'flex',
inset: '0px',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.7)',
},
};

return {
visible,
setVisible,
modalIsOpen,
setIsOpen,
openModal,
closeModal,
customStyles,
};
}

0 comments on commit 2303e97

Please sign in to comment.