ImportExportSettings
Settings panel for exporting site configuration as JSON and importing a previously saved snapshot.
Settings panel for exporting site configuration as JSON and importing a previously saved snapshot.
import { ImportExportSettings } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
onExport | Required | VoidFunction | — | — |
onImport | Required | (data: SettingsExportData) => void | — | — |
onParseFile | Optional | ((file: File) => Promise<SettingsExportData>) | undefined | — | — |
isExporting | Optional | boolean | undefined | — | — |
isImporting | Optional | boolean | undefined | — | — |
className | Optional | string | undefined | — | — |
Usage
Settings panel for exporting the site configuration as a JSON snapshot and importing a previously saved one. Handles file parsing internally.
Example
import { ImportExportSettings } from '@tetherto/mdk-react-devkit'export const ImportExportSettingsExample = () => ( <div className="mdk-example-row"> <ImportExportSettings onExport={() => console.warn('export')} onImport={(data) => console.warn('import', data)} /> </div>)