Skip to content

Commit 05ca7f7

Browse files
committed
expose useSafeArea prop in ActionBar, also allow to control whether the ActionBar is positioned relative or absolute, using keepRelative prop
1 parent 2bbab7b commit 05ca7f7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

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-ui-lib",
3-
"version": "3.3.34",
3+
"version": "3.3.35",
44
"main": "index.js",
55
"author": "Ethan Sharabi <[email protected]>",
66
"publishConfig": {

src/components/actionBar/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ export default class ActionBar extends BaseComponent {
3232
* should action be equally centered
3333
*/
3434
centered: PropTypes.bool,
35+
/**
36+
* use safe area, in case action bar attached to the bottom (default: true)
37+
*/
38+
useSafeArea: PropTypes.bool,
39+
/**
40+
* keep the action bar postion relative instead of it absolute position
41+
*/
42+
keepRelative: PropTypes.bool,
3543
/**
3644
* style the action bar
3745
*/
@@ -41,6 +49,7 @@ export default class ActionBar extends BaseComponent {
4149
static defaultProps = {
4250
height: 48,
4351
backgroundColor: Colors.white,
52+
useSafeArea: true,
4453
};
4554

4655
generateStyles() {
@@ -59,10 +68,10 @@ export default class ActionBar extends BaseComponent {
5968
}
6069

6170
render() {
62-
const {actions, centered, style, ...others} = this.props;
71+
const {actions, centered, style, useSafeArea, keepRelative, ...others} = this.props;
6372

6473
return (
65-
<View useSafeArea style={this.styles.absoluteContainer}>
74+
<View useSafeArea={useSafeArea} style={[!keepRelative && this.styles.absoluteContainer]}>
6675
<View
6776
row
6877
centerV

0 commit comments

Comments
 (0)