2.0.1 • Published 12 months ago

@adamantic/filecloud-upload-react v2.0.1

Weekly downloads
-
License
Under license fro...
Repository
-
Last release
12 months ago

FileCloudUpload - REACT

A simple form to upload your files to FileCloud with React.

PREREQUISITES

You must have at least React 17.0.2 and React Dom 17.0.2

INSTALL

npm install @adamantic/filecloud-upload-react

USAGE

Import FileCloudUpload inside the component where you need to use it.

import { FileCloudUpload } from 'filecloud-upload-react/dist/cjs';

<FileCloudUpload />
WARNING: FileCloudUpload needs some mandatory props. Read below to find out how to use it.

PROPS

N.B.: Default values are not currently implemented. Configure everything before using.
interface FileCloudUploadProps {
  serverUrl: string; // the server base url
  fileCloudRequestCode: string; // the request code to authenticate on FileCloud
  title?: string; // a title on the component's top -- OPTIONAL
  closeIcon: any; // an icon shown to remove uploaded document
  loader: any; // a loader (icon / component / text ) to show inside the submit button
  onSuccess: () => void; // a function to run on upload success
  onFailure: () => void; // a function to run on upload failure
  tabsToShow: DocumentTabItem[]; // Look on the next block
  fileCloudProperties: CssProperties; // Look on the next block
};
interface DocumentTabItem {
    name: 'ID_CARD' | 'PASSPORT'; // ID_CARD has two sides two load, passport only one
    title: string; // shown inside the tab
    placeholderButton: string; 
    // If tab item has more then one side to load, with the placeholder is shown the index"
}


interface CssProperties {
  backgroundColor: string;
  padding: string;
  title: {
    color: string;
    fontSize: string;
  };
  tabsContainer: {
    marginRight: string;
    marginLeft: string;
    marginTop: string;
    marginBottom: string;
    tabStyle: {
      marginRight: string;
      marginLeft: string;
      activeBorderBottomColor: string;
      color: string;
    };
  };
  form: {
    fieldsPerRow: number;
    fieldHeight: string;
    fieldPaddingLeft: string;
    fieldPaddingRight: string;
    fieldMarginTop: string;
    fieldMarginBottom: string;
    fieldMarginRight: string;
    fieldMarginLeft: string;
    backgroundColor: string;
    borderRadius: string;
    color: string;
    borderColor: string;
    documentsNotValidErrorMessage: string;
    sendButtonText: string;
    labels: {
      name: string;
      expiryDate: string;
      issuingCountry: string;
    };
    placeholders: {
      name: string;
      expiryDate: string;
      issuingCountry: string;
    };
  };
  button: {
    marginTop: string;
    marginBottom: string;
    borderColor: string;
    width: string;
    color: string;
    height: string;
    backgroundColor: string;
    borderRadius: string;
  };
};
2.0.1

12 months ago

2.0.0

12 months ago

1.1.1

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago