Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.
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
1 change: 1 addition & 0 deletions packages/mobile/src/screens/chat-screen/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ export const ChatScreen = () => {
<ReactionPopup
chatId={chatId}
messageTop={messageTop.current}
containerTop={chatContainerTop.current}
containerBottom={chatContainerBottom.current}
isAuthor={decodeHashId(popupMessage?.sender_user_id) === userId}
message={popupMessage}
Expand Down
19 changes: 15 additions & 4 deletions packages/mobile/src/screens/chat-screen/ReactionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { spacing } from 'app/styles/spacing'
import { ReactionList } from '../notifications-screen/Reaction'

import { ChatMessageListItem } from './ChatMessageListItem'
import { REACTION_CONTAINER_HEIGHT } from './constants'
import {
REACTION_CONTAINER_HEIGHT,
REACTION_CONTAINER_TOP_OFFSET
} from './constants'

const { getUserId } = accountSelectors
const { setMessageReaction } = chatActions
Expand Down Expand Up @@ -69,6 +72,7 @@ const useStyles = makeStyles(({ spacing, palette, typography }) => ({
type ReactionPopupProps = {
chatId: string
messageTop: number
containerTop: number
containerBottom: number
isAuthor: boolean
message: ChatMessageWithExtras
Expand All @@ -79,6 +83,7 @@ type ReactionPopupProps = {
export const ReactionPopup = ({
chatId,
messageTop,
containerTop,
containerBottom,
isAuthor,
message,
Expand Down Expand Up @@ -136,7 +141,8 @@ export const ReactionPopup = ({
style={[
styles.popupContainer,
{
height: containerBottom
height: containerBottom - containerTop,
top: containerTop
}
]}
>
Expand All @@ -152,7 +158,7 @@ export const ReactionPopup = ({
style={[
styles.popupChatMessage,
{
top: messageTop,
top: messageTop - containerTop,
alignSelf: isAuthor ? 'flex-end' : 'flex-start',
right: isAuthor ? spacing(6) : undefined,
left: !isAuthor ? spacing(6) : undefined
Expand All @@ -164,7 +170,12 @@ export const ReactionPopup = ({
style={[
styles.reactionsContainer,
{
top: messageTop - REACTION_CONTAINER_HEIGHT,
top: Math.max(
messageTop - containerTop - REACTION_CONTAINER_HEIGHT,
containerTop -
REACTION_CONTAINER_HEIGHT -
REACTION_CONTAINER_TOP_OFFSET
),
opacity: otherOpacityAnim.current,
transform: [
{
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/src/screens/chat-screen/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const REACTION_LONGPRESS_DELAY = 100
export const REACTION_CONTAINER_HEIGHT = 70
export const REACTION_CONTAINER_TOP_OFFSET = 20
export const BACKGROUND_OPACITY = 0.3
export const MOUNT_ANIMATION_DURATION_MS = 100
export const UNMOUNT_ANIMATION_DURATION_MS = 100