fix: 이미지 업로드 preview size fix

mpower
minuk926 2 years ago
parent c41c37f682
commit c952afc0f6

@ -15,7 +15,12 @@ const FileForm = ({
const file = e.target.files[0];
if (file.type.includes('image')) {
alert.show(
<img alt={`${file.name}`} style={{ maxWidth: '400px', margin: 'auto' }} resizemode="contain" src={URL.createObjectURL(file)} />
<img
alt={`${file.name}`}
style={{ maxWidth: '400px', maxHeight: '400px', margin: 'auto' }}
resizemode="contain"
src={URL.createObjectURL(file)}
/>
);
}
handleChangeFile(file);

@ -7,7 +7,9 @@ const ImageFileInputForms = ({ fieldName, index, labelName, selectedFile, fileNa
const onChangeFile = (e) => {
const file = e.target.files[0];
if (file.type.includes('image')) {
alert.show(<img alt={`${file.name}`} style={{ maxWidth: '400px', margin: 'auto' }} src={URL.createObjectURL(file)} />);
alert.show(
<img alt={`${file.name}`} style={{ maxWidth: '400px', maxHeight: '400px', margin: 'auto' }} src={URL.createObjectURL(file)} />
);
}
handleChangeFile(e);
};

Loading…
Cancel
Save