diff --git a/native/chat/sidebar-item.react.js b/native/chat/sidebar-item.react.js
index a7d113f0d..c34878eb4 100644
--- a/native/chat/sidebar-item.react.js
+++ b/native/chat/sidebar-item.react.js
@@ -1,58 +1,58 @@
// @flow
import * as React from 'react';
import { Text, View } from 'react-native';
import type { SidebarInfo } from 'lib/types/thread-types';
import { shortAbsoluteDate } from 'lib/utils/date-utils';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
import { SingleLine } from '../components/single-line.react';
import { useStyles } from '../themes/colors';
type Props = {
+sidebarInfo: SidebarInfo,
};
function SidebarItem(props: Props): React.Node {
const { lastUpdatedTime } = props.sidebarInfo;
const lastActivity = shortAbsoluteDate(lastUpdatedTime);
const { threadInfo } = props.sidebarInfo;
+ const { uiName } = useResolvedThreadInfo(threadInfo);
const styles = useStyles(unboundStyles);
const unreadStyle = threadInfo.currentUser.unread ? styles.unread : null;
return (
-
- {threadInfo.uiName}
-
+ {uiName}
{lastActivity}
);
}
const sidebarHeight = 30;
const unboundStyles = {
itemContainer: {
flexDirection: 'row',
height: sidebarHeight,
alignItems: 'center',
},
unread: {
color: 'listForegroundLabel',
fontWeight: 'bold',
},
name: {
color: 'listForegroundSecondaryLabel',
flex: 1,
fontSize: 16,
paddingLeft: 3,
paddingBottom: 2,
},
lastActivity: {
color: 'listForegroundTertiaryLabel',
fontSize: 14,
marginLeft: 10,
},
};
export { SidebarItem, sidebarHeight };
diff --git a/native/chat/subchannel-item.react.js b/native/chat/subchannel-item.react.js
index e75be2a8d..1770073e5 100644
--- a/native/chat/subchannel-item.react.js
+++ b/native/chat/subchannel-item.react.js
@@ -1,112 +1,112 @@
// @flow
import * as React from 'react';
import { Text, View } from 'react-native';
import type { ChatThreadItem } from 'lib/selectors/chat-selectors';
import { shortAbsoluteDate } from 'lib/utils/date-utils';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
import { SingleLine } from '../components/single-line.react';
import SWMansionIcon from '../components/swmansion-icon.react';
import { useStyles } from '../themes/colors';
import MessagePreview from './message-preview.react';
type Props = {
+subchannelInfo: ChatThreadItem,
};
function SubchannelItem(props: Props): React.Node {
const {
lastUpdatedTime,
threadInfo,
mostRecentMessageInfo,
} = props.subchannelInfo;
+ const { uiName } = useResolvedThreadInfo(threadInfo);
const lastActivity = shortAbsoluteDate(lastUpdatedTime);
const styles = useStyles(unboundStyles);
const unreadStyle = threadInfo.currentUser.unread ? styles.unread : null;
const lastMessage = React.useMemo(() => {
if (!mostRecentMessageInfo) {
return (
No messages
);
}
return (
);
}, [mostRecentMessageInfo, threadInfo, styles]);
return (
-
- {threadInfo.uiName}
-
+ {uiName}
{lastMessage}
{lastActivity}
);
}
const fontSize = 14;
const unboundStyles = {
outerView: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
paddingVertical: 8,
paddingHorizontal: 8,
height: 60,
},
itemRowContainer: {
flexDirection: 'row',
alignItems: 'center',
},
unread: {
color: 'listForegroundLabel',
fontWeight: 'bold',
},
name: {
color: 'listForegroundSecondaryLabel',
flex: 1,
fontSize: 16,
paddingBottom: 8,
},
lastActivity: {
color: 'listForegroundTertiaryLabel',
fontSize,
marginLeft: 10,
},
iconWrapper: {
marginRight: 8,
alignItems: 'center',
},
icon: {
fontSize: 22,
color: 'listForegroundSecondaryLabel',
alignItems: 'center',
height: 24,
},
noMessages: {
color: 'listForegroundTertiaryLabel',
flex: 1,
fontSize,
fontStyle: 'italic',
},
};
export default SubchannelItem;