This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Uploady from "@rpldy/uploady"; | |
import UploadButton from "@rpldy/upload-button"; | |
import UploadPreview from "@rpldy/upload-preview"; | |
export default function UploadWithCrop() { | |
const previewMethodsRef = useRef(); | |
return ( | |
<Uploady | |
destination={{ url: "[upload-url]" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactCrop from "react-image-crop"; | |
import { withRequestPreSendUpdate, useItemFinalizeListener } from "@rpldy/uploady"; | |
import { PREVIEW_TYPES } from "@rpldy/upload-preview"; | |
import cropImage from "./image-crop-helper"; | |
const ItemPreviewWithCrop = withRequestPreSendUpdate(props => { | |
const { id, url, isFallback, type, updateRequest, requestData, previewMethods } = props; | |
const [finished, setFinished] = useState(false); | |
const [crop, setCrop] = useState(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Upload = () => { | |
const [uploadUrl, setUploadUrl] = useState(false); | |
const uploadyContext = useContext(UploadyContext); | |
useItemFinishListener((item) => { | |
const response = JSON.parse(item.uploadResponse.data); | |
console.log(`item ${item.id} finished uploading, response was: `, response); | |
setUploadUrl(response.url); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const styles = StyleSheet.create({ | |
uploadedImage: { | |
width: 400, | |
height: 400, | |
resizeMode: 'cover', | |
}, | |
body: { | |
backgroundColor: "#ffffff", | |
}, | |
sectionContainer: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useCallback, useContext } from "react"; | |
import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, Button, ImageBackground, Image } from "react-native"; | |
import DocumentPicker from "react-native-document-picker/index"; | |
import NativeUploady, { | |
UploadyContext, | |
useItemFinishListener, | |
useItemStartListener, | |
useItemErrorListener, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import Uploady from "@rpldy/uploady"; | |
import { usePasteUpload } from "@rpldy/upload-paste"; | |
const ElementPaste = (props) => { | |
const containerRef = useRef(null); | |
const onPasteUpload = useCallback(({ count }) => { | |
console.log("ELEMENT PASTE-TO-UPLOAD files: ", count); | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef, useCallback } from "react"; | |
const useIsMounted = () => { | |
const mountedRef = useRef(true); | |
useEffect(() => { | |
return () => { | |
mountedRef.current = false; | |
}; | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"%ConEmuDrive%\Program Files (x86)\Git\bin\sh.exe" --login -i -new_console:a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var crypto = require("crypto"); | |
var EncryptionHelper = (function () { | |
function getKeyAndIV(key, callback) { | |
crypto.pseudoRandomBytes(16, function (err, ivBuffer) { | |
var keyBuffer = (key instanceof Buffer) ? key : new Buffer(key) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useLayoutEffect } from "react"; | |
import { StyleSheetManager } from "styled-components"; | |
import PreviewContext from "./PreviewContext"; | |
const WithPreviewContext = ({ children }) => | |
<PreviewContext.Provider value={true}> | |
<main> | |
{children} | |
</main> | |
</PreviewContext.Provider>; |