Minor tweaks

This commit is contained in:
Gerzon Z 2022-01-24 15:12:09 -04:00
parent bce775d88d
commit 5d84468561
3 changed files with 18 additions and 16 deletions

View File

@ -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;

View File

@ -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}

View File

@ -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}>
<Markdown
// @ts-ignore
msg={makeThreadName(item)}
baseUrl={baseUrl}
username={username!}
theme={theme!}
numberOfLines={2}
style={[styles.markdown]}
preview
/>
{makeThreadName(item) && username ? (
/* @ts-ignore */
<Markdown
msg={makeThreadName(item)}
baseUrl={baseUrl}
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} />