Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
#### Step 1

Install [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons#installation) if you do not already have it.
Install [react-native-extra-dimensions-android](https://github.com/Sunhat/react-native-extra-dimensions-android#installation) if you do not already have it.

```
npm install react-native-vector-icons --save && react-native link react-native-vector-icons
npm install react-native-extra-dimensions-android --save && react-native link react-native-extra-dimensions-android
```

#### Step 2
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-bottom-drawer",
"version": "1.0.2",
"version": "1.0.3",
"main": "index.js",
"scripts": {
"test": "jest"
Expand All @@ -21,7 +21,8 @@
"drawer"
],
"peerDependencies": {
"react-native-vector-icons": "^4.0.0"
"react-native-vector-icons": "^4.0.0",
"react-native-extra-dimensions-android": "^0.21.0"
},
"devDependencies": {
"babel-jest": "^19.0.0",
Expand Down
8 changes: 7 additions & 1 deletion src/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import {
View
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ExtraDimensions from 'react-native-extra-dimensions-android';

// Get screen dimensions
const { width, height } = Dimensions.get('window');
const { width } = Dimensions.get('window');
const height = Platform.OS === 'ios' ? Dimensions.get('screen').height : Dimensions.get('screen').height - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT');

export default class Drawer extends Component {

Expand All @@ -30,6 +32,7 @@ export default class Drawer extends Component {
headerHeight: PropTypes.number,
// Height of the visible teaser area at the bottom of the screen
teaserHeight: PropTypes.number,
onClose: PropTypes.func,
};

// Set default prop values
Expand All @@ -38,6 +41,7 @@ export default class Drawer extends Component {
header: 'Messages',
headerHeight: 70,
teaserHeight: 75,
onClose:()=>{}
};

// Define state
Expand Down Expand Up @@ -306,6 +310,7 @@ export default class Drawer extends Component {

// Minimize window and keep a teaser at the bottom
close = () => {
this.props.onClose();
this._scrollView.scrollTo({ y: 0 });
Animated.timing(this._animatedPosition, {
toValue: this.config.position.start,
Expand Down Expand Up @@ -357,6 +362,7 @@ const styles = StyleSheet.create({
alignItems: 'center', // center children
justifyContent: 'flex-end', // align popup at the bottom
backgroundColor: 'transparent', // transparent background
elevation: 1, // fix android dynamic zindex issue
},
// Semi-transparent background below popup
backdrop: {
Expand Down