/** * Sample React Native App * https://github.com/facebook/react-native * * Generated with the TypeScript template * https://github.com/emin93/react-native-template-typescript * * @format */ import "react-native-get-random-values"; import "react-native-url-polyfill/auto"; import React, { Fragment, useState } from "react"; import { SafeAreaView, StyleSheet, ScrollView, StatusBar, Button, Text } from "react-native"; import { S3 } from "@aws-sdk/client-s3"; import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity"; import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; import { //@ts-ignore imported ENVs are injected by Babel at compile time AWS_SMOKE_TEST_IDENTITY_POOL_ID, //@ts-ignore AWS_SMOKE_TEST_REGION, //@ts-ignore AWS_SMOKE_TEST_BUCKET, } from "react-native-dotenv"; const App = () => { const [responseContent, setResponseContent] = useState(""); const [uploadId, setUploadId] = useState(""); const [uploadParts, setUploadParts] = useState>([]); const s3 = new S3({ credentials: fromCognitoIdentityPool({ identityPoolId: AWS_SMOKE_TEST_IDENTITY_POOL_ID, client: new CognitoIdentityClient({ region: AWS_SMOKE_TEST_REGION, }), }), region: AWS_SMOKE_TEST_REGION, }); const Key = `smoke-test-rn`; return ( <>