Skip to content

Commit 171e68b

Browse files
authored
Feat/top bar container style (#1222)
* Update generate types * Support passing containerStyle to Modal.TopBar component
1 parent 5b49d81 commit 171e68b

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

generatedTypes/components/modal/TopBar.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { StyleProp, TextStyle, ImageSourcePropType } from 'react-native';
3+
import { ViewProps } from '../../components/view';
34
import { ButtonProps } from '../../components/button';
45
export interface ModalTopBarProps {
56
/**
@@ -46,6 +47,10 @@ export interface ModalTopBarProps {
4647
* whether to include status bar or not (height claculations)
4748
*/
4849
includeStatusBar?: boolean;
50+
/**
51+
* style for the TopBar container
52+
*/
53+
containerStyle?: ViewProps['style'];
4954
}
5055
declare const _default: React.ComponentClass<ModalTopBarProps & {
5156
useCustomTheme?: boolean | undefined;

generatedTypes/components/scrollBar/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ declare const Item: {
8484
displayName: string;
8585
};
8686
declare const _default: React.ComponentClass<ScrollBarProps & {
87+
/**
88+
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
89+
*/
8790
useCustomTheme?: boolean | undefined;
8891
}, any> & typeof ScrollBar;
8992
export default _default;

src/components/modal/TopBar.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {asBaseComponent} from '../../commons/new';
44
import {Constants} from '../../helpers';
55
import Assets from '../../assets';
66
import {Colors, Typography} from '../../style';
7-
import View from '../../components/view';
7+
import View, {ViewProps} from '../../components/view';
88
import Button, {ButtonProps} from '../../components/button';
99
import Text from '../../components/text';
1010

@@ -53,6 +53,10 @@ export interface ModalTopBarProps {
5353
* whether to include status bar or not (height claculations)
5454
*/
5555
includeStatusBar?: boolean;
56+
/**
57+
* style for the TopBar container
58+
*/
59+
containerStyle?: ViewProps['style'];
5660
}
5761

5862
type topBarButtonProp = {
@@ -128,10 +132,10 @@ class TopBar extends Component<ModalTopBarProps> {
128132
}
129133

130134
render() {
131-
const {title, titleStyle, includeStatusBar} = this.props;
135+
const {title, titleStyle, includeStatusBar, containerStyle} = this.props;
132136

133137
return (
134-
<View>
138+
<View style={containerStyle}>
135139
{includeStatusBar && <View style={styles.statusBar}/>}
136140
<View style={styles.container}>
137141
<View row flex bottom paddingL-15 centerV>

0 commit comments

Comments
 (0)