Skip to content

Commit 16ec1d8

Browse files
committed
Add imageClass to FileInput
1 parent 22f31ba commit 16ec1d8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/FileInput.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const FileInput: React.FC<FileInputProps & Omit<React.InputHTMLAttributes<HTMLIn
2323
filterClass: filterClassFn,
2424
label,
2525
labelClass,
26+
imageClass,
2627
help,
2728
placeholder,
2829
value,
@@ -176,7 +177,7 @@ const FileInput: React.FC<FileInputProps & Omit<React.InputHTMLAttributes<HTMLIn
176177
<div className="shrink-0 cursor-pointer" title={!isDataUri(src) ? src : ''}>
177178
<img
178179
onClick={openFile}
179-
className={`h-16 w-16 ${imgCls(src)}`}
180+
className={imageClass ?? `h-16 w-16 ${imgCls(src)}`}
180181
alt={`Current ${useLabel ?? ''}`}
181182
src={fallbackSrc || assetsPathResolver(src)}
182183
onError={onError}
@@ -194,7 +195,7 @@ const FileInput: React.FC<FileInputProps & Omit<React.InputHTMLAttributes<HTMLIn
194195
<div className="flex w-full" title={!isDataUri(file.filePath) ? file.filePath : ''}>
195196
<img
196197
src={fallbackSrcMap[filePathUri(file.filePath)!] || assetsPathResolver(filePathUri(file.filePath)!)}
197-
className={`mr-2 h-8 w-8 ${imgCls(file.filePath)}`}
198+
className={imageClass ?? `mr-2 h-8 w-8 ${imgCls(file.filePath)}`}
198199
onError={() => onErrorMultiple(file.filePath)}
199200
alt=""
200201
/>

src/components/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface FileInputProps {
7474
filterClass?:(cls:string) => string
7575
label?: string
7676
labelClass?: string
77+
imageClass? : string
7778
help?: string
7879
placeholder?: string
7980
value?: string

0 commit comments

Comments
 (0)