Skip to content

homingos/ui-sdk

Repository files navigation

Homingos UI SDK

A plug n' play toolkit

Homingos SDK CI Homingos SDK CD

What's in the box?

- Media Uploader powered by Uppy - A js file uploader

- More coming soon.

Installtion

- Yarn

yarn add @homingos/ui-sdk

- NPM

npm i @homingos/ui-sdk

How use?

- Media uploader

- Import

.

import HomingosSDk from "@homingos/ui-sdk"
or 
const HomingoSDK = require("@homingos/ui-sdk")

- USAGE

- Config
`closeDrawer`: <Function> Function to close drawer [optional]
`resourceType`: < String : ['video', 'image'] > Type of resource to upload
`maxFiles`: <Number> Number of maximim files to allow.
`shouldCreatePhotoToVideo`: <Boolean> Allow photo to video (something we use internally)
`whiteLiastedImages`: < Array: [".jpg", ".jpeg", ".png"] > Array of image type to allow,
`whiteListedVideos`: < Array: [".mov", ".mp4"] > Array of video type to allow,
`openUploader`: <Function> Function to open uploader on invoke,
`clickBrowse`: <Function> Function to click browse to automatically open the uploader,
`createPhotoToVideo` <Function> Function to create photo to video (something we use internally)
`uppyConfig`: <Object> Uppy uploader config,
`AWSConfig: <Object: {url: <string>, token: <string>}> URL to make request on in order to get the pre-signed url and token to be passed as auth header.
`closeUploader` : <Function> Function to close the uppy uploader after upload completion automatically.

.

    HomingosSDk.Uploader({
        closeDrawer: parent.closeDrawer,
        resourceType,
        maxFiles,
        shouldCreatePhotoToVideo: createPhotoToVideo,
        whitedListedImages: [".jpg", ".jpeg", ".png"],
        whitedListedVideos: [".mov", ".mp4"],
        openUploader: parent.openUploader,
        clickBrowse: parent.clickBrowse,
        uppyConfig: {
          proudlyDisplayPoweredByUppy: false,
          inline: true,
          target: ".UppyUploadContainer",
          replaceTargetContent: true,
          showProgressDetails: true,
          note: messageNote,
          height: "90vh",
          metaFields: [{ id: "name", name: "Name", placeholder: "file name" }],
          browserBackButtonClose: true
        },
        AWSConfig: { 
          url: `${process.env.BASE_URL}/v2/user/post/getPostSignedUrl`,
          token: parent.token},
        imageDimensions: parent.imageDimensions,
        createPhotoToVideo: parent.createPhotoToVideo,
        closeUploader: parent.closeUploader,
        callback
      })

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published