qmfkdldks / vivid-editor

animated text editor
https://vivid-delta.vercel.app
0 stars 0 forks source link

DB Integration #4

Closed qmfkdldks closed 3 years ago

qmfkdldks commented 4 years ago

Issue / Motivation / Current Behavior

Since slate.js content is already JSON format, we don't need to add additional serialization or deserialization methods.

  1. When onSave callback is provided then the editor should show the save button at the bottom.
  2. When onSave callback is not provided, it doesn't show any save button.

https://docs.slatejs.org/walkthroughs/06-saving-to-a-database

const App = () => {
  return (
    <VividEditor
      onChange={value => {
        console.log(value)
      }}
     onSave={value => {
        const content = JSON.stringify(value)
        localStorage.setItem('content', content)
     }}
    />
  )
}

References

Screenshot from 2020-08-28 19-19-06

Example of documentation for the developers https://docs.slatejs.org/walkthroughs/06-saving-to-a-database

Acceptance Criteria