import React, { useState, forwardRef, useRef } from 'react'; import Dropdown from '../../Dropdown'; import CreateCollection from '../CreateCollection'; import { IconDots } from '@tabler/icons'; import StyledWrapper from './StyledWrapper'; const Navbar = ({dispatch, actions}) => { const [modalOpen, setModalOpen] = useState(false); const menuDropdownTippyRef = useRef(); const onMenuDropdownCreate = (ref) => menuDropdownTippyRef.current = ref; const MenuIcon = forwardRef((props, ref) => { return (
); }); const handleCancel = () => { setModalOpen(false); }; const handleConfirm = (values) => { dispatch({ name: values.collectionName, type: actions.COLLECTION_CREATE }); setModalOpen(false); }; return ( {modalOpen ? ( ) : null}
Collections
} placement='bottom-start'>
{ menuDropdownTippyRef.current.hide(); setModalOpen(true); }}> Create Collection
{ menuDropdownTippyRef.current.hide(); }}> Import Collection
{ menuDropdownTippyRef.current.hide(); }}> Settings
) }; export default Navbar;