Skip to content

Feat/top bar container style #1222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2021
Merged
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
5 changes: 5 additions & 0 deletions generatedTypes/components/modal/TopBar.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { StyleProp, TextStyle, ImageSourcePropType } from 'react-native';
import { ViewProps } from '../../components/view';
import { ButtonProps } from '../../components/button';
export interface ModalTopBarProps {
/**
Expand Down Expand Up @@ -46,6 +47,10 @@ export interface ModalTopBarProps {
* whether to include status bar or not (height claculations)
*/
includeStatusBar?: boolean;
/**
* style for the TopBar container
*/
containerStyle?: ViewProps['style'];
}
declare const _default: React.ComponentClass<ModalTopBarProps & {
useCustomTheme?: boolean | undefined;
Expand Down
3 changes: 3 additions & 0 deletions generatedTypes/components/scrollBar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ declare const Item: {
displayName: string;
};
declare const _default: React.ComponentClass<ScrollBarProps & {
/**
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
*/
useCustomTheme?: boolean | undefined;
}, any> & typeof ScrollBar;
export default _default;
10 changes: 7 additions & 3 deletions src/components/modal/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {asBaseComponent} from '../../commons/new';
import {Constants} from '../../helpers';
import Assets from '../../assets';
import {Colors, Typography} from '../../style';
import View from '../../components/view';
import View, {ViewProps} from '../../components/view';
import Button, {ButtonProps} from '../../components/button';
import Text from '../../components/text';

Expand Down Expand Up @@ -53,6 +53,10 @@ export interface ModalTopBarProps {
* whether to include status bar or not (height claculations)
*/
includeStatusBar?: boolean;
/**
* style for the TopBar container
*/
containerStyle?: ViewProps['style'];
}

type topBarButtonProp = {
Expand Down Expand Up @@ -128,10 +132,10 @@ class TopBar extends Component<ModalTopBarProps> {
}

render() {
const {title, titleStyle, includeStatusBar} = this.props;
const {title, titleStyle, includeStatusBar, containerStyle} = this.props;

return (
<View>
<View style={containerStyle}>
{includeStatusBar && <View style={styles.statusBar}/>}
<View style={styles.container}>
<View row flex bottom paddingL-15 centerV>
Expand Down