Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions __tests__/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4723,7 +4723,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@rocket.cat
rocket.cat
</Text>
<Text
numberOfLines={0}
Expand Down Expand Up @@ -4766,7 +4766,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@diego.mello
diego.mello
</Text>
<Text
numberOfLines={0}
Expand Down Expand Up @@ -4809,7 +4809,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@all
all
</Text>
<Text
numberOfLines={0}
Expand Down Expand Up @@ -4852,7 +4852,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@here
here
</Text>
<Text
numberOfLines={0}
Expand Down Expand Up @@ -4895,7 +4895,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
#general
general
</Text>
</Text>
</View>
Expand Down
30 changes: 18 additions & 12 deletions app/containers/markdown/AtMention.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,27 @@ const AtMention = React.memo(({
}

const handlePress = () => {
if (mentions && mentions.length && mentions.findIndex(m => m.username === mention) !== -1) {
const index = mentions.findIndex(m => m.username === mention);
const navParam = {
t: 'd',
rid: mentions[index]._id
};
navToRoomInfo(navParam);
}
const index = mentions.findIndex(m => m.username === mention);
const navParam = {
t: 'd',
rid: mentions[index]._id
};
navToRoomInfo(navParam);
};

if (mentions && mentions.length && mentions.findIndex(m => m.username === mention) !== -1) {
return (
<Text
style={[preview ? { ...styles.text, color: themes[theme].bodyText } : mentionStyle, ...style]}
onPress={preview ? undefined : handlePress}
>
{mention}
</Text>
);
}

return (
<Text
style={[preview ? { ...styles.text, color: themes[theme].bodyText } : mentionStyle, ...style]}
onPress={preview ? undefined : handlePress}
>
<Text style={[styles.text, { color: themes[theme].bodyText }, ...style]}>
{`@${ mention }`}
</Text>
);
Expand Down
4 changes: 2 additions & 2 deletions app/containers/markdown/Hashtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const Hashtag = React.memo(({
style={[preview ? { ...styles.text, color: themes[theme].bodyText } : styles.mention, ...style]}
onPress={preview ? undefined : handlePress}
>
{`#${ hashtag }`}
{hashtag}
</Text>
);
}
return (
<Text style={[preview ? { ...styles.text, color: themes[theme].bodyText } : styles.mention, ...style]}>
<Text style={[styles.text, { color: themes[theme].bodyText }, ...style]}>
{`#${ hashtag }`}
</Text>
);
Expand Down