Mejorado el css de comentarios

This commit is contained in:
Daniel Cortes
2020-07-15 01:51:46 -04:00
parent c3f0780a5b
commit 502a91328c
2 changed files with 57 additions and 65 deletions

View File

@@ -28,14 +28,14 @@ const Opinions = (props) => {
break; break;
} }
if(!Y) Y = ''; if (!Y) Y = '';
if(!N) N = ''; if (!N) N = '';
if(!F) F = ''; if (!F) F = '';
const handleClick = (type) => () => { const handleClick = (type) => () => {
if(type === pressed){ if (type === pressed) {
setPressed(null) setPressed(null)
}else{ } else {
setPressed(type) setPressed(type)
} }
}; };
@@ -88,14 +88,18 @@ const Stars = (props) => {
const Comment = (props) => ( const Comment = (props) => (
<div className='comment'> <div className='comment'>
<div className='avatar-container'> <div className='avatar'>
<FaUser/> <FaUser/>
</div> </div>
<div className='body'> <div className='content'>
<div className="header">
<Link to={`/user/${props.user.id}`} className='username'>{props.user.username}</Link> <Link to={`/user/${props.user.id}`} className='username'>{props.user.username}</Link>
<p>{props.opinion}</p>
<div className={'acciones'}>
<Stars stars={props.stars}/> <Stars stars={props.stars}/>
</div>
<div className="body">
<p>{props.opinion}</p>
</div>
<div className="footer">
<Opinions helpful={props.helpful}/> <Opinions helpful={props.helpful}/>
</div> </div>
</div> </div>

View File

@@ -1,12 +1,14 @@
.comments { .comment {
.comment {
display: flex; display: flex;
flex-direction: row;
padding-bottom: 1em; padding-bottom: 1em;
margin-top: 1em; margin-top: 1em;
border-bottom: var(--line-width) solid var(--accent); border-bottom: var(--line-width) solid var(--accent);
.avatar-container { width: 100%;
flex-shrink: 0;
.avatar {
width: 75px; width: 75px;
height: 75px; height: 75px;
margin-right: 1em; margin-right: 1em;
@@ -19,57 +21,43 @@
height: 90%; height: 90%;
color: rgb(250, 250, 250); color: rgb(250, 250, 250);
} }
} }
.body { .content {
width: 90%;
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
.username { .username {
font-weight: 500; font-weight: 500;
} }
.stars .star {
cursor: auto;
}
} }
.acciones { .body {
display: flex; p {
flex-direction: row; white-space: pre-wrap;
}
&>*{
margin-right: 1em;
} }
.opinions { .footer {
display: flex;
flex-direction: row;
button { button {
border: none; border: none;
background-color: transparent; background-color: transparent;
cursor: pointer; cursor: pointer;
span > *{ span > * {
display: inline; display: inline;
} }
&:hover, &.selected { &:hover, &.selected {
color: var(--accent); color: var(--accent);
} }
}
}
.stars {
display: flex;
justify-content: flex-start;
.star {
margin: inherit;
width: 1.5em;
height: 1.5em;
cursor: auto;
}
.star.selected {
color: var(--accent);
}
} }
} }
} }