Skip to content

Commit

Permalink
Hide unimplemented context menus (status-im#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
felicio authored Jul 19, 2022
1 parent 82625fe commit d726b82
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

import { ChatMenu } from '../../../../components/chat-menu'
import { ContextMenuTrigger } from '../../../../system'
// import { ChatMenu } from '../../../../components/chat-menu'
// import { ContextMenuTrigger } from '../../../../system'
import { SidebarItem } from '../sidebar-item'

import type { SidebarItemProps } from '../sidebar-item'
Expand All @@ -14,9 +14,9 @@ export const ChannelItem = (props: Props) => {
const { children, ...sidebarItemProps } = props

return (
<ContextMenuTrigger>
<SidebarItem {...sidebarItemProps}>#{children}</SidebarItem>
<ChatMenu type="context" />
</ContextMenuTrigger>
// <ContextMenuTrigger>
<SidebarItem {...sidebarItemProps}>#{children}</SidebarItem>
// <ChatMenu type="context" />
// </ContextMenuTrigger>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
Avatar,
Box,
Button,
ContextMenu,
ContextMenuTrigger,
// ContextMenu,
// ContextMenuTrigger,
// DropdownMenu,
// DropdownMenuTrigger,
// EmojiHash,
Expand Down Expand Up @@ -171,20 +171,20 @@ export const ChatMessage = (props: Props) => {

return (
<>
<ContextMenuTrigger>
<Wrapper mention={mention} pinned={pinned} data-active={reacting}>
{responseTo && <MessageReply messageId={responseTo} />}
<Flex gap={2}>
<Box>
{/* <DropdownMenuTrigger>
{/* <ContextMenuTrigger> */}
<Wrapper mention={mention} pinned={pinned} data-active={reacting}>
{responseTo && <MessageReply messageId={responseTo} />}
<Flex gap={2}>
<Box>
{/* <DropdownMenuTrigger>
<button type="button"> */}
<Avatar
size={44}
name={member!.username}
colorHash={member!.colorHash}
/>
{/* </button> */}
{/* <DropdownMenu>
<Avatar
size={44}
name={member!.username}
colorHash={member!.colorHash}
/>
{/* </button> */}
{/* <DropdownMenu>
<Flex direction="column" align="center" gap="1">
<Avatar size="36" />
<Text>{member!.username}</Text>
Expand Down Expand Up @@ -212,55 +212,52 @@ export const ChatMessage = (props: Props) => {
</DropdownMenu.Item>
</DropdownMenu>
</DropdownMenuTrigger> */}
</Box>
</Box>

<Box css={{ flex: 1 }}>
{/* {pinned && (
<Box css={{ flex: 1 }}>
{/* {pinned && (
<Flex gap={1}>
<PinIcon width={8} />
<Text size="13">Pinned by {contact.name}</Text>
</Flex>
)} */}

<Flex gap="1" align="center">
<Text color="primary" weight="500" size="15">
{member!.username}
</Text>
<Text size="10" color="gray">
{new Date(Number(clock)).toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
})}
</Text>
</Flex>

{renderMessage()}

<MessageReactions
reactions={reactions}
onClick={handleReaction}
/>
</Box>
</Flex>

<Actions
owner={owner}
pinned={pinned}
onEditClick={() => setEditing(true)}
onReplyClick={handleReplyClick}
onPinClick={handlePinClick}
onDeleteClick={handleMessageDelete}
onReactionClick={handleReaction}
reacting={reacting}
onReactingChange={setReacting}
reactions={reactions}
/>
</Wrapper>
<ContextMenu>
<Flex gap="1" align="center">
<Text color="primary" weight="500" size="15">
{member!.username}
</Text>
<Text size="10" color="gray">
{new Date(Number(clock)).toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
})}
</Text>
</Flex>

{renderMessage()}

<MessageReactions reactions={reactions} onClick={handleReaction} />
</Box>
</Flex>

<Actions
owner={owner}
pinned={pinned}
onEditClick={() => setEditing(true)}
onReplyClick={handleReplyClick}
onPinClick={handlePinClick}
onDeleteClick={handleMessageDelete}
onReactionClick={handleReaction}
reacting={reacting}
onReactingChange={setReacting}
reactions={reactions}
/>
</Wrapper>
{/* <ContextMenu>
<ContextMenu.Item onSelect={handleReplyClick}>Reply</ContextMenu.Item>
{/* <ContextMenu.Item onSelect={handlePinClick}>Pin</ContextMenu.Item> */}
</ContextMenu>
</ContextMenuTrigger>
<ContextMenu.Item onSelect={handlePinClick}>Pin</ContextMenu.Item>
</ContextMenu> */}
{/* </ContextMenuTrigger> */}
</>
)
}
Expand Down

0 comments on commit d726b82

Please sign in to comment.