1 changed files with 25 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||||
|
import { PixelRatio, Dimensions } from "react-native"; |
||||
|
|
||||
|
let scalar = PixelRatio.get(); |
||||
|
|
||||
|
function normalize(size){ |
||||
|
return (size * scalar); |
||||
|
} |
||||
|
|
||||
|
let dimensions = Dimensions.get('window'); |
||||
|
|
||||
|
let height = dimensions.height; |
||||
|
let width = dimensions.width; |
||||
|
|
||||
|
let screenWidth = width; |
||||
|
let screenHeight = height; |
||||
|
|
||||
|
if (width > height) { |
||||
|
screenHeight = width; |
||||
|
screenWidth = height; |
||||
|
} |
||||
|
|
||||
|
export const screenSections = { |
||||
|
headerHeight: normalize(20), |
||||
|
sectionWidth: screenWidth |
||||
|
} |
Loading…
Reference in new issue