@@ -31,7 +31,7 @@ export default CodeDemoDropzoneCustomValidation;
3131
3232const splittedCodeJSButton = `` ;
3333const splittedCodeTSButton = `` ;
34- const completeCodeJSButton = `import { FileInputButton, FileCard } from "@files-ui/react";
34+ const completeCodeJSButton = `import { FileInputButton, FileCard } from "@files-ui/react";
3535import * as React from "react";
3636
3737//validate files
@@ -94,16 +94,19 @@ export default function App() {
9494 </div>
9595 );
9696}` ;
97- const completeCodeTSButton = `import { FileInputButton, FileCard, ExtFile } from "@files-ui/react";
97+ const completeCodeTSButton =
98+ `import { FileInputButton, FileCard, ExtFile } from "@files-ui/react";
9899import * as React from "react";
99100
100101//validate files
101102// file name must start with the following prefix: "test_file"
102103// (e.g. a valid file name could be "test_file_photo.png")
103- const myOwnValidation = (file: File): CustomValidateFileResponse => {
104+ const myOwnValidation = (file: File): ValidateFileResponse => {
104105 let errorList: string[] = [];
105106 let validResult: boolean = true;
106- const regExPrefix: RegExp = /\btest_file\w+/;
107+ ` +
108+ // eslint-disable-next-line
109+ `const regExPrefix: RegExp = /\btest_file\w+/;
107110 if (!file.name.match(regExPrefix)) {
108111 validResult = false;
109112 errorList.push('Prefix "test_file" was not present in the file name');
@@ -161,11 +164,11 @@ export default function App() {
161164
162165/////
163166
164-
165167const splittedCodeJS = `` ;
166168const splittedCodeTS = `` ;
167169const completeCodeJS = `import { Dropzone, FileMosaic } from "@files-ui/react";
168170import * as React from "react";
171+
169172//validate files
170173// file name must start with the following prefix: "test_file"
171174// (e.g. a valid file name could be "test_file_photo.png")
@@ -179,6 +182,7 @@ const myOwnValidation = (file) => {
179182 }
180183 return { valid: validResult, errors: errorList };
181184};
185+
182186export default function App() {
183187 const [files, setFiles] = React.useState([]);
184188 const updateFiles = (incommingFiles) => {
@@ -204,16 +208,16 @@ export default function App() {
204208 );
205209}` ;
206210
207- const completeCodeTS = `import { Dropzone, FileMosaic, ExtFile, CustomValidateFileResponse } from "@files-ui/react";
211+ const completeCodeTS = `import { Dropzone, FileMosaic, ExtFile, ValidateFileResponse } from "@files-ui/react";
208212import * as React from "react";
209213
210214//validate files
211215// file name must start with the following prefix: "test_file"
212216// (e.g. a valid file name could be "test_file_photo.png")
213- const myOwnValidation = (file: File): CustomValidateFileResponse => {
217+ const myOwnValidation = (file: File): ValidateFileResponse => {
214218 let errorList: string[] = [];
215219 let validResult: boolean = true;
216- const regExPrefix: RegExp = /\btest_file\w+/;
220+ const regExPrefix: RegExp = /\\ btest_file\ \w+/;
217221 if (!file.name.match(regExPrefix)) {
218222 validResult = false;
219223 errorList.push('Prefix "test_file" was not present in the file name');
0 commit comments