Skip to content

Commit 4559859

Browse files
committed
Whole style is almost re-written and bug all fixes. Stable version is alive
1 parent badfc0f commit 4559859

8 files changed

Lines changed: 155 additions & 89 deletions

File tree

example/App.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import React, { Component, Fragment } from "react";
2-
import { Text, StatusBar, ImageBackground } from "react-native";
3-
import { BottomMenu, Item } from "react-native-bottom-menu";
1+
import React, { Component } from "react";
2+
import { Text, StatusBar, SafeAreaView, ImageBackground } from "react-native";
3+
// import { BottomMenu, Item } from "react-native-bottom-menu";
4+
import BottomMenu from "./lib/src/components/bottomMenu/BottomMenu";
5+
import Item from "./lib/src/components/item/Item";
46
import Androw from "react-native-androw";
57
import styles from "./styles/App.style";
68

@@ -14,12 +16,12 @@ class App extends Component {
1416

1517
render() {
1618
return (
17-
<Fragment>
18-
<StatusBar barStyle="dark-content" />
19-
<ImageBackground
20-
style={styles.backgroundStyle}
21-
source={require("./assets/Watusi.png")}
22-
>
19+
<ImageBackground
20+
style={styles.backgroundStyle}
21+
source={require("./assets/Watusi.png")}
22+
>
23+
<SafeAreaView style={{ flex: 1 }}>
24+
<StatusBar barStyle="dark-content" />
2325
<Androw style={styles.headerStyle}>
2426
<Text style={styles.textStyle}>React Native Bottom Menu</Text>
2527
</Androw>
@@ -57,8 +59,8 @@ class App extends Component {
5759
onPress={() => this.setState({ isActive: "settings" })}
5860
/>
5961
</BottomMenu>
60-
</ImageBackground>
61-
</Fragment>
62+
</SafeAreaView>
63+
</ImageBackground>
6264
);
6365
}
6466
}

example/ios/Podfile.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ PODS:
8181
- React-RCTWebSocket (0.60.4):
8282
- React-Core (= 0.60.4)
8383
- React-fishhook (= 0.60.4)
84+
- RNVectorIcons (6.6.0):
85+
- React
8486
- yoga (0.60.4.React)
8587

8688
DEPENDENCIES:
@@ -105,6 +107,7 @@ DEPENDENCIES:
105107
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
106108
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
107109
- React-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`)
110+
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
108111
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)
109112

110113
SPEC REPOS:
@@ -154,6 +157,8 @@ EXTERNAL SOURCES:
154157
:path: "../node_modules/react-native/Libraries/Vibration"
155158
React-RCTWebSocket:
156159
:path: "../node_modules/react-native/Libraries/WebSocket"
160+
RNVectorIcons:
161+
:path: "../node_modules/react-native-vector-icons"
157162
yoga:
158163
:path: "../node_modules/react-native/ReactCommon/yoga"
159164

@@ -180,8 +185,9 @@ SPEC CHECKSUMS:
180185
React-RCTText: e0f224898b13af9aa036ea7cb3d438daa68c1044
181186
React-RCTVibration: 0bea40cd51bd089bd591a8f74c86e91fdf2666c5
182187
React-RCTWebSocket: 163873f4cdd5f1058a9483443404fc3801581cb6
188+
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
183189
yoga: c2c050f6ae6e222534760cc82f559b89214b67e2
184190

185-
PODFILE CHECKSUM: e6321daab2a139195c1bcaad4b674c568140b44a
191+
PODFILE CHECKSUM: 562469ebc095c1495478a8d72e0eaab973986bba
186192

187193
COCOAPODS: 1.7.4

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 102 additions & 52 deletions
Large diffs are not rendered by default.

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
"lint": "eslint ."
99
},
1010
"dependencies": {
11+
"@freakycoder/react-native-helpers": "0.0.21",
1112
"react": "16.8.6",
1213
"react-native": "0.60.4",
1314
"react-native-androw": "0.0.31",
1415
"react-native-dynamic-vector-icons": "0.0.4",
16+
"react-native-material-ripple": "^0.8.0",
1517
"react-native-vector-icons": "^6.6.0"
1618
},
1719
"devDependencies": {

lib/src/components/bottomMenu/BottomMenu.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
import React, { Component } from "react";
22
import PropTypes from "prop-types";
3-
import { View } from "react-native";
3+
import { View, Dimensions } from "react-native";
44
import Androw from "react-native-androw";
55
import { _container, mainStyle, _shadowStyle } from "./BottomMenu.style";
66

7+
const { width: ScreenWidth, height: ScreenHeight } = Dimensions.get("window");
8+
79
class BottomMenu extends Component {
810
render() {
911
const {
1012
width,
1113
height,
12-
backgroundColor,
13-
shadowColor,
14-
shadowStyle,
1514
styles,
16-
children
15+
children,
16+
shadowStyle,
17+
shadowColor,
18+
backgroundColor
1719
} = this.props;
1820
return (
1921
<Androw
2022
style={[
21-
styles || _container(height),
23+
styles || _container(height, width),
2224
shadowStyle || _shadowStyle(shadowColor)
2325
]}
2426
>
@@ -38,10 +40,10 @@ BottomMenu.propTypes = {
3840
};
3941

4042
BottomMenu.defaultProps = {
41-
width: null,
42-
height: null,
43+
height: 75,
4344
shadowColor: "#000",
44-
backgroundColor: "white"
45+
backgroundColor: "white",
46+
width: ScreenWidth * 0.75
4547
};
4648

4749
export default BottomMenu;

lib/src/components/bottomMenu/BottomMenu.style.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import {
2+
isIPhoneX,
3+
getStatusBarHeight
4+
} from "@freakycoder/react-native-helpers";
5+
16
export function _shadowStyle(shadowColor) {
27
return {
38
shadowRadius: 8,
@@ -14,28 +19,27 @@ export function mainStyle(height, width, backgroundColor) {
1419
return {
1520
width,
1621
height,
17-
minWidth: 220,
1822
paddingTop: 8,
23+
paddingLeft: 32,
24+
backgroundColor,
25+
paddingRight: 32,
1926
paddingBottom: 8,
20-
paddingLeft: 8,
21-
paddingRight: 8,
27+
position: "absolute",
2228
flexDirection: "row",
23-
justifyContent: "space-evenly",
24-
minHeight: 60,
25-
backgroundColor,
26-
maxWidth: "95%",
2729
alignItems: "center",
28-
justifyContent: "center",
29-
borderRadius: height ? height / 2 : 100
30+
justifyContent: "space-evenly",
31+
borderRadius: height ? height / 2 : 100,
32+
bottom: isIPhoneX ? getStatusBarHeight() : 8
3033
};
3134
}
3235

33-
export function _container(maxHeight) {
36+
export function _container(height, width) {
3437
return {
35-
flex: 1,
36-
maxHeight: maxHeight,
38+
width,
39+
height,
40+
bottom: 0,
3741
alignSelf: "center",
38-
justifyContent: "flex-end"
42+
position: "absolute"
3943
};
4044
}
4145

lib/src/components/item/Item.style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export function _textStyle(textColor, fontSize) {
88
export default {
99
container: {
1010
padding: 8,
11-
marginLeft: 3,
12-
marginRight: 3,
11+
marginLeft: 5,
12+
marginRight: 5,
1313
alignItems: "center",
1414
alignContent: "center",
1515
flexDirection: "column",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bottom-menu",
3-
"version": "0.0.12",
3+
"version": "0.1.0",
44
"description": "Fully customizable and dynamic Bottom Menu for React Native.",
55
"keywords": [
66
"bottom",

0 commit comments

Comments
 (0)