diff options
author | 2018-11-05 13:09:30 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | f6c6cd007535137e1b692eecb23735431882ef5b (patch) | |
tree | 0d5d06ec2d32d1e418bc9cc2b37a54dd02fee27a /vnext/src/components/Message.js | |
parent | 94741fb25dd6c60571e78393c43355d8ddf8b64d (diff) |
Memoizing Contact, Icon and Message
Diffstat (limited to 'vnext/src/components/Message.js')
-rw-r--r-- | vnext/src/components/Message.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index 1ecbf996..f303d5eb 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -9,7 +9,7 @@ import Avatar from './Avatar'; import { format } from '../utils/embed'; -export default function Message({ data, visitor, children, ...rest }) { +const Message = React.memo(({ data, visitor, children, ...rest }) => { return ( <div className="msg-cont"> <header className="h"> @@ -80,16 +80,15 @@ export default function Message({ data, visitor, children, ...rest }) { </a> </> )} - {data.FriendsOnly && ( - <a href="#" className="a-privacy">Открыть доступ</a> - )} </nav> {children} </div> ); -} +}); + +export default Message; -function Tags({ data, user, ...rest }) { +const Tags = React.memo(({ data, user, ...rest }) => { return data.length > 0 && ( <div className="msg-tags"> { @@ -99,7 +98,7 @@ function Tags({ data, user, ...rest }) { } </div> ); -} +}); Message.propTypes = { data: MessageType, |