Skip to content

Commit

Permalink
chore: logs and make sure state defaults to closed modal
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewis84 committed Dec 4, 2024
1 parent e0730c7 commit faf3603
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/web-shared/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ function ChurchLogo(props) {
const Modal = (props = {}) => {
const [state, dispatch] = useModal();

console.log('Modal props: ', props);

const ref = useRef();
const imageRef = useRef();
const { id, navigate } = useNavigation();

console.log('Navigation ID: ', id);

useEffect(() => {
// Watch for changes to the `id` search param
if (id) {
Expand Down Expand Up @@ -70,7 +74,7 @@ const Modal = (props = {}) => {

return (
<Box>
<Styled.Modal className="apollos-modal" show={state.isOpen}>
<Styled.Modal className="apollos-modal" show={state.isOpen ?? false}>
{state.content ? (
<>
<Styled.ModalContainer ref={ref} role="dialog" tabIndex={-1} aria-dialog={true}>
Expand Down
4 changes: 2 additions & 2 deletions packages/web-shared/components/Modal/Modal.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const Modal = withTheme(styled.div`
justify-content: center;
align-items: center;
z-index: 9999;
animation: ${(props) => (props.show ? slideIn : slideOut)} 0.3s ease-in-out;
transform: translateY(${(props) => (props.show ? '0' : '100%')});
animation: ${(props) => (props?.show ? slideIn : slideOut)} 0.3s ease-in-out;
transform: translateY(${(props) => (props?.show ? '0' : '100%')});
${system};
`);

Expand Down

0 comments on commit faf3603

Please sign in to comment.