Skip to content

Commit

Permalink
fix: update FileUploader docs to use FileUploader in examples (#5762)
Browse files Browse the repository at this point in the history
* fix: updating FileUploader docs to use FileUploader in examples

* Update docs/src/pages/[platform]/theming/icons/IconSwitcher.tsx

Co-authored-by: Scott Rees <[email protected]>

---------

Co-authored-by: Scott Rees <[email protected]>
  • Loading branch information
jordanvn and reesscot authored Sep 6, 2024
1 parent f1b607b commit 9b310db
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
Loader,
Icon,
} from '@aws-amplify/ui-react';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={100}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={1}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={1}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
const [files, setFiles] = React.useState({});

return (
<>
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
// private uploads will fail intentionally in docs // IGNORE
path={({ identityId }) => `private/${identityId}/`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={[
// you can list file extensions:
'.gif',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import { Button } from '@aws-amplify/ui-react';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
const ref = React.useRef(null);

return (
<>
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={3}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

const processFile = async ({ file }) => {
const fileExtension = file.name.split('.').pop();
Expand All @@ -17,7 +17,7 @@ const processFile = async ({ file }) => {

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={1}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

const processFile = ({ file, key }) => {
return {
Expand All @@ -12,7 +12,7 @@ const processFile = ({ file, key }) => {

export function App() {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={3}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
path="public/images/"
acceptedFileTypes={['image/*']}
maxFileCount={1}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*', '.zip', '.mp4']}
path="public/"
maxFileCount={10}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ThemeProvider } from '@aws-amplify/ui-react';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

const theme = {
name: 'my-theme',
Expand All @@ -20,7 +20,7 @@ const theme = {
export const App = () => {
return (
<ThemeProvider theme={theme}>
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={5}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

export const App = () => {
return (
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
autoUpload={false}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ToggleButtonGroup, ToggleButton } from '@aws-amplify/ui-react';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';

const dictionary = {
// use default strings for english
Expand Down Expand Up @@ -58,7 +58,7 @@ export const App = () => {
<ToggleButton value="en">En</ToggleButton>
<ToggleButton value="es">Es</ToggleButton>
</ToggleButtonGroup>
<StorageManager
<FileUploader
acceptedFileTypes={['image/*']}
path="public/"
maxFileCount={1}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/[platform]/theming/icons/IconSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
HiStar,
HiUpload,
} from 'react-icons/hi';
import { StorageManager } from '@aws-amplify/ui-react-storage';
import { FileUploader } from '@aws-amplify/ui-react-storage';
import {
FcExpand,
FcHighPriority,
Expand Down Expand Up @@ -195,7 +195,7 @@ export default function IconProviderExample() {
<Rating value={3.5} />
</Flex>
</Flex>
<StorageManager accessLevel="guest" maxFileCount={5} />
<FileUploader path="public/" maxFileCount={5} />
</Flex>
</IconsProvider>
);
Expand Down

0 comments on commit 9b310db

Please sign in to comment.