RoomView header

This commit is contained in:
Diego Mello 2020-05-21 15:34:04 -03:00
parent e4de36d25d
commit f764527d60
3 changed files with 40 additions and 41 deletions

View File

@ -18,7 +18,8 @@ const styles = StyleSheet.create({
container: {
flex: 1,
marginRight: isAndroid ? 15 : 5,
marginLeft: isAndroid ? androidMarginLeft : -10
marginLeft: isAndroid ? androidMarginLeft : -10,
justifyContent: 'center'
},
titleContainer: {
alignItems: 'center',

View File

@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet } from 'react-native';
// import { HeaderBackButton } from 'react-navigation-stack';
import { HeaderBackButton } from '@react-navigation/stack';
import { isIOS } from '../../../utils/deviceInfo';
import { themes } from '../../../constants/colors';
@ -18,15 +18,14 @@ const RoomHeaderLeft = ({
tmid, unreadsCount, navigation, baseUrl, userId, token, title, t, theme, goRoomActionsView, split
}) => {
if (!split || tmid) {
// return (
// <HeaderBackButton
// title={unreadsCount > 999 ? '+999' : unreadsCount || ' '}
// backTitleVisible={isIOS}
// onPress={() => navigation.goBack()}
// tintColor={themes[theme].headerTintColor}
// />
// );
return null;
return (
<HeaderBackButton
label={unreadsCount > 999 ? '+999' : unreadsCount || ' '}
// backTitleVisible={isIOS}
onPress={() => navigation.goBack()}
tintColor={themes[theme].headerTintColor}
/>
);
}
if (baseUrl && userId && token) {
return (

View File

@ -1041,21 +1041,20 @@ RoomView.navigationOptions = ({ navigation, route }) => {
return {};
}
return {
// headerTitle: (
// <RoomHeaderView
// rid={rid}
// prid={prid}
// tmid={tmid}
// title={title}
// subtitle={subtitle}
// type={t}
// widthOffset={tmid ? 95 : 130}
// roomUserId={roomUserId}
// visitor={visitor}
// goRoomActionsView={goRoomActionsView}
// />
// ),
title: 'asdahsdohia',
headerTitle: () => (
<RoomHeaderView
rid={rid}
prid={prid}
tmid={tmid}
title={title}
subtitle={subtitle}
type={t}
widthOffset={tmid ? 95 : 130}
roomUserId={roomUserId}
visitor={visitor}
goRoomActionsView={goRoomActionsView}
/>
),
headerRight: () => (
<RightButtons
rid={rid}
@ -1065,21 +1064,21 @@ RoomView.navigationOptions = ({ navigation, route }) => {
toggleFollowThread={toggleFollowThread}
/>
),
// headerLeft: () => (
// <RoomHeaderLeft
// tmid={tmid}
// unreadsCount={unreadsCount}
// navigation={navigation}
// baseUrl={baseUrl}
// userId={userId}
// token={token}
// title={avatar}
// theme='light' // TODO: ?
// t={t}
// goRoomActionsView={goRoomActionsView}
// split={false} // TODO: ?
// />
// )
headerLeft: () => (
<RoomHeaderLeft
tmid={tmid}
unreadsCount={unreadsCount}
navigation={navigation}
baseUrl={baseUrl}
userId={userId}
token={token}
title={avatar}
theme='light' // TODO: ?
t={t}
goRoomActionsView={goRoomActionsView}
split={false} // TODO: ?
/>
)
};
};