Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Rapid Application Development with AWS Amplify

You're reading from  Rapid Application Development with AWS Amplify

Product type Book
Published in Jul 2021
Publisher Packt
ISBN-13 9781800207233
Pages 344 pages
Edition 1st Edition
Languages
Author (1):
Adrian Leung Adrian Leung
Profile icon Adrian Leung

Table of Contents (14) Chapters

Preface 1. Section 1: Getting Ready
2. Chapter 1: Getting Familiar with the Amplify CLI and Amplify Console 3. Chapter 2: Creating a React App with AmplifyJS and TypeScript 4. Section 2: Building a Photo Sharing App
5. Chapter 3: Pluggable Amplify UI Components 6. Chapter 4: User Management with Amplify Authentication 7. Chapter 5: Creating a Blog Post with Amplify GraphQL 8. Chapter 6: Uploading and Sharing Photos with Amplify Storage 9. Section 3: Production Readiness
10. Chapter 7: Setting Up an Amplify Pipeline 11. Chapter 8: Test Automation with Cypress 12. Chapter 9: Setting Up a Custom Domain Name and the Amplify Admin UI 13. Other Books You May Enjoy

Adding the React Photo Picker UI component and Amplify Storage with ReactJS

In this section, we will learn how to add the Photo Picker UI component to the app, as well as the code that lets the user add a photo to the app through Amplify Storage. This will allow other users to see the photo through the app. Normally, we would need to write a lot of frontend and backend code to achieve this, but in this section, I will show you how to code in a minimal way. Let's get started:

  1. Let's open the App.css file and add the following CSS code so that we can style the Amplify S3 Image UI component at the bottom of the CSS file:
    amplify-s3-image {
      --width: 400px;
    }
  2. Open the App.tsx file and add the following code to it:
    import React, { useEffect, useState, SetStateAction } from "react";
    import "./App.css";
    import Amplify, { API, graphqlOperation, Storage } from "aws-amplify";
    import * as mutations from "./graphql/mutations"...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}