From 8c768c19ce3e3b7bb61344cc8c77a54e10641c6d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 5 Jul 2018 12:37:53 +0300 Subject: transform-object-rest-spread --- vnext/src/components/Message.js | 62 ++++++++++++++++++++--------------------- vnext/src/components/Thread.js | 9 +++--- 2 files changed, 34 insertions(+), 37 deletions(-) (limited to 'vnext/src') diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index 585ae1ac..273e035c 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -9,52 +9,50 @@ import Avatar from './Avatar'; import { format } from '../utils/embed'; -export default function Message(props) { - const msg = props.data; - const visitor = props.visitor; +export default function Message({ data, visitor, children, ...rest }) { return (
- +
- -
- +
-

= 0) }}>

+

= 0) }}>

- {msg.photo && -

- + {data.photo && +

+

} - {props.children} + { children }
); } -function Tags(props) { - return props.data && props.data.map(tag => { - return ({tag}) +function Tags({ data, user, ...rest}) { + return data && data.map(tag => { + return ({tag}) }) } diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 0ec39d11..3de16a64 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -159,12 +159,11 @@ const linkStyle = { cursor: 'pointer' } -function Recommendations(props) { - const recomms = props.src; - return recomms && ( -
{`Recommended by (${recomms.length}): `} +function Recommendations({src, ...rest}) { + return src && ( +
{`Recommended by (${src.length}): `} { - recomms.map(it => ( + src.map(it => ( {it} )).reduce((prev, curr) => [prev, ', ', curr]) } -- cgit v1.2.3