Minor tweaks
This commit is contained in:
parent
bce775d88d
commit
5d84468561
|
@ -25,7 +25,7 @@ import { isValidURL } from '../../utils/url';
|
|||
import NewMarkdown from './new';
|
||||
|
||||
interface IMarkdownProps {
|
||||
msg: string;
|
||||
msg?: string;
|
||||
md: MarkdownAST;
|
||||
mentions: UserMention[];
|
||||
getCustomEmoji: Function;
|
||||
|
|
|
@ -71,21 +71,21 @@ const Item = ({ item, baseUrl, onPress }: IItem): JSX.Element => {
|
|||
<Touchable
|
||||
onPress={() => onPress(item)}
|
||||
testID={`discussions-view-${item.msg}`}
|
||||
style={{ backgroundColor: themes[theme!].backgroundColor }}>
|
||||
style={{ backgroundColor: themes[theme].backgroundColor }}>
|
||||
<View style={styles.container}>
|
||||
<Avatar style={styles.avatar} text={item?.u?.username} size={36} borderRadius={4} theme={theme} />
|
||||
<View style={styles.contentContainer}>
|
||||
<View style={styles.titleContainer}>
|
||||
<Text style={[styles.title, { color: themes[theme!].titleText }]} numberOfLines={1}>
|
||||
<Text style={[styles.title, { color: themes[theme].titleText }]} numberOfLines={1}>
|
||||
{username}
|
||||
</Text>
|
||||
<Text style={[styles.time, { color: themes[theme!].auxiliaryText }]}>{messageTime!}</Text>
|
||||
{messageTime ? <Text style={[styles.time, { color: themes[theme].auxiliaryText }]}>{messageTime}</Text> : null}
|
||||
</View>
|
||||
<View style={styles.messageContainer}>
|
||||
{makeThreadName(item) && item && username ? (
|
||||
{username ? (
|
||||
/* @ts-ignore */
|
||||
<Markdown
|
||||
msg={makeThreadName(item)!}
|
||||
msg={makeThreadName(item)}
|
||||
baseUrl={baseUrl}
|
||||
username={username}
|
||||
theme={theme}
|
||||
|
|
|
@ -89,16 +89,18 @@ const Item = ({ item, baseUrl, useRealName, user, badgeColor, onPress, toggleFol
|
|||
<Text style={[styles.time, { color: themes[theme!].auxiliaryText }]}>{time}</Text>
|
||||
</View>
|
||||
<View style={styles.messageContainer}>
|
||||
{makeThreadName(item) && username ? (
|
||||
/* @ts-ignore */
|
||||
<Markdown
|
||||
// @ts-ignore
|
||||
msg={makeThreadName(item)}
|
||||
baseUrl={baseUrl}
|
||||
username={username!}
|
||||
theme={theme!}
|
||||
username={username}
|
||||
theme={theme}
|
||||
numberOfLines={2}
|
||||
style={[styles.markdown]}
|
||||
preview
|
||||
/>
|
||||
) : null}
|
||||
{badgeColor ? <View style={[styles.badge, { backgroundColor: badgeColor }]} /> : null}
|
||||
</View>
|
||||
<ThreadDetails item={item} user={user} toggleFollowThread={toggleFollowThread} style={styles.threadDetails} />
|
||||
|
|
Loading…
Reference in New Issue