Skip to content

Commit

Permalink
Disable super like on double tap when contest ended
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Jul 15, 2024
1 parent d458547 commit 74f890d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/chats/ChatItem/ChatItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default function ChatItem({
config={config}
superLikeProps={props}
messageBubbleId={messageBubbleId}
disableSuperLike={disableSuperLike}
>
{extensions && extensions.length > 0 ? (
<ChatItemWithExtension
Expand All @@ -109,6 +110,7 @@ export default function ChatItem({
isMyMessage={isMyMessage}
chatId={chatId}
hubId={hubId}
disableSuperLike={disableSuperLike}
enableProfileModal={enableProfileModal}
bg={bg}
showApproveButton={showApproveButton}
Expand All @@ -118,6 +120,7 @@ export default function ChatItem({
message={message}
isMyMessage={isMyMessage}
scrollToMessage={scrollToMessage}
disableSuperLike={disableSuperLike}
chatId={chatId}
enableProfileModal={enableProfileModal}
hubId={hubId}
Expand Down Expand Up @@ -156,6 +159,7 @@ type ChatItemMenuWrapperProps = {
postRewards?: PostRewards | undefined | null
}
children: React.ReactNode
disableSuperLike?: boolean
messageBubbleId?: string
}

Expand Down Expand Up @@ -187,6 +191,7 @@ const ChatItemMenuWrapper = ({
superLikeProps,
children,
messageBubbleId,
disableSuperLike,
}: ChatItemMenuWrapperProps) => {
const containerRef = useRef<HTMLDivElement>(null)
const { toggleDisplay, referenceProps } = config || {}
Expand Down Expand Up @@ -240,7 +245,7 @@ const ChatItemMenuWrapper = ({
e.preventDefault()
e.stopPropagation()

if (!isDisabled && !hasILiked) {
if (!isDisabled && !disableSuperLike && !hasILiked) {
haptic?.result?.impactOccurred('medium')
handleClick()
animateHeart(e.clientX, e.clientY)
Expand Down
1 change: 1 addition & 0 deletions src/components/chats/ChatList/ChatItemWithMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function InnerChatItemWithMenu({
message={message}
showBlockedMessage={showBlockedMessage}
messageBubbleId={getMessageElementId(message.id)}
disableSuperLike={disableSuperLike}
enableProfileModal={enableProfileModal}
scrollToMessage={scrollToMessage}
showApproveButton={showApproveButton}
Expand Down

0 comments on commit 74f890d

Please sign in to comment.