Skip to content

Commit

Permalink
fix: pass onClick to CreateContentButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Byrne committed Oct 2, 2019
1 parent 68bf64e commit 273b85a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/tinacms/tinacms/src/components/CreateContent.tsx
Expand Up @@ -52,11 +52,16 @@ export const CreateContentMenu = () => {
)
}

const CreateContentButton = ({ plugin }: any) => {
const CreateContentButton = ({ plugin, onClick }: any) => {
let [open, setOpen] = React.useState(false)
return (
<>
<CreateButton onClick={() => setOpen(p => !p)}>
<CreateButton
onClick={() => {
setOpen(p => !p)
onClick()
}}
>
{plugin.name}
</CreateButton>
{open && <FormModal plugin={plugin} close={() => setOpen(false)} />}
Expand Down

0 comments on commit 273b85a

Please sign in to comment.