@popsure/dirty-swan 0.27.18 → 0.27.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,6 +16,11 @@ interface Props {
|
|
|
16
16
|
onRemoveFile: (id: string) => void;
|
|
17
17
|
isCondensed?: boolean;
|
|
18
18
|
maxFiles?: number;
|
|
19
|
+
textOverrides?: {
|
|
20
|
+
instructionsText?: string;
|
|
21
|
+
currentlyUploadingText?: string;
|
|
22
|
+
supportsText?: string;
|
|
23
|
+
};
|
|
19
24
|
}
|
|
20
|
-
declare const _default: ({ uploadedFiles, onFileSelect, uploading, onRemoveFile, isCondensed, maxFiles, }: Props) => JSX.Element;
|
|
25
|
+
declare const _default: ({ uploadedFiles, onFileSelect, uploading, onRemoveFile, isCondensed, maxFiles, textOverrides, }: Props) => JSX.Element;
|
|
21
26
|
export default _default;
|
package/package.json
CHANGED
|
@@ -110,3 +110,20 @@ MultiDropzone component allows upload of multiple documents / files.
|
|
|
110
110
|
onRemoveFile={() => {}}
|
|
111
111
|
/>
|
|
112
112
|
</Preview>
|
|
113
|
+
|
|
114
|
+
### i18n support
|
|
115
|
+
|
|
116
|
+
<Preview>
|
|
117
|
+
<MultiDropzone
|
|
118
|
+
uploadedFiles={[]}
|
|
119
|
+
onFileSelect={() => {}}
|
|
120
|
+
uploading={false}
|
|
121
|
+
onRemoveFile={() => {}}
|
|
122
|
+
textOverrides={{
|
|
123
|
+
instructionsText: 'Datei auswählen oder per Drag & Drop platzieren',
|
|
124
|
+
supportsText: 'Unterstützt werden JPEG, PNG, PDF',
|
|
125
|
+
currentlyUploadingText:
|
|
126
|
+
'Bitte warten während die Datei hochgeladen wird...',
|
|
127
|
+
}}
|
|
128
|
+
/>
|
|
129
|
+
</Preview>
|
|
@@ -46,6 +46,11 @@ interface Props {
|
|
|
46
46
|
onRemoveFile: (id: string) => void;
|
|
47
47
|
isCondensed?: boolean;
|
|
48
48
|
maxFiles?: number;
|
|
49
|
+
textOverrides?: {
|
|
50
|
+
instructionsText?: string;
|
|
51
|
+
currentlyUploadingText?: string;
|
|
52
|
+
supportsText?: string;
|
|
53
|
+
};
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
export default ({
|
|
@@ -55,6 +60,7 @@ export default ({
|
|
|
55
60
|
onRemoveFile,
|
|
56
61
|
isCondensed = false,
|
|
57
62
|
maxFiles = 0,
|
|
63
|
+
textOverrides,
|
|
58
64
|
}: Props) => {
|
|
59
65
|
const [error, setError] = useState('');
|
|
60
66
|
|
|
@@ -93,10 +99,13 @@ export default ({
|
|
|
93
99
|
/>
|
|
94
100
|
<div className={`p-h4 mt8 ${isCondensed ? styles.textInline : ''}`}>
|
|
95
101
|
{uploading
|
|
96
|
-
?
|
|
97
|
-
|
|
102
|
+
? textOverrides?.currentlyUploadingText ||
|
|
103
|
+
'Please wait while uploading file...'
|
|
104
|
+
: textOverrides?.instructionsText || 'Choose file or drag & drop'}
|
|
105
|
+
</div>
|
|
106
|
+
<div className="p-p--small tc-grey-500">
|
|
107
|
+
{textOverrides?.supportsText || 'Supports JPEG, PNG, PDF'}
|
|
98
108
|
</div>
|
|
99
|
-
<div className="p-p--small tc-grey-500">Supports JPEG, PNG, PDF</div>
|
|
100
109
|
</div>
|
|
101
110
|
<AnimateHeight duration={300} height={error ? 'auto' : 0}>
|
|
102
111
|
<p className="tc-red-500 p-p--small">{error}</p>
|