Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- validateImageWidth = imageFile => {
- if (imageFile) {
- const { maxWidth } = this.props;
- if (imageFile.width > maxWidth) {
- return `Image width must be less or equal to ${maxWidth}px`;
- }
- }
- };
- validateImageHeight = imageFile => {
- if (imageFile) {
- const { maxHeight } = this.props;
- if (imageFile.height > maxHeight) {
- return `Image height must be less or equal to ${maxHeight}px`;
- }
- }
- };
Add Comment
Please, Sign In to add comment