Issue #4 Comentarios falsos
This commit is contained in:
5
package-lock.json
generated
5
package-lock.json
generated
@@ -5704,6 +5704,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
|
||||||
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
|
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
|
||||||
},
|
},
|
||||||
|
"faker": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/faker/-/faker-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8="
|
||||||
|
},
|
||||||
"fast-deep-equal": {
|
"fast-deep-equal": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"@types/react": "^16.9.35",
|
"@types/react": "^16.9.35",
|
||||||
"@types/react-dom": "^16.9.8",
|
"@types/react-dom": "^16.9.8",
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
|
"faker": "^4.1.0",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
"query-string": "^6.12.1",
|
"query-string": "^6.12.1",
|
||||||
"react": "^16.13.1",
|
"react": "^16.13.1",
|
||||||
|
|||||||
@@ -1,10 +1,48 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import {FaThumbsUp, FaThumbsDown, FaLaughSquint} from 'react-icons/fa';
|
||||||
|
|
||||||
|
import Faker from 'faker';
|
||||||
|
|
||||||
|
import './Comments.scss'
|
||||||
|
|
||||||
|
const Comment = (props) => (
|
||||||
|
<div class='comment'>
|
||||||
|
<div class='avatar-container'>
|
||||||
|
<img className='avatar' src={props.avatar} alt='Avatar'/>
|
||||||
|
</div>
|
||||||
|
<div className='body'>
|
||||||
|
<span className='username'>{props.user}</span>
|
||||||
|
<p>{props.text}</p>
|
||||||
|
<div class='buttons'>
|
||||||
|
<button><FaThumbsUp/></button>
|
||||||
|
<button><FaThumbsDown/></button>
|
||||||
|
<button><FaLaughSquint/></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
export const Comments = (props) => {
|
export const Comments = (props) => {
|
||||||
|
let comentarios = [];
|
||||||
|
|
||||||
|
let comment_count = Math.floor(Math.random() * 20)
|
||||||
|
|
||||||
|
for(let i = 0; i < comment_count; i++){
|
||||||
|
comentarios.push({
|
||||||
|
user: Faker.internet.userName(),
|
||||||
|
avatar: Faker.internet.avatar(),
|
||||||
|
text: Faker.lorem.paragraph(20)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
comentarios = comentarios.map((comentario, index) => (
|
||||||
|
<Comment key={index} user={comentario.user} avatar={comentario.avatar} text={comentario.text}/>
|
||||||
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className='comments'>
|
||||||
<h3>Comentarios</h3>
|
<h2>Comentarios</h2>
|
||||||
<p>No aun :3</p>
|
{comentarios}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
42
src/components/Comments.scss
Normal file
42
src/components/Comments.scss
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
.comments {
|
||||||
|
.comment {
|
||||||
|
display: flex;
|
||||||
|
padding-bottom: 1em;
|
||||||
|
margin-top: 1em;
|
||||||
|
border-bottom: var(--line-width) solid var(--accent);
|
||||||
|
|
||||||
|
.avatar-container {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 75px;
|
||||||
|
height: 75px;
|
||||||
|
margin-right: 1em;
|
||||||
|
outline: 1px var(--gray-2) solid;
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
.username {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
button {
|
||||||
|
border: none;
|
||||||
|
padding: 0 1em;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import {CoverArt} from '../components/CoverArt';
|
|||||||
import {Paginate} from "../components/Paginate";
|
import {Paginate} from "../components/Paginate";
|
||||||
import {EntityList} from "../components/EntityList";
|
import {EntityList} from "../components/EntityList";
|
||||||
import {Entity} from "../components/Entity";
|
import {Entity} from "../components/Entity";
|
||||||
|
import {Comments} from "../components/Comments";
|
||||||
|
|
||||||
|
|
||||||
const Discs = (props) => {
|
const Discs = (props) => {
|
||||||
@@ -112,6 +113,7 @@ export const ArtistView = (props) => {
|
|||||||
<div className='artist-view'>
|
<div className='artist-view'>
|
||||||
<Artist artist={artist}/>
|
<Artist artist={artist}/>
|
||||||
{artist && <Discs discs={discs} paginate={discsPaginate} onPageChanged={handleDiscPageChanged} makeLink={makeLink} navigateToDisc={handleNavigateToDisc}/>}
|
{artist && <Discs discs={discs} paginate={discsPaginate} onPageChanged={handleDiscPageChanged} makeLink={makeLink} navigateToDisc={handleNavigateToDisc}/>}
|
||||||
|
<Comments/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {CoverArt} from "../components/CoverArt";
|
|||||||
import {Entity} from "../components/Entity";
|
import {Entity} from "../components/Entity";
|
||||||
import {EntityList} from "../components/EntityList";
|
import {EntityList} from "../components/EntityList";
|
||||||
import {Paginate} from "../components/Paginate";
|
import {Paginate} from "../components/Paginate";
|
||||||
|
import {Comments} from "../components/Comments";
|
||||||
|
|
||||||
const Versions = (props) => {
|
const Versions = (props) => {
|
||||||
const versions = props.versions ? props.versions : null;
|
const versions = props.versions ? props.versions : null;
|
||||||
@@ -115,6 +116,7 @@ export const DiscView = (props) => {
|
|||||||
onPageChanged={handleVersionPageChanged} makeLink={makeLink}
|
onPageChanged={handleVersionPageChanged} makeLink={makeLink}
|
||||||
navigateToVersion={handleNavigateToVersion}/>
|
navigateToVersion={handleNavigateToVersion}/>
|
||||||
}
|
}
|
||||||
|
<Comments/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {getRelease, getReleaseSongs} from "../services/entity_service";
|
|||||||
import {CoverArt} from "../components/CoverArt";
|
import {CoverArt} from "../components/CoverArt";
|
||||||
import {Entity} from "../components/Entity";
|
import {Entity} from "../components/Entity";
|
||||||
import {EntityList} from "../components/EntityList";
|
import {EntityList} from "../components/EntityList";
|
||||||
|
import {Comments} from "../components/Comments";
|
||||||
|
|
||||||
|
|
||||||
const Recordings = (props) => {
|
const Recordings = (props) => {
|
||||||
@@ -92,6 +93,7 @@ export const ReleaseView = (props) => {
|
|||||||
makeLink={makeLink}
|
makeLink={makeLink}
|
||||||
navigateToRecording={handleNavigateToRecording}/>
|
navigateToRecording={handleNavigateToRecording}/>
|
||||||
}
|
}
|
||||||
|
<Comments/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user