-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sean Yesmunt
committed
Jun 5, 2019
1 parent
1226f27
commit feccc7e
Showing
21 changed files
with
207 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { connect } from 'react-redux'; | ||
import { makeSelectTagsForUri, selectFollowedTags } from 'lbry-redux'; | ||
import FileTags from './view'; | ||
|
||
const select = (state, props) => ({ | ||
tags: makeSelectTagsForUri(props.uri)(state), | ||
followedTags: selectFollowedTags(state), | ||
}); | ||
|
||
export default connect( | ||
select, | ||
null | ||
)(FileTags); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @flow | ||
import * as icons from 'constants/icons'; | ||
import * as React from 'react'; | ||
import { parseURI } from 'lbry-redux'; | ||
import Icon from 'component/common/icon'; | ||
import FilePrice from 'component/filePrice'; | ||
|
||
type Props = { | ||
tags: Array<string>, | ||
followedTags: Array<Tag>, | ||
}; | ||
|
||
export default function FileTags(props: Props) { | ||
const { tags, followedTags } = props; | ||
let tagsToDisplay = []; | ||
followedTags.forEach(({ name }) => { | ||
if (tags.includes(name)) { | ||
tagsToDisplay.push(name); | ||
} | ||
}); | ||
|
||
let sortedTags = tags.sort((a, b) => (a > b ? 1 : -1)); | ||
tagsToDisplay = tagsToDisplay.concat(sortedTags.slice(0, 3 - tagsToDisplay.length)); | ||
|
||
return ( | ||
<div className="file-properties"> | ||
{tagsToDisplay.map(tag => ( | ||
<span key={tag} className="tag"> | ||
{tag} | ||
</span> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.