Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Refactor about:extensions with Aphrodite #7346

Merged
merged 1 commit into from
Mar 13, 2017
Merged

Refactor about:extensions with Aphrodite #7346

merged 1 commit into from
Mar 13, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Feb 21, 2017

Test Plan

  1. Open about:preferences#advanced
  2. Disable Torrent Viewer
  3. Restart the browser
  4. Open about:extensions
  5. Make sure Torrent Viewer is disabled (grayed out)
  6. Enable Torrent Viewer
  7. Make sure Torrent Viewer is enabled

Description

Closes #7345

  • extensions.less is deleted
  • itemList.less is unlinked
  • globalStyles.spacing.aboutPageDetailsPageWidth is introduced

Auditors: @cezaraugusto, @bsclifton

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Blocked on #7258 #7258 was merged to the master

render () {
const className = css(
commonStyles.listItem,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++++++++++++++

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++++++++++++++++

render () {
const className = css(
commonStyles.listItem,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++++++++++++++

<div className='extensionImage'>
<img src={`${this.props.extension.get('base_path')}/${icon}`} />
<div className={css(styles.extensionImage)}>
<img className={css(styles.img)} src={`${this.props.extension.get('base_path')}/${icon}`} />
</div>
<div className='extensionDetails'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove that class or just replace it to data-id-test just for future-friendliness?

@@ -113,7 +158,7 @@ class AboutExtensions extends React.Component {
})
}
render () {
return <div className='extensionDetailsPage'>
return <div className={css(styles.detailsPage)}>
<h2 data-l10n-id='extensions' />
<div className='extensionDetailsPageContent'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

<h3 className='extensionTitle'>{bravifyText(this.props.extension.get('name'))}</h3>
<span className='extensionVersion'>{this.props.extension.get('version')}</span>
<h3 className={css(styles.extensionTitle)}>{bravifyText(this.props.extension.get('name'))}</h3>
<span className={css(styles.extensionVersion)}>{this.props.extension.get('version')}</span>
{
!['__MSG_extDescriptionGoogleChrome__', '__MSG_appDesc__'].includes(this.props.extension.get('description'))
? <div className='extensionDescription'>{bravifyText(this.props.extension.get('description'))}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

require('../../node_modules/font-awesome/css/font-awesome.css')

const styles = StyleSheet.create({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] I think it's more likely to edit logic code more than editing styles, and this way we have to scroll down all Aphrodite stuff to get there. Can we put styles at the end of the file?

Copy link
Contributor Author

@luixxiul luixxiul Feb 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put that here bearing in mind that on HTML files inlined styles are placed before body tag. Moving these to the bottom is fine for me too. CC @bbondy and @bsclifton for comments. I think we do not have the rule on the placement (Sorry if I missed it).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to the bottom would be great (so that everything is consistent) 👍

opacity: 0.3;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

"let's use less LESS"

@bsclifton
Copy link
Member

@luixxiul let me know once you address the feedback and I can review / merge 😄

@luixxiul
Copy link
Contributor Author

Ok updated. Let me know if it is ok so I will squash the commits ;-)

@luixxiul luixxiul added this to the 0.13.6 milestone Mar 11, 2017
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments left- otherwise, looks great! 😄 Once you've implemented feedback and squashed, we're good to go on merge. I made sure the about:extensions tests pass (vimium fails, but that's expected) and all unit tests pass 👍

require('../../node_modules/font-awesome/css/font-awesome.css')

const styles = StyleSheet.create({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to the bottom would be great (so that everything is consistent) 👍

@@ -106,6 +106,7 @@ const globalStyles = {
navbarBraveButtonMarginLeft: '80px',
navbarLeftMarginDarwin: '76px',
sideBarWidth: '190px',
aboutPageDetailsPageWidth: '704px',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable name is not very clear... Can we name it something more appropriate, like aboutExtensionDetailWidth?

Copy link
Contributor Author

@luixxiul luixxiul Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I named so in order to replace other "704px"s on about pages with that variable (this one too: 9ad4b84#diff-9d96fcb58c1eeedf8e3d6d7f46b1a794R118).

Is it OK to do so with this PR or another one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, that works 👍

render () {
const className = css(
commonStyles.listItem,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+++++++++++++++++

Closes #7345

- extensions.less is deleted
- itemList.less is unlinked
- globalStyles.spacing.aboutPageDetailsPageWidth is introduced

Auditors:

Test Plan:
1. Open about:preferences#advanced
2. Disable Torrent Viewer
3. Restart the browser
4. Open about:extensions
5. Make sure Torrent Viewer is disabled (grayed out)
6. Enable Torrent Viewer
7. Make sure Torrent Viewer is enabled
@luixxiul
Copy link
Contributor Author

Squashed!

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants