Skip to content

Commit

Permalink
UI fixes for comments and DMs
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlt committed Jun 12, 2024
1 parent d246238 commit f4a3d65
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
54 changes: 39 additions & 15 deletions src/components/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function Comment({ comment, nav, isolated = false }) {
marginLeft: isolated
? 0
: comment.reply_post_id != comment.parent_post_id
? 20
: 0,
? 20
: 0,
}}
onLayout={event => {
setWidth(event.nativeEvent.layout.width);
Expand All @@ -78,22 +78,46 @@ function Comment({ comment, nav, isolated = false }) {
hideGroup={true}
borderRadius={BORDER_RADIUS}
/>
{comment.reply_comment_alias && (
<View
style={{
justifyContent: 'center',
flexDirection: 'column',
flex: 1,
}}>
{comment.identity.name != 'Anonymous' &&
comment?.identity?.posted_with_username && (
<Text
variant="labelMedium"
style={{ marginLeft: 10, opacity: 0.75 }}>
@{comment.identity.name}
</Text>
)}
{comment.reply_comment_alias && (
<Text
variant="titleMedium"
style={{
marginLeft: 10,
paddingRight: 10,
color: colors.onSurfaceDisabled,
borderRightColor: colors.surfaceVariant,
borderRightWidth: 1,
}}>
{comment.reply_comment_alias}
</Text>
)}
{!comment?.identity?.posted_with_username && (
<Text variant="labelLarge" style={{ marginLeft: 10 }}>
{timesago(comment.created_at)}
</Text>
)}
</View>
{comment?.identity?.posted_with_username && (
<Text
variant="titleMedium"
style={{
marginLeft: 10,
paddingRight: 10,
color: colors.onSurfaceDisabled,
borderRightColor: colors.surfaceVariant,
borderRightWidth: 1,
}}>
{comment.reply_comment_alias}
variant="labelLarge"
style={{ marginLeft: 10, flex: 1, textAlign: 'right' }}>
{timesago(comment.created_at)}
</Text>
)}
<Text variant="labelLarge" style={{ marginLeft: 10, flex: 1 }}>
{timesago(comment.created_at)}
</Text>
{comment.authored_by_user && (
<IconButton
icon="delete"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Post({
</Text>
{post.identity.name != 'Anonymous' && (
<Text
variant="labelSmall"
variant="labelMedium"
style={{ marginLeft: 10, opacity: 0.75 }}>
@{post.identity.name}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/MessagesScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function MessageScreen({ navigation }) {
color={colors.primary}
/>
<View>
<Text style={{ color: 'white' }} variant="bodyLarge">
<Text style={{ color: colors.onSurface }} variant="bodyLarge">
{item.messages[item.messages.length - 1].text}
</Text>
<Text
Expand Down
2 changes: 1 addition & 1 deletion src/screens/ThreadScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function ThreadScreen({ navigation, route }) {
: colors.elevation.level1,
}}
mode="flat">
<Text style={{ color: 'white' }} variant="bodyLarge">
<Text style={{ color: colors.onSurface }} variant="bodyLarge">
{item.text}
</Text>
<Text
Expand Down

0 comments on commit f4a3d65

Please sign in to comment.