Minor tweaks
This commit is contained in:
parent
680476a9a7
commit
6c9a3f977e
|
@ -1,11 +1,12 @@
|
|||
import React from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
|
||||
import { useOrientation } from '../dimensions';
|
||||
import { isIOS, isTablet } from '../utils/deviceInfo';
|
||||
import { themes } from '../constants/colors';
|
||||
import { useTheme } from '../theme';
|
||||
import sharedStyles from '../views/Styles';
|
||||
import { themes } from '../constants/colors';
|
||||
import TextInput from '../presentation/TextInput';
|
||||
import { isIOS, isTablet } from '../utils/deviceInfo';
|
||||
import { useOrientation } from '../dimensions';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
|
@ -21,11 +22,11 @@ const styles = StyleSheet.create({
|
|||
interface ISearchHeaderProps {
|
||||
onSearchChangeText?: (text: string) => void;
|
||||
placeholder: string;
|
||||
theme: string;
|
||||
testID: string;
|
||||
}
|
||||
|
||||
const SearchHeader = ({ onSearchChangeText, placeholder, theme, testID }: ISearchHeaderProps) => {
|
||||
const SearchHeader = ({ onSearchChangeText, placeholder, testID }: ISearchHeaderProps) => {
|
||||
const { theme } = useTheme();
|
||||
const isLight = theme === 'light';
|
||||
const { isLandscape } = useOrientation();
|
||||
const scale = isIOS && isLandscape && !isTablet ? 0.8 : 1;
|
||||
|
|
|
@ -65,7 +65,7 @@ export interface IThread {
|
|||
dlm?: number;
|
||||
tmid?: string;
|
||||
tcount?: number | string;
|
||||
tlm?: Date;
|
||||
tlm?: string;
|
||||
replies?: string[];
|
||||
mentions?: IUserMention[];
|
||||
channels?: IUserChannel[];
|
||||
|
|
|
@ -56,7 +56,9 @@ export type ModalStackParamList = {
|
|||
rid: string;
|
||||
room: ISubscription;
|
||||
};
|
||||
DiscussionsView: undefined;
|
||||
DiscussionsView: {
|
||||
rid: string;
|
||||
};
|
||||
SearchMessagesView: {
|
||||
rid: string;
|
||||
t: SubscriptionType;
|
||||
|
|
|
@ -66,8 +66,13 @@ interface IItem {
|
|||
const Item = ({ item, baseUrl, user, onPress }: IItem): JSX.Element => {
|
||||
const { theme } = useTheme();
|
||||
const username = item?.u?.username;
|
||||
const messageTime = moment(item.ts).format('LT');
|
||||
const messageDate = formatDateThreads(item.ts);
|
||||
let messageTime;
|
||||
let messageDate;
|
||||
|
||||
if (item?.ts) {
|
||||
messageTime = moment(item.ts).format('LT');
|
||||
messageDate = formatDateThreads(item.ts);
|
||||
}
|
||||
|
||||
return (
|
||||
<Touchable
|
||||
|
|
|
@ -221,7 +221,6 @@ class TeamChannelsView extends React.Component<ITeamChannelsViewProps, ITeamChan
|
|||
<SearchHeader
|
||||
onSearchChangeText={this.onSearchChangeText}
|
||||
placeholder='Search Channels'
|
||||
theme={theme}
|
||||
testID='team-channels-view-search-header'
|
||||
/>
|
||||
),
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { StyleSheet, Text, View } from 'react-native';
|
||||
import Touchable from 'react-native-platform-touchable';
|
||||
|
||||
import { useTheme, withTheme } from '../../theme';
|
||||
import { useTheme } from '../../theme';
|
||||
import Avatar from '../../containers/Avatar';
|
||||
import sharedStyles from '../Styles';
|
||||
import { themes } from '../../constants/colors';
|
||||
|
@ -69,7 +69,10 @@ interface IItem {
|
|||
const Item = ({ item, baseUrl, useRealName, user, badgeColor, onPress, toggleFollowThread }: IItem) => {
|
||||
const { theme } = useTheme();
|
||||
const username = (useRealName && item?.u?.name) || item?.u?.username;
|
||||
const time = formatDateThreads(item.ts!);
|
||||
let time;
|
||||
if (item?.ts) {
|
||||
time = formatDateThreads(item.ts);
|
||||
}
|
||||
|
||||
return (
|
||||
<Touchable
|
||||
|
@ -105,4 +108,4 @@ const Item = ({ item, baseUrl, useRealName, user, badgeColor, onPress, toggleFol
|
|||
);
|
||||
};
|
||||
|
||||
export default withTheme(Item);
|
||||
export default Item;
|
||||
|
|
|
@ -148,7 +148,6 @@ class ThreadMessagesView extends React.Component<IThreadMessagesViewProps, IThre
|
|||
<SearchHeader
|
||||
onSearchChangeText={this.onSearchChangeText}
|
||||
placeholder='Search'
|
||||
theme={theme}
|
||||
testID='thread-messages-view-search-header'
|
||||
/>
|
||||
),
|
||||
|
@ -558,8 +557,7 @@ const mapStateToProps = (state: any) => ({
|
|||
baseUrl: state.server.server,
|
||||
user: getUserSelector(state),
|
||||
useRealName: state.settings.UI_Use_Real_Name,
|
||||
isMasterDetail: state.app.isMasterDetail,
|
||||
Message_TimeFormat: state.settings.Message_TimeFormat
|
||||
isMasterDetail: state.app.isMasterDetail
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(withTheme(withSafeAreaInsets(ThreadMessagesView)));
|
||||
|
|
Loading…
Reference in New Issue