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