-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
iconClass={'post-image__download'} | ||
index={index} | ||
> | ||
<DownloadIcon/> |
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 is the actual fix. Others are just refactor.
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.
@saturninoabril can we please,
- Move the tooltip to just above the download button. It looks too far away/disconnected right now. @asaadmahmood might be able to help if necessary.
- Change the text to just "Download" (without the file name)
@esethna Thanks for the review. I have addressed both 1 & 2. See screenshots below. |
components/file_attachment.jsx
Outdated
@@ -40,7 +47,7 @@ export default class FileAttachment extends React.PureComponent { | |||
super(props); | |||
|
|||
this.state = { | |||
loaded: Utils.getFileType(props.fileInfo.extension) !== 'image' | |||
loaded: getFileType(props.fileInfo.extension) !== 'image' |
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.
Not part of this PR, I know, but it drives me crazy that getFileType
doesn't return constant-defined strings that could be compared against. Would be great if someone refactored that...
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.
Yeah, that makes sense, I'll submit separate PR to refactor that.
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.
PR submitted #701
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.
Thanks Saturn!
Rebased to latest and fixed merge conflicts |
/** | ||
* File URL | ||
*/ | ||
fileURL: PropTypes.string |
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.
Are these props really not required? Just verifying as per last dev meeting.
utils/file_utils.jsx
Outdated
|
||
export function trimFilename(filename) { | ||
let trimmedFilename = filename; | ||
if (filename.length > 35) { |
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.
Can we define this magic 35
somewhere?
Summary
Move tooltip from filename to download icon
Others:
FileAttachment
componentFileThumbnail
component@esethna Could you please check if the tooltip is positioned as you would expect? Thanks!
Update (Feb 2):
![screen shot 2018-02-02 at 7 45 48 pm](https://user-images.githubusercontent.com/5334504/35731891-5a2cd6ea-0852-11e8-94ec-37743450c27c.png)
![screen shot 2018-02-02 at 7 45 11 pm](https://user-images.githubusercontent.com/5334504/35731892-5a658b66-0852-11e8-82a7-8245a7f96653.png)
Ticket Link
This PR addressed item 1 of:
Checklist
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passed