Undo changes, add timeFormat prop
This commit is contained in:
parent
89a2381a1e
commit
a226cad57c
|
@ -36,16 +36,20 @@ const Attachments = React.memo(
|
||||||
|
|
||||||
return attachments.map((file: any, index: number) => {
|
return attachments.map((file: any, index: number) => {
|
||||||
if (file.image_url) {
|
if (file.image_url) {
|
||||||
return <Image key={index} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
|
return (
|
||||||
|
<Image key={file.image_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (file.audio_url) {
|
if (file.audio_url) {
|
||||||
return <Audio key={index} file={file} getCustomEmoji={getCustomEmoji} theme={theme} />;
|
return <Audio key={file.audio_url} file={file} getCustomEmoji={getCustomEmoji} theme={theme} />;
|
||||||
}
|
}
|
||||||
if (file.video_url) {
|
if (file.video_url) {
|
||||||
return <Video key={index} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
|
return (
|
||||||
|
<Video key={file.video_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (file.actions && file.actions.length > 0) {
|
if (file.actions && file.actions.length > 0) {
|
||||||
return <AttachedActions key={index} attachment={file} theme={theme} />;
|
return <AttachedActions key={file} attachment={file} theme={theme} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -47,7 +47,8 @@ class ThreadMessagesView extends React.Component {
|
||||||
useRealName: PropTypes.bool,
|
useRealName: PropTypes.bool,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
isMasterDetail: PropTypes.bool,
|
isMasterDetail: PropTypes.bool,
|
||||||
insets: PropTypes.object
|
insets: PropTypes.object,
|
||||||
|
Message_TimeFormat: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -412,7 +413,7 @@ class ThreadMessagesView extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
renderItem = ({ item }) => {
|
renderItem = ({ item }) => {
|
||||||
const { user, navigation, baseUrl, useRealName } = this.props;
|
const { user, navigation, baseUrl, useRealName, Message_TimeFormat } = this.props;
|
||||||
const badgeColor = this.getBadgeColor(item);
|
const badgeColor = this.getBadgeColor(item);
|
||||||
return (
|
return (
|
||||||
<Item
|
<Item
|
||||||
|
@ -425,6 +426,7 @@ class ThreadMessagesView extends React.Component {
|
||||||
badgeColor
|
badgeColor
|
||||||
}}
|
}}
|
||||||
thread
|
thread
|
||||||
|
timeFormat={Message_TimeFormat}
|
||||||
onPress={this.onThreadPress}
|
onPress={this.onThreadPress}
|
||||||
toggleFollowThread={this.toggleFollowThread}
|
toggleFollowThread={this.toggleFollowThread}
|
||||||
/>
|
/>
|
||||||
|
@ -506,7 +508,8 @@ const mapStateToProps = state => ({
|
||||||
baseUrl: state.server.server,
|
baseUrl: state.server.server,
|
||||||
user: getUserSelector(state),
|
user: getUserSelector(state),
|
||||||
useRealName: state.settings.UI_Use_Real_Name,
|
useRealName: state.settings.UI_Use_Real_Name,
|
||||||
isMasterDetail: state.app.isMasterDetail
|
isMasterDetail: state.app.isMasterDetail,
|
||||||
|
Message_TimeFormat: state.settings.Message_TimeFormat
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps)(withTheme(withSafeAreaInsets(ThreadMessagesView)));
|
export default connect(mapStateToProps)(withTheme(withSafeAreaInsets(ThreadMessagesView)));
|
||||||
|
|
Loading…
Reference in New Issue