mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Avatar color refinements
This commit is contained in:
parent
a142a86b5d
commit
c542918dae
@ -56,7 +56,7 @@ const AddForm = (props) => {
|
|||||||
<form onSubmit={submitForm} className="comment-form">
|
<form onSubmit={submitForm} className="comment-form">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex mb-4 space-x-4 justify-start items-center">
|
<div className="flex mb-4 space-x-4 justify-start items-center">
|
||||||
<Avatar />
|
<Avatar saturation={props.avatarSaturation} />
|
||||||
<div>
|
<div>
|
||||||
<h4 className="text-lg font-sans font-bold mb-1 tracking-tight dark:text-neutral-300">{member.name ? member.name : 'Anonymous'}</h4>
|
<h4 className="text-lg font-sans font-bold mb-1 tracking-tight dark:text-neutral-300">{member.name ? member.name : 'Anonymous'}</h4>
|
||||||
<h6 className="text-[13px] text-neutral-400 font-sans">Now</h6>
|
<h6 className="text-[13px] text-neutral-400 font-sans">Now</h6>
|
||||||
|
@ -25,11 +25,11 @@ class Avatar extends React.Component {
|
|||||||
return [0,0,10];
|
return [0,0,10];
|
||||||
}
|
}
|
||||||
|
|
||||||
const saturation = this.props.saturation ? this.props.saturation : 50;
|
const saturation = isNaN(this.props.saturation) ? 50 : this.props.saturation;
|
||||||
|
|
||||||
const hRange = [0, 360];
|
const hRange = [0, 360];
|
||||||
const lRangeTop = Math.round(saturation / (100 / 30)) + 20;
|
const lRangeTop = Math.round(saturation / (100 / 30)) + 30;
|
||||||
const lRangeBottom = lRangeTop - 10;
|
const lRangeBottom = lRangeTop - 20;
|
||||||
const lRange = [lRangeBottom, lRangeTop];
|
const lRange = [lRangeBottom, lRangeTop];
|
||||||
|
|
||||||
const hash = this.getHashOfString(commentMember.name);
|
const hash = this.getHashOfString(commentMember.name);
|
||||||
|
@ -62,7 +62,7 @@ const Comment = (props) => {
|
|||||||
}
|
}
|
||||||
{isInReplyMode &&
|
{isInReplyMode &&
|
||||||
<div className={`ml-14 mb-10 ${!hasReplies && 'mt-10'}`}>
|
<div className={`ml-14 mb-10 ${!hasReplies && 'mt-10'}`}>
|
||||||
<ReplyForm parent={comment} toggle={toggleReplyMode} />
|
<ReplyForm parent={comment} toggle={toggleReplyMode} avatarSaturation={props.avatarSaturation} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
|
@ -58,7 +58,7 @@ class CommentsBox extends React.Component {
|
|||||||
{comments}
|
{comments}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{ this.context.member ? <AddForm /> : <NotSignedInBox /> }
|
{ this.context.member ? <AddForm avatarSaturation={this.props.avatarSaturation} /> : <NotSignedInBox /> }
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
@ -59,7 +59,7 @@ const ReplyForm = (props) => {
|
|||||||
<form onSubmit={submitForm} className="comment-form mb-4">
|
<form onSubmit={submitForm} className="comment-form mb-4">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="flex mb-4 space-x-4 justify-start items-center">
|
<div className="flex mb-4 space-x-4 justify-start items-center">
|
||||||
<Avatar />
|
<Avatar saturation={props.avatarSaturation} />
|
||||||
<div>
|
<div>
|
||||||
<h4 className="text-lg font-sans font-bold mb-1 tracking-tight dark:text-neutral-300">{member.name}</h4>
|
<h4 className="text-lg font-sans font-bold mb-1 tracking-tight dark:text-neutral-300">{member.name}</h4>
|
||||||
<h6 className="text-[13px] text-neutral-400 font-sans">Now</h6>
|
<h6 className="text-[13px] text-neutral-400 font-sans">Now</h6>
|
||||||
|
Loading…
Reference in New Issue
Block a user