Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish button props #663

Open
saifulapm opened this issue Oct 21, 2024 · 0 comments
Open

Publish button props #663

saifulapm opened this issue Oct 21, 2024 · 0 comments

Comments

@saifulapm
Copy link

saifulapm commented Oct 21, 2024

Hi, I want to add disabled to publish button ononPublish so multiple form not submit or may loading state on submit. Is there way that can be easily possible ?

Here is my Puck component.

    <Puck
      viewports={[
        {
          width: 430,
          height: 932,
          icon: 'Smartphone',
          label: 'Small',
        },
      ]}
      config={homeConfig}
      data={initialData}
      onPublish={async (data: Data) => {
        const formData = new FormData()
        formData.append('puckData', JSON.stringify(data))
        submit(formData, { method: 'post' })
      }}
      overrides={{
        preview: ({ children }) => <div style={{ position: 'relative', height: '100%', backgroundColor: 'white' }} className="no-scrollbar">{children}</div>,
      }}
      iframe={{ enabled: false }}
    />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant