Guest User

Untitled

a guest
Feb 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. validateImageWidth = imageFile => {
  2. if (imageFile) {
  3. const { maxWidth } = this.props;
  4. if (imageFile.width > maxWidth) {
  5. return `Image width must be less or equal to ${maxWidth}px`;
  6. }
  7. }
  8. };
  9. validateImageHeight = imageFile => {
  10. if (imageFile) {
  11. const { maxHeight } = this.props;
  12. if (imageFile.height > maxHeight) {
  13. return `Image height must be less or equal to ${maxHeight}px`;
  14. }
  15. }
  16. };
Add Comment
Please, Sign In to add comment