mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-16 00:50:18 -04:00
23 lines
513 B
TypeScript
23 lines
513 B
TypeScript
import { useContext } from 'react';
|
|
import { GroupContext } from '../Group/Group';
|
|
import UIPressable from '../UI/UIPressable';
|
|
import useToggle from '../useToggle';
|
|
import EventCreator from './EventCreator';
|
|
|
|
export default function EventCreatorLink() {
|
|
const [open, toggle] = useToggle(false);
|
|
const { group } = useContext(GroupContext);
|
|
|
|
return (
|
|
<>
|
|
<UIPressable onClick={toggle}>Create Event</UIPressable>
|
|
{open && (
|
|
<>
|
|
<br />
|
|
<EventCreator group={group} />
|
|
</>
|
|
)}
|
|
</>
|
|
);
|
|
}
|