useDimensions
useDimensions copied to clipboard
Fixes values of top and left which are inverted
top value should correspond to the y value, not the x value.
This PR fix this and remove duplication.