-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posted From Feature #1122
Posted From Feature #1122
Conversation
From Workflow https://github.com/busyorg/busy/projects/6 |
|
@Kennybll here is my review:
|
Also fixes issue #1111. |
@Kennybll in future please use more relevant name for your commits |
Okay. |
|
Updates color property on __post_from
Again sorry for so many commit, they all are different files that are changed because Github.com doesn't allow multiple file commits. Git on my Windows laptop isn't working so well. |
There @Sekhmet . Is there any other things you guys tend to not do, so I can be prepared in the future? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any written rules, but we try to make our codebase consistent. I think that code should speak for itself and that code is the best guideline.
If there is something related to code style that can be improved it should be discussed first and update an entire codebase to make sure everything is consistent.
I'm not sure what kind of git client are you using, but I think it should support committing multiple files. I recommend using command line git though.
import { jsonParse } from '../../helpers/formatter'; | ||
import './PostedFromEmbed.less'; | ||
|
||
const PostedFromEmbed = ({ post }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this called PostedFromEmbed
? Just PostedFrom
makes sense in my opinion
<FormattedMessage | ||
id="posted_from_tooltip" | ||
defaultMessage={'Version: {version}'} | ||
values={{ version: jsonParse(post.json_metadata).app.split('/')[1] }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to parse metadata three times. We can do it just once. and save name and version in a variable.
This won't work too well if the app is no present (it will throw exception crashing React).
src/client/components/Story/Story.js
Outdated
<FormattedRelative value={`${post.created}Z`} /> | ||
</span> | ||
</Tooltip> | ||
<PostedFromEmbed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's short enough to fit in one line.
@@ -57,6 +57,10 @@ | |||
padding: 16px; | |||
display: flex; | |||
|
|||
&__flex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. On line 238. I had to make that span display flex because the Topic tag would be on the next line next to the date posted.
@@ -311,7 +312,10 @@ class StoryFull extends React.Component { | |||
<FormattedRelative value={`${post.created}Z`} /> | |||
</span> | |||
</Tooltip> | |||
{ Math.ceil(readingTime(post.body).minutes) > 1 && | |||
<PostedFromEmbed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can fit on one line as well.
@@ -54,7 +54,12 @@ | |||
position: relative; | |||
display: flex; | |||
padding: 16px 0; | |||
|
|||
|
|||
&__post_from { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this isn't used as well.
src/client/locales/en.json
Outdated
"power_down_message": "Started power down: {value}" | ||
"power_down_message": "Started power down: {value}", | ||
"posted_from_tooltip": "Version: {version}", | ||
"posted_from": "{from}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need translation for posted_from
. It should just display app name.
|
||
const PostedFromEmbed = ({ post }) => ( | ||
<span> | ||
<span className="PostedFrom__bullet" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS class name should have the same name as component PostedFormEmbed
. It doesn't make a difference though as I think it should be renamed.
import './PostedFromEmbed.less'; | ||
|
||
const PostedFromEmbed = ({ post }) => ( | ||
<span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to add a class name to a topmost element in this component (to respect http://getbem.com/introduction guidelines).
@Sekhmet , so I figured out what was wrong with git on my computer. Nothing! Lol. I thought the process was hanging, but nope, it was running the pre-commit tests. It just took a minute to output something. |
Is this good @Sekhmet @bonustrack ? |
@@ -54,7 +58,7 @@ | |||
position: relative; | |||
display: flex; | |||
padding: 16px 0; | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is additional whitespace there.
src/client/helpers/apps.js
Outdated
esteem: 'eSteem', | ||
chainbb: 'chainBB', | ||
utopian: 'Utopian', | ||
dtube: 'dTube', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's DTube, DSound and dMania (not dTube and dSound). Can you fix the case?
Show the app used to publish a post in the UI.
Changes: