Skip to content

Commit 2a443bb

Browse files
jordanvncalebpollmanreesscot
committed
chore: Rename references to Storage Manager in docs to File Uploader (#5697)
* chore: rename references to Storage Manager in docs to File Uploader * chore: reverting reference to StorageManager in deprecated props section * chore: replacing /storagemanager with /fileuploader in test sitemap * chore: update Storage Manager reference in README * chore: removing references to not-yet-existing FileUploader component * chore: reverting references to storageManager icon * fix: fixing incorrect comma placement * chore: make references to Storage in GitHub guides more generic * chore: add redirect from storagemanager to fileuploader * chore: add informational alert that storage manager has been renamed file uploader * chore: moving warning to top of page and changing text * chore: update text of name change warning * chore: remove rename warning, move info alert to top of page * Update docs/src/pages/[platform]/connected-components/storage/fileuploader/index.page.mdx Co-authored-by: Caleb Pollman <[email protected]> * Update docs/src/pages/[platform]/connected-components/storage/fileuploader/react.mdx Co-authored-by: Scott Rees <[email protected]> * chore: update rename alert text * chore: add storage component specificity to readme * chore: further update to alert text, breaking message into two paragraphs --------- Co-authored-by: Caleb Pollman <[email protected]> Co-authored-by: Scott Rees <[email protected]>
1 parent d53f740 commit 2a443bb

File tree

2 files changed

+120
-5
lines changed

2 files changed

+120
-5
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import * as React from 'react';
2+
import {
3+
Card,
4+
Button,
5+
Flex,
6+
Text,
7+
Divider,
8+
Image,
9+
Loader,
10+
Icon,
11+
} from '@aws-amplify/ui-react';
12+
import { StorageManager } from '@aws-amplify/ui-react-storage';
13+
14+
export const App = () => {
15+
return (
16+
<StorageManager
17+
acceptedFileTypes={['image/*']}
18+
path="public/"
19+
maxFileCount={100}
20+
components={{
21+
Container({ children }) {
22+
return <Card variation="elevated">{children}</Card>;
23+
},
24+
DropZone({ children, displayText, inDropZone, ...rest }) {
25+
return (
26+
<Flex
27+
alignItems="center"
28+
direction="column"
29+
padding="medium"
30+
backgroundColor={inDropZone ? 'primary.10' : ''}
31+
{...rest}
32+
>
33+
<Text>Drop files here</Text>
34+
<Divider size="small" label="or" maxWidth="10rem" />
35+
{children}
36+
</Flex>
37+
);
38+
},
39+
FilePicker({ onClick }) {
40+
return (
41+
<Button variation="primary" onClick={onClick}>
42+
Browse Files
43+
</Button>
44+
);
45+
},
46+
FileList({ files, onCancelUpload, onDeleteUpload }) {
47+
return (
48+
<Flex direction="row">
49+
{files.map(({ file, key, progress, id, status, uploadTask }) => (
50+
<Flex
51+
key={key}
52+
justifyContent="center"
53+
alignItems="center"
54+
width="5rem"
55+
height="5rem"
56+
position="relative"
57+
>
58+
<Image
59+
borderRadius="small"
60+
height="100%"
61+
objectFit="cover"
62+
src={URL.createObjectURL(file)}
63+
alt={key}
64+
/>
65+
{progress < 100 ? (
66+
<Loader
67+
position="absolute"
68+
size="large"
69+
percentage={progress}
70+
isDeterminate
71+
isPercentageTextHidden
72+
/>
73+
) : null}
74+
75+
<Button
76+
opacity="50"
77+
borderRadius="xxl"
78+
backgroundColor="background.primary"
79+
position="absolute"
80+
variation="link"
81+
size="small"
82+
onClick={() => {
83+
if (status === 'uploading') {
84+
onCancelUpload({ id, uploadTask });
85+
} else {
86+
onDeleteUpload({ id });
87+
}
88+
}}
89+
>
90+
<Icon
91+
fontSize="large"
92+
color="font.error"
93+
viewBox={{ width: 512, height: 512 }}
94+
paths={[
95+
{
96+
d: 'M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z',
97+
strokeWidth: '32',
98+
fill: 'none',
99+
strokeMiterlimit: '10',
100+
stroke: 'currentColor',
101+
},
102+
{
103+
d: 'M320 320L192 192m0 128l128-128',
104+
strokeWidth: '32',
105+
fill: 'none',
106+
strokeLinecap: 'round',
107+
stroke: 'currentColor',
108+
},
109+
]}
110+
/>
111+
</Button>
112+
</Flex>
113+
))}
114+
</Flex>
115+
);
116+
},
117+
}}
118+
/>
119+
);
120+
};

docs/src/pages/[platform]/connected-components/storage/fileuploader/props.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ export const FILE_UPLOADER = [
106106
description: 'Use the accelerated S3 endpoint to upload files.',
107107
type: 'boolean',
108108
},
109-
{
110-
name: `useAccelerateEndpoint?`,
111-
description: 'Use the accelerated S3 endpoint to upload files.',
112-
type: 'boolean',
113-
},
114109
{
115110
name: `components?.Container?`,
116111
description: 'The container the FileUploader is wrapped in.',

0 commit comments

Comments
 (0)