Skip to content

Commit

Permalink
[rnl] less code is good code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Lee committed Jul 8, 2017
1 parent 344cfaf commit 70b8147
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion components/ImageTooltipContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import React, { Component } from 'react';
import { connect } from 'react-redux';
import debounce from 'lodash/debounce';

import { getViewportSize } from '../common/window';
import { TOOLTIP_WIDTH, TOOLTIP_ARROW_SIZE } from '../common/constants';
Expand Down
26 changes: 10 additions & 16 deletions components/LibraryList.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import { getTimeSinceToday } from '../common/datetime';

import LibraryListEmptyState from '../components/LibraryListEmptyState';
import LibraryListItem from '../components/LibraryListItem';

Expand All @@ -13,20 +11,16 @@ export default class LibraryList extends React.PureComponent {
};

render() {
let elements;
if (this.props.libraries.length < 1) {
elements = <LibraryListEmptyState />;
} else {
elements = this.props.libraries.map(item => {
return (
<LibraryListItem
key={item.github.name}
library={item}
topics={this.props.topics}
/>
);
});
}
const elements =
this.props.libraries.length < 1
? <LibraryListEmptyState />
: this.props.libraries.map(item =>
<LibraryListItem
key={item.github.name}
library={item}
topics={this.props.topics}
/>
);

return (
<ul className="LibraryList">
Expand Down

0 comments on commit 70b8147

Please sign in to comment.