Skip to content

Commit

Permalink
[PAY-1426] DMs: Simplify unfurl styles for mobile, fix border radius …
Browse files Browse the repository at this point in the history
…shadow (#3555)
  • Loading branch information
rickyrombo authored Jun 9, 2023
1 parent 63faad0 commit 49ff351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
19 changes: 7 additions & 12 deletions packages/mobile/src/screens/chat-screen/ChatMessageListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const useStyles = makeStyles(({ spacing, palette, typography }) => ({
bubble: {
marginTop: spacing(2),
backgroundColor: palette.white,
borderRadius: spacing(3)
borderRadius: spacing(3),
overflow: 'hidden'
},
isAuthor: {
backgroundColor: palette.secondaryLight2
Expand Down Expand Up @@ -133,7 +134,8 @@ const useStyles = makeStyles(({ spacing, palette, typography }) => ({
},
unfurl: {
width: Dimensions.get('window').width - 48,
minHeight: 72
minHeight: 72,
borderRadius: 0 // Undoes border radius from track/collection tiles
}
}))

Expand Down Expand Up @@ -236,18 +238,12 @@ export const ChatMessageListItem = memo(function ChatMessageListItem(
const { secondaryDark1, neutralLight7 } = useThemeColors()

const borderBottomColor = isAuthor ? secondaryDark1 : neutralLight7
const borderBottomWidth = hideMessage
? 0
: isCollection || isTrack
? undefined
: 1
const borderBottomRadius = hideMessage ? undefined : 0
const borderBottomWidth =
hideMessage || isCollection || isTrack ? undefined : 1
const unfurlStyles = {
...styles.unfurl,
borderBottomColor,
borderBottomWidth,
borderBottomLeftRadius: borderBottomRadius,
borderBottomRightRadius: borderBottomRadius
borderBottomWidth
}

return (
Expand Down Expand Up @@ -309,7 +305,6 @@ export const ChatMessageListItem = memo(function ChatMessageListItem(
chatId={chatId}
messageId={message.message_id}
href={link.href}
hideMessage={hideMessage}
onLongPress={handleLongPress}
onPressIn={handlePressIn}
onPressOut={handlePressOut}
Expand Down
19 changes: 2 additions & 17 deletions packages/mobile/src/screens/chat-screen/LinkPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ import { REACTION_LONGPRESS_DELAY } from './constants'

const useStyles = makeStyles(({ spacing, palette, typography }) => ({
root: {
backgroundColor: palette.white,
borderTopLeftRadius: spacing(3),
borderTopRightRadius: spacing(3),
overflow: 'hidden'
},
rootIsLinkPreviewOnly: {
borderRadius: spacing(3)
backgroundColor: palette.white
},
pressed: {
backgroundColor: palette.neutralLight10
Expand Down Expand Up @@ -73,7 +67,6 @@ type LinkPreviewProps = {
chatId: string
messageId: string
href: string
hideMessage: boolean
isPressed: boolean
onLongPress: (event: GestureResponderEvent) => void
onPressIn: (event: GestureResponderEvent) => void
Expand All @@ -87,7 +80,6 @@ export const LinkPreview = ({
chatId,
messageId,
href,
hideMessage,
isPressed = false,
onLongPress,
onPressIn,
Expand Down Expand Up @@ -118,14 +110,7 @@ export const LinkPreview = ({
onPressIn={onPressIn}
onPressOut={onPressOut}
>
<View
style={[
styles.root,
isPressed ? styles.pressed : null,
hideMessage ? styles.rootIsLinkPreviewOnly : null,
style
]}
>
<View style={[styles.root, isPressed ? styles.pressed : null, style]}>
{description || title ? (
<>
{image ? (
Expand Down

0 comments on commit 49ff351

Please sign in to comment.