-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
539 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
apps/meteor/client/components/message/toolbar/MessageToolbarItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MessageToolbarItem as FuselageMessageToolbarItem } from '@rocket.chat/fuselage'; | ||
import type { Keys as IconName } from '@rocket.chat/icons'; | ||
import { useLayoutHiddenActions } from '@rocket.chat/ui-contexts'; | ||
import type { MouseEventHandler } from 'react'; | ||
import React from 'react'; | ||
|
||
type MessageToolbarItemProps = { | ||
id: string; | ||
icon: IconName; | ||
title: string; | ||
disabled?: boolean; | ||
qa: string; | ||
onClick: MouseEventHandler; | ||
}; | ||
|
||
const MessageToolbarItem = ({ id, icon, title, disabled, qa, onClick }: MessageToolbarItemProps) => { | ||
const hiddenActions = useLayoutHiddenActions().messageToolbox; | ||
|
||
if (hiddenActions.includes(id)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<FuselageMessageToolbarItem | ||
icon={icon} | ||
title={title} | ||
disabled={disabled} | ||
data-qa-id={qa} | ||
data-qa-type='message-action-menu' | ||
onClick={onClick} | ||
/> | ||
); | ||
}; | ||
|
||
export default MessageToolbarItem; |
26 changes: 26 additions & 0 deletions
26
apps/meteor/client/components/message/toolbar/items/DefaultItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import ForwardMessageAction from './actions/ForwardMessageAction'; | ||
import QuoteMessageAction from './actions/QuoteMessageAction'; | ||
import ReactionMessageAction from './actions/ReactionMessageAction'; | ||
import ReplyInThreadMessageAction from './actions/ReplyInThreadMessageAction'; | ||
|
||
type DefaultItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const DefaultItems = ({ message, room, subscription }: DefaultItemsProps) => { | ||
return ( | ||
<> | ||
<ReactionMessageAction message={message} room={room} subscription={subscription} /> | ||
<QuoteMessageAction message={message} subscription={subscription} /> | ||
<ReplyInThreadMessageAction message={message} room={room} subscription={subscription} /> | ||
<ForwardMessageAction message={message} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default DefaultItems; |
16 changes: 16 additions & 0 deletions
16
apps/meteor/client/components/message/toolbar/items/DirectItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import JumpToMessageAction from './actions/JumpToMessageAction'; | ||
|
||
type DirectItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const DirectItems = ({ message, subscription }: DirectItemsProps) => { | ||
return <>{!!subscription && <JumpToMessageAction id='jump-to-pin-message' message={message} />}</>; | ||
}; | ||
|
||
export default DirectItems; |
24 changes: 24 additions & 0 deletions
24
apps/meteor/client/components/message/toolbar/items/FederatedItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import QuoteMessageAction from './actions/QuoteMessageAction'; | ||
import ReactionMessageAction from './actions/ReactionMessageAction'; | ||
import ReplyInThreadMessageAction from './actions/ReplyInThreadMessageAction'; | ||
|
||
type FederatedItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const FederatedItems = ({ message, room, subscription }: FederatedItemsProps) => { | ||
return ( | ||
<> | ||
<ReactionMessageAction message={message} room={room} subscription={subscription} /> | ||
<QuoteMessageAction message={message} subscription={subscription} /> | ||
<ReplyInThreadMessageAction message={message} room={room} subscription={subscription} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default FederatedItems; |
20 changes: 20 additions & 0 deletions
20
apps/meteor/client/components/message/toolbar/items/MentionsItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import JumpToMessageAction from './actions/JumpToMessageAction'; | ||
|
||
type MentionsItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const MentionsItems = ({ message }: MentionsItemsProps) => { | ||
return ( | ||
<> | ||
<JumpToMessageAction id='jump-to-message' message={message} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default MentionsItems; |
28 changes: 28 additions & 0 deletions
28
apps/meteor/client/components/message/toolbar/items/MobileItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import ForwardMessageAction from './actions/ForwardMessageAction'; | ||
import JumpToMessageAction from './actions/JumpToMessageAction'; | ||
import QuoteMessageAction from './actions/QuoteMessageAction'; | ||
import ReactionMessageAction from './actions/ReactionMessageAction'; | ||
import ReplyInThreadMessageAction from './actions/ReplyInThreadMessageAction'; | ||
|
||
type MobileItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const MobileItems = ({ message, room, subscription }: MobileItemsProps) => { | ||
return ( | ||
<> | ||
<ReactionMessageAction message={message} room={room} subscription={subscription} /> | ||
<QuoteMessageAction message={message} subscription={subscription} /> | ||
<ReplyInThreadMessageAction message={message} room={room} subscription={subscription} /> | ||
<ForwardMessageAction message={message} /> | ||
<JumpToMessageAction id='jump-to-message' message={message} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default MobileItems; |
20 changes: 20 additions & 0 deletions
20
apps/meteor/client/components/message/toolbar/items/PinnedItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import JumpToMessageAction from './actions/JumpToMessageAction'; | ||
|
||
type PinnedItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const PinnedItems = ({ message }: PinnedItemsProps) => { | ||
return ( | ||
<> | ||
<JumpToMessageAction id='jump-to-pin-message' message={message} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default PinnedItems; |
20 changes: 20 additions & 0 deletions
20
apps/meteor/client/components/message/toolbar/items/SearchItems.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { IRoom, ISubscription, IMessage } from '@rocket.chat/core-typings'; | ||
import React from 'react'; | ||
|
||
import JumpToMessageAction from './actions/JumpToMessageAction'; | ||
|
||
type SearchItemsProps = { | ||
message: IMessage; | ||
room: IRoom; | ||
subscription: ISubscription | undefined; | ||
}; | ||
|
||
const SearchItems = ({ message }: SearchItemsProps) => { | ||
return ( | ||
<> | ||
<JumpToMessageAction id='jump-to-message' message={message} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default SearchItems; |
Oops, something went wrong.