Last active
March 19, 2018 23:15
Revisions
-
matheusnascgomes renamed this gist
Mar 19, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
matheusnascgomes renamed this gist
Mar 19, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
matheusnascgomes created this gist
Mar 19, 2018 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ import React from 'react'; import { Row, Col } from 'react-bootstrap'; import FontAwesome from 'react-fontawesome'; import CategoryTag from './helpers/CategoryTag'; import User from './res/user.jpg'; import './styles/content.css' export default props => { const { list, description } = props; return( list.filter(link => { return ( link.meta.title.toLowerCase().indexOf(description.toLowerCase()) >= 0 || link.meta.url.toLowerCase().indexOf(description.toLowerCase()) >= 0 || link.meta.author.toLowerCase().indexOf(description.toLowerCase()) >= 0 || link.category.toLowerCase().indexOf(description.toLowerCase()) >= 0 ) }) .map(link => ( <Row key={link.meta.author} className="content"> <Col className="first-block" md={1} sm={6}> <FontAwesome name="angle-up" size="2x" style={{ color: '#da4738'} } /> <p>{link.upvotes}</p> </Col> <Col className="second-block" md={11} sm={6}> <p>{link.meta.url}</p> <h4>{link.meta.title}</h4> <div className="links"> <CategoryTag tagText={link.category}>{link.category}</CategoryTag> <div><a className="user-name"><img src={User} alt="foto do dono do post" with="16px" height="16px" />{link.meta.author}</a></div> <div><p className="time">43 minutes ago</p></div> <div><a href="" ><FontAwesome name="comment" style={{ color: '#da4738'} } /> {link.comments} Comments</a></div> <div><a href="">Edit</a></div> </div> </Col> </Row> )) ); }