diff --git a/README.md b/README.md index bbb3a72..435abda 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ It uses [Uppy](https://uppy.io/) package to render uploader Dashboard, import fi ### Basic usage with Preact ```jsx -import FileManagementDialog from '@oarepo/file-manager' +import FileManagementDialog from '@oarepo/file-manager'; const MyComponent = () => { /* ... */ @@ -105,6 +105,7 @@ Used in React projects with Automatic JSX Runtime enabled (see [React docs](http ```jsx import ReactWrapper from "./ReactWrapper"; +import { h, render } from "preact"; const MyReactComponent = () => { /* ... */ @@ -114,6 +115,16 @@ const MyReactComponent = () => { preactComponent={FileManagementDialog} props={{ config: data, + TriggerComponent: ({ onClick, ...props }) => + h( + "button", + { + onClick: onClick, + style: { backgroundColor: "cyan" }, + ...props + }, + "Upload Files" + ), autoExtractImagesFromPDFs: false, /* additional FileManagementDialog options, see Props below */ }} diff --git a/data.json b/data.json index f1a45b6..1efb73a 100644 --- a/data.json +++ b/data.json @@ -3,8 +3,8 @@ "created": "2022-10-18T10:22:35.153753+00:00", "id": "8t29q-nfr77", "links": { - "files": "http://localhost:5173/general/datasets/8t29q-nfr77/files/", - "self": "http://localhost:5173/general/datasets/8t29q-nfr77", + "files": "http://localhost:5173/api/records/8t29q-nfr77/files", + "self": "http://localhost:5173/api/records/8t29q-nfr77", "transitions": {} }, "files": { diff --git a/index.html b/index.html index 3e7e3ed..eea20c8 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@