From b20032bbf5dda0133b53d7adac8d262d6903f306 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Date: Mon, 19 Sep 2022 10:32:36 -0300 Subject: [PATCH] fix for header --- .../HeaderButton/HeaderButtonItem.tsx | 16 +++++++++++--- app/containers/HeaderTitle/index.tsx | 21 +++++++++++++++++++ app/views/SelectListView.tsx | 11 ++++++++-- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 app/containers/HeaderTitle/index.tsx diff --git a/app/containers/HeaderButton/HeaderButtonItem.tsx b/app/containers/HeaderButton/HeaderButtonItem.tsx index ed010cdef..92bd74e51 100644 --- a/app/containers/HeaderButton/HeaderButtonItem.tsx +++ b/app/containers/HeaderButton/HeaderButtonItem.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Platform, StyleSheet, Text } from 'react-native'; +import { Platform, StyleSheet, Text, ViewStyle } from 'react-native'; import { PlatformPressable } from '@react-navigation/elements'; import { CustomIcon, ICustomIcon, TIconsName } from '../CustomIcon'; @@ -13,6 +13,7 @@ export interface IHeaderButtonItem extends Omit { +const Item = ({ + title, + iconName, + onPress, + testID, + badge, + color, + containerStyle, + ...props +}: IHeaderButtonItem): React.ReactElement => { const { colors } = useTheme(); return ( - + <> {iconName ? ( diff --git a/app/containers/HeaderTitle/index.tsx b/app/containers/HeaderTitle/index.tsx new file mode 100644 index 000000000..7db988e78 --- /dev/null +++ b/app/containers/HeaderTitle/index.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { Text } from 'react-native'; + +import { useTheme } from '../../theme'; +import Styles from '../../views/Styles'; + +export default function HeaderTitle({ title }: { title: string }): React.ReactElement { + const { colors } = useTheme(); + return ( + + {title} + + ); +} diff --git a/app/views/SelectListView.tsx b/app/views/SelectListView.tsx index 281f89c5b..c64c2019e 100644 --- a/app/views/SelectListView.tsx +++ b/app/views/SelectListView.tsx @@ -20,6 +20,7 @@ import SearchBox from '../containers/SearchBox'; import sharedStyles from './Styles'; import { IApplicationState } from '../definitions'; import { TDataSelect } from '../definitions/IDataSelect'; +import HeaderTitle from '../containers/HeaderTitle'; const styles = StyleSheet.create({ buttonText: { @@ -82,7 +83,8 @@ class SelectListView extends React.Component , + headerRightContainerStyle: { paddingRight: 6 } }; if (isMasterDetail) { @@ -90,7 +92,12 @@ class SelectListView extends React.Component ( - this.nextAction(selected)} testID='select-list-view-submit' /> + this.nextAction(selected)} + testID='select-list-view-submit' + containerStyle={{ padding: 0 }} + /> ); navigation.setOptions(options);