- Pass custom file size to ImageField
- Update getmonitors to match be change (-1 is not accepted as valid param anymore) - Fix Select not updateable
This commit is contained in:
1 parent
ff7fe7f5f2
commit
e8d9f310c1
4 files changed
+11
-7
No files matched your search
@@ -11,11 +11,12 @@ import { checkImage } from "../../../Utils/fileUtils";
|
||||
* @param {string} props.id - The unique identifier for the input field.
|
||||
* @param {string} props.src - The URL of the image to display.
|
||||
* @param {function} props.onChange - The function to handle file input change.
|
||||
* @param {string} props.isRound - The shape of the image to display.
|
||||
* @param {boolean} props.isRound - Whether the shape of the image to display is round.
|
||||
* @param {string} props.maxSize - Custom message for the max uploaded file size
|
||||
* @returns {JSX.Element} The rendered component.
|
||||
*/
|
||||
|
||||
const ImageField = ({ id, src, loading, onChange, error, isRound = true }) => {
|
||||
const ImageField = ({ id, src, loading, onChange, error, isRound = true, maxSize }) => {
|
||||
const theme = useTheme();
|
||||
const error_border_style = error ? { borderColor: theme.palette.error.main } : {};
|
||||
|
||||
@@ -117,7 +118,7 @@ const ImageField = ({ id, src, loading, onChange, error, isRound = true }) => {
|
||||
color={theme.palette.text.tertiary}
|
||||
sx={{ opacity: 0.6 }}
|
||||
>
|
||||
(maximum size: 3MB)
|
||||
(maximum size: {maxSize??"3MB"})
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Box>
|
||||
@@ -168,6 +169,7 @@ ImageField.propTypes = {
|
||||
src: PropTypes.string,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
isRound: PropTypes.bool,
|
||||
maxSize: PropTypes.string
|
||||
};
|
||||
|
||||
export default ImageField;
|
||||
Reference in new issue
Block a user