Skip to content

Commit 113c473

Browse files
committed
closes #15; fix banner negative margin top
1 parent a4ca51f commit 113c473

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
1111
sourceType: 'module', // Allows for the use of imports
1212
ecmaFeatures: {
13+
js: true, // Allows for the parsing of JSX
1314
jsx: true, // Allows for the parsing of JSX
1415
},
1516
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-mui-fileuploader",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "🗃️ React mui fileuploader is a react component based on @mui v5 that allows you to upload files with an awesome ui component",
55
"main": "dist/index.esm.js",
66
"module": "dist/index.umd.js",

src/FileAttachment.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ function FileAttachment(props: FileAttachmentProps) {
7171
</Typography>
7272
<Typography variant="caption" noWrap>
7373
<React.Fragment>
74-
7574
<b
7675
// eslint-disable-next-line
7776
// @ts-ignore
@@ -95,10 +94,10 @@ function FileAttachment(props: FileAttachmentProps) {
9594
}
9695

9796
FileAttachment.propTypes = {
98-
size: PropTypes.string.isRequired,
97+
size: PropTypes.string,
9998
file: PropTypes.object,
100-
index: PropTypes.number.isRequired,
10199
disabled: PropTypes.bool,
100+
index: PropTypes.number.isRequired,
102101
handleRemoveFile: PropTypes.func.isRequired
103102
}
104103

src/FileUpload.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import { useTheme, styled } from '@mui/material/styles'
2121
// eslint-disable-next-line
2222
// @ts-ignore
2323
import uploadImage from '../public/Files And Folder_Two Color_2.svg'
24-
// eslint-disable-next-line
25-
// @ts-ignore
26-
import FileAttachment from "./FileAttachment.tsx"
24+
import FileAttachment from './FileAttachment'
2725
import {
2826
ExtendedFileProps,
2927
FileActionProps,
@@ -442,7 +440,7 @@ function FileUpload(props: FileUploadProps) {
442440
{files.length}
443441

444442
{maxUploadFiles > 0 &&
445-
`/${maxUploadFiles}`} file{files?.length > 0 && 's'} joined
443+
`/${maxUploadFiles}`} file{files?.length > 1 && 's'} joined
446444
</Box>}
447445
</Typography>
448446

@@ -478,7 +476,7 @@ function FileUpload(props: FileUploadProps) {
478476
sx={{
479477
color: "#fff",
480478
textAlign: 'center',
481-
mt: { xs: -4, sm: 2 }
479+
mt: { xs: showPlaceholderImage ? -4 : 0, sm: 2 }
482480
}}
483481
{...LabelsGridProps}
484482
>

src/index.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {PaperTypeMap} from "@mui/material/Paper/Paper"
44

55
export interface FileAttachmentProps {
66
/** size of the attachment */
7-
size: string | object,
7+
size: string,
88
/** file content of the attachment */
99
file: FileProps,
1010
/** index of the attachment */

src/react-app-env.in.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference types="react-scripts" />
2+
3+
export {}

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"isolatedModules": true, // Unconditionally emit imports for unresolved files
2424
//"resolveJsonModule": true, // Include modules imported with .json extension
2525
"noEmit": true, // Do not emit output (meaning do not compile code, only perform type checking)
26-
"jsx": "react", // Support JSX in .tsx files
26+
"jsx": "react-jsx", // Support JSX in .tsx files
2727
"rootDir": "./src",
2828
"sourceMap": true, // Generate corrresponding .map file
2929
"declaration": true, // Generate corresponding .d.ts file
@@ -41,7 +41,6 @@
4141
"**/*.md",
4242
"scripts",
4343
"acceptance-tests",
44-
"webpack",
4544
"jest",
4645
"src/setupTests.ts",
4746
"**/rollup.config.js"

0 commit comments

Comments
 (0)