Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit bc854c6

Browse files
committed
Responsive height and width
1 parent bcd2219 commit bc854c6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
"test": "exit 0"
99
},
1010
"author": "DaniAkash <s.daniakash@gmail.com> (https://github.com/DaniAkash)",
11-
"license": "MIT"
11+
"license": "MIT",
12+
"dependencies": {
13+
"react-native": "^0.42.0"
14+
}
1215
}

src/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {
2+
Dimensions
3+
} from 'react-native';
4+
5+
const {height, width} = Dimensions.get('window')
6+
7+
export const responsiveHeight = (h) => {
8+
return height*(h/100);
9+
}
10+
11+
export const responsiveWidth = (w) => {
12+
return width*(w/100);
13+
}

0 commit comments

Comments
 (0)