diff options
author | Vitaly Takmazov | 2018-08-28 16:06:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | 1068ba623d2f8b6f7e89f5a4db2c9a54f20a26f0 (patch) | |
tree | 4b2402c1d718584449535acade8235a262c9a934 /vnext/src | |
parent | 7e08830d9ed55e77d7242106dcd1c3dd5bc4488b (diff) |
React.Fragment short syntax (requires babel 7)
Diffstat (limited to 'vnext/src')
-rw-r--r-- | vnext/src/App.js | 8 | ||||
-rw-r--r-- | vnext/src/components/Contact.js | 4 | ||||
-rw-r--r-- | vnext/src/components/Feeds.js | 4 | ||||
-rw-r--r-- | vnext/src/components/LoginButton.js | 4 | ||||
-rw-r--r-- | vnext/src/components/Message.js | 4 | ||||
-rw-r--r-- | vnext/src/components/Settings.js | 4 | ||||
-rw-r--r-- | vnext/src/components/Thread.js | 24 |
7 files changed, 26 insertions, 26 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js index 3ca7e0bf..955c1200 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -105,7 +105,7 @@ export default class App extends React.Component { const user = this.state.visitor; return ( <Router> - <React.Fragment> + <> <Header> <div id="header_wrapper"> {user.uid > 0 ? @@ -169,7 +169,7 @@ export default class App extends React.Component { <aside id="column"> { user.uid > 0 && - <React.Fragment> + <> <ul> <li> <Link to="/home"> @@ -223,11 +223,11 @@ export default class App extends React.Component { </div> } </div> - </React.Fragment> + </> } </aside> </div> - </React.Fragment> + </> </Router> ); } diff --git a/vnext/src/components/Contact.js b/vnext/src/components/Contact.js index 215f579b..1a45c053 100644 --- a/vnext/src/components/Contact.js +++ b/vnext/src/components/Contact.js @@ -8,10 +8,10 @@ export default class Contact extends React.Component { render() { const { user } = this.props; return ( - <React.Fragment> + <> <Avatar user={user} link={`/pm/${user.uname}`} /> {user.uname }{ user.unreadCount && <span className="badge">{user.unreadCount}</span>} - </React.Fragment> + </> ); } } diff --git a/vnext/src/components/Feeds.js b/vnext/src/components/Feeds.js index 89eb7774..194af71c 100644 --- a/vnext/src/components/Feeds.js +++ b/vnext/src/components/Feeds.js @@ -122,7 +122,7 @@ class Feed extends React.Component { render() { const { tag } = qs.parse(this.props.location.search || {}); const nodes = ( - <React.Fragment> + <> { tag && ( <p className="page"> @@ -143,7 +143,7 @@ class Feed extends React.Component { </p> ) } - </React.Fragment> + </> ); return this.state.msgs.length > 0 ? ( <div className="msgs">{nodes}</div> diff --git a/vnext/src/components/LoginButton.js b/vnext/src/components/LoginButton.js index e6c079f6..5bc58ef6 100644 --- a/vnext/src/components/LoginButton.js +++ b/vnext/src/components/LoginButton.js @@ -46,7 +46,7 @@ export default class LoginButton extends React.Component { render() { return ( - <React.Fragment> + <> <a onClick={this.toggleModal}><Icon name="ei-user" size="s" />{this.props.title}</a> <Modal show={this.state.isOpen} onClose={this.toggleModal}> @@ -76,7 +76,7 @@ export default class LoginButton extends React.Component { </form> </div> </Modal> - </React.Fragment> + </> ); } } diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index ad79f7f6..f091296b 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -64,7 +64,7 @@ export default function Message({ data, visitor, children, ...rest }) { </a> )} {!data.ReadOnly | (visitor.uid === data.user.uid) && ( - <React.Fragment> + <> <Link to={{ pathname: `/${data.user.uname}/${data.mid}`, state: { msg: data } }} className="a-comment msg-button"> <span className="msg-button-icon"> <Icon name="ei-comment" size="s" /> @@ -82,7 +82,7 @@ export default function Message({ data, visitor, children, ...rest }) { <Icon name="ei-link" size="s" /> <span> Share</span> </a> - </React.Fragment> + </> )} {data.FriendsOnly && ( <a href="#" className="a-privacy">Открыть доступ</a> diff --git a/vnext/src/components/Settings.js b/vnext/src/components/Settings.js index 2f03671f..44f02902 100644 --- a/vnext/src/components/Settings.js +++ b/vnext/src/components/Settings.js @@ -161,7 +161,7 @@ export default class Settings extends React.Component { </form> { me.emails && - <React.Fragment> + <> {/** email_off **/} <form> You can receive notifications to email:<br /> @@ -179,7 +179,7 @@ export default class Settings extends React.Component { {/** /email_off **/} <p> </p> <p>You can post to Juick via e-mail. Send your <u>plain text</u> messages to <span><a href="mailto:juick@juick.com">juick@juick.com</a></span>. You can attach one photo or video file.</p> - </React.Fragment> + </> } </fieldset> <fieldset> diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index b426581d..23654d86 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -79,7 +79,7 @@ export default class Thread extends React.Component { const msg = this.state.msg; const loaders = Math.min(msg.replies || 0, 10); return ( - <React.Fragment> + <> <ul id="0"> <li className="msg msgthread"> { @@ -101,14 +101,14 @@ export default class Thread extends React.Component { <div className="msg-cont"> <div className="msg-header"> {!msg.user.banned ? ( - <React.Fragment> + <> <span itemProp="author" itemScope="" itemType="http://schema.org/Person"> <Link to={`/${msg.user.uname}/`} itemProp="url" rel="author"><span itemProp="name">{msg.user.uname}</span></Link> </span><Avatar user={msg.user} /> - </React.Fragment>) : ( - <React.Fragment> + </>) : ( + <> <span>[удалено]:</span><Avatar user={{ uid: 0 }} /> - </React.Fragment> + </> ) } <div className="msg-ts"> @@ -134,27 +134,27 @@ export default class Thread extends React.Component { <div className="msg-links"> { this.props.visitor.uid > 0 ? ( - <React.Fragment> + <> {this.state.active === msg.rid || <span style={linkStyle} onClick={() => this.setActive(msg)}>Reply</span>} {this.state.active === msg.rid && <MessageInput data={msg} onSend={this.postComment}>Write a comment...</MessageInput>} - </React.Fragment> + </> ) : ( - <React.Fragment> + <> <span> · </span>{this.state.active === msg.rid || <Button className="a-login">Reply</Button>} - </React.Fragment> + </> ) } </div> </div> </li> )) : ( - <React.Fragment> + <> {Array(loaders).fill().map((it, i) => <Spinner key={i} />)} - </React.Fragment> + </> ) } </ul> - </React.Fragment> + </> ); } } |