You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Remove redundant, unused decorators from RTE
These have since been replaced by decorators that operator whether in MD mode or otherwise. This might not be optimal because LINK entities do not appear in MD mode at all at the moment, but instead you see the ()[] md notation version.
This commit is contained in:
@@ -113,31 +113,6 @@ let emojiDecorator = {
|
|||||||
* Returns a composite decorator which has access to provided scope.
|
* Returns a composite decorator which has access to provided scope.
|
||||||
*/
|
*/
|
||||||
export function getScopedRTDecorators(scope: any): CompositeDecorator {
|
export function getScopedRTDecorators(scope: any): CompositeDecorator {
|
||||||
let MemberAvatar = sdk.getComponent('avatars.MemberAvatar');
|
|
||||||
|
|
||||||
let usernameDecorator = {
|
|
||||||
strategy: (contentBlock, callback) => {
|
|
||||||
findWithRegex(USERNAME_REGEX, contentBlock, callback);
|
|
||||||
},
|
|
||||||
component: (props) => {
|
|
||||||
let member = scope.room.getMember(props.children[0].props.text);
|
|
||||||
// unused until we make these decorators immutable (autocomplete needed)
|
|
||||||
let name = member ? member.name : null;
|
|
||||||
let avatar = member ? <MemberAvatar member={member} width={16} height={16}/> : null;
|
|
||||||
return <span className="mx_UserPill">{avatar}{props.children}</span>;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let roomDecorator = {
|
|
||||||
strategy: (contentBlock, callback) => {
|
|
||||||
findWithRegex(ROOM_REGEX, contentBlock, callback);
|
|
||||||
},
|
|
||||||
component: (props) => {
|
|
||||||
return <span className="mx_RoomPill">{props.children}</span>;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO Re-enable usernameDecorator and roomDecorator
|
|
||||||
return [emojiDecorator];
|
return [emojiDecorator];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user