File size: 449 Bytes
74aacd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import React from 'react'
import { useRecoilValue } from 'recoil'
import { imageHeightState, imageWidthState } from '../../store/Atoms'

const ImageSize = () => {
  const imageWidth = useRecoilValue(imageWidthState)
  const imageHeight = useRecoilValue(imageHeightState)

  if (!imageWidth || !imageHeight) {
    return null
  }

  return (
    <div className="imageSize">
      {imageWidth}x{imageHeight}
    </div>
  )
}

export default ImageSize