-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.native.js
More file actions
47 lines (42 loc) · 882 Bytes
/
index.native.js
File metadata and controls
47 lines (42 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import Breakdancer from './breakdancer';
import { Dimensions } from 'react-native';
/**
* Breakdancer is a simple breakpoint utility.
*
* @constructor
* @param {Object} specification Different breakpoints we need to know.
* @public
*/
export default class NativeDancer extends Breakdancer {
constructor(specification) {
super(specification);
this.breakpoint = this.currently();
}
/**
* Return the current view port.
*
* @returns {Object} viewport
* @public
*/
viewport() {
return Dimensions.get('window');
}
/**
* Lookup the view port width.
*
* @returns {Number} Current width.
* @public
*/
width() {
return Dimensions.get('window').width;
}
/**
* Lookup the view port height.
*
* @returns {Number} Current height.
* @public
*/
height() {
return Dimensions.get('window').height;
}
}