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

Refactor payment/history.js #8038

Merged
merged 2 commits into from
Apr 16, 2017
Merged

Refactor payment/history.js #8038

merged 2 commits into from
Apr 16, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Apr 2, 2017

See: cropped picture of the 6th commit on #6047 (comment)

Closes #8037

  • Changed aphrodite to aphrodite/no-important (to speed up removing the LESS files)
    Aphrodite without no-important overwrites the existing code, which should have been removed from the LESS files at the same time. It will make it difficult to know which styles should be kept and removed, having confidence in that changes would not cause regressions. It might be slowing down the refactoring work.

  • Modified modalOverlay.js by adding customHeaderClassesStr
    The intent of the change is to make it possible to apply custom styles to sectionTitle. In this case, braveMediumOrange to the title.

  • Introduced paymentStylesVariables and paymentHistoryTablePadding

  • Appied it to leftRow and paymentHistoryOverlay__title
    It aligns the padding-left of sectionTitle and the most left row.

  • Set position:sticky to the table header
    It always display the table header. Sticky has been available on chromium since a couple of versions.

  • Set columnHeight and columnPadding

  • Reverted commonStyles.primaryButton to primaryButton temporarily
    There have been already browserButton and primaryButton available with commonStyles.js, still these styles are overwritten by ones which button.less defines. We have to work on refactoring button.less at first.

Also:

  • Removed medium
  • Removed pull-left, which is no longer used

Auditors:

Test Plan:

  1. Open about:preferences#payments
  2. The modal dialog looks like the cropped picture of the 6th commit on Refactor about:preferences#payments followups #6047 (comment)
  • 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).

Test Plan:

@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 2, 2017

#6047 (comment)

screenshot 2016-12-15 3 36 37

Currently:

screenshot 2017-04-02 18 13 47

history1

With this PR:

screenshot 2017-04-02 19 32 37

history2

@luixxiul luixxiul self-assigned this Apr 2, 2017
<Button l10nId='paymentHistoryOKText'
className={css(commonStyles.primaryButton)}
className='primaryButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you change this back to regular class?

Copy link
Contributor Author

@luixxiul luixxiul Apr 2, 2017

Choose a reason for hiding this comment

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

As I wrote in the commit message:

  • Reverted commonStyles.primaryButton to primaryButton temporarily

There have been already browserButton and primaryButton available with commonStyles.js, still these styles are overwritten by ones which button.less defines. We have to work on refactoring button.less at first.

It is because aphrodite was changed to aphrodite/no-important. I left the reasoning in the commit message on this change too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I didn't read you comment in the commit. Make sense, so let's create an issue for this and track all things that need's to be done there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1!!

const globalStyles = require('../styles/global')
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't want it ;)

const {paymentStyles} = require('../styles/payment')
const settingIcon = require('../../../extensions/brave/img/ledger/icon_settings.svg')
=======
Copy link
Contributor

Choose a reason for hiding this comment

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

(2)

=======
const {paymentStyles, paymentStylesVariables} = require('../styles/payment')
const advanceIcon = require('../../../extensions/brave/img/ledger/icon_settings.svg')
>>>>>>> Refactor payment/history.js
Copy link
Contributor

Choose a reason for hiding this comment

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

(3)

@@ -364,6 +385,21 @@ const styles = StyleSheet.create({
':hover': {
backgroundColor: globalStyles.color.chromeTertiary
}
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

:)

@@ -160,8 +166,12 @@ class PaymentsTab extends ImmutableComponent {
/>
: null
}
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@@ -276,12 +286,23 @@ const styles = StyleSheet.create({
switchWrap: {
width: paymentStyles.width.tableCell
},
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

(._.)

switchWrap__switchControl: {
// TODO: Refactor switchControls.less
paddingTop: '0 !important',
paddingBottom: '0 !important'
},
switchWrap__switchSpan: {
=======
Copy link
Contributor

Choose a reason for hiding this comment

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

( .-. )

},

switchSpan: {
>>>>>>> Refactor payment/history.js
Copy link
Contributor

Choose a reason for hiding this comment

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

(._.)

color: `${globalStyles.color.braveMediumOrange} !important`,
padding: `25px 0 25px ${paymentStylesVariables.spacing.paymentHistoryTablePadding} !important`,
textIndent: '0 !important'
>>>>>>> Refactor payment/history.js
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={css(styles.flexAlignEnd)}>
=======
<div className={css(styles.titleBar)}>
>>>>>>> Refactor payment/history.js
Copy link
Contributor

Choose a reason for hiding this comment

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

(。◕‿◕。)

@luixxiul luixxiul changed the base branch from master to refactoring-aphrodite April 6, 2017 09:21
@luixxiul luixxiul requested a review from NejcZdovc April 6, 2017 15:36
height: columnHeight,
alignItems: 'center',
cursor: 'default',
WebkitUserSelect: 'none'
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 basic user select and not a webkit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 9, 2017

pinging @bradleyrichter for design review :-)

@luixxiul luixxiul changed the base branch from refactoring-aphrodite to master April 10, 2017 03:19
Suguru Hirahara added 2 commits April 10, 2017 12:24
See: cropped picture of the 6th commit on #6047 (comment)

Closes #8037

- Changed aphrodite to aphrodite/no-important (to speed up removing the LESS files)
  Aphrodite without no-important overwrites the existing code, which should have been removed from the LESS files at the same time. It will make it difficult to know which styles should be kept and removed, having confidence in that changes would not cause regressions. It might be slowing down the refactoring work.

- Modified modalOverlay.js by adding customHeaderClassesStr
  The intent of the change is to make it possible to apply custom styles to the sectionTitle. In this case, braveMediumOrange to the title.

- Introduced paymentStylesVariables and paymentHistoryTablePadding
- Appied it to leftRow and paymentHistoryOverlay__title
  It aligns the padding-left of the sectionTitle and the most left row.

- Set position:sticky to the table header
  It always display the table header. Sticky has been available on chromium since a couple of versions.

- Set columnHeight and columnPadding

- Reverted commonStyles.primaryButton to primaryButton temporarily
  There have been already browserButton and primaryButton available with commonStyles.js, still these styles are overwritten by ones which button.less defines. We have to work on refactoring button.less at first.

Also:
- Removed medium
- Removed pull-left, which is no longer used

Auditors:

Test Plan:
1. Run npm run add-simulated-payment-history
2. Open about:preferences#payments
3. The modal dialog looks like the cropped picture of the 6th commit on #6047 (comment)
Addresses #8054

- Renamed customTitleClasses to customDialogClasses
- Renamed customHeaderClasses to customTitleClasses

customeDialogClasses
 |-- customTitleClasses

Auditors:

Test Plan:
1. Open about:preferences#payments
2. Enable payments
3. Click "Add funds"
4. Make sure the style of modal overlay dialog is not broken
5. Click "Display QR"
6. Make sure the QR overlay is displayed
7. Close those overlay dialogs
8. Click payment history icon
9. Make sure the style of the modal dialog is not broken
10. Close the dialog
11. Click advanced options icon
12. Click "Backup your wallet"
13. Make sure background color of the dialog is not changed
@luixxiul luixxiul modified the milestones: 0.14.2, 0.14.3 Apr 10, 2017
@luixxiul luixxiul mentioned this pull request Apr 11, 2017
4 tasks
luixxiul referenced this pull request Apr 15, 2017
- Auditors: @bsclifton, @luixxiul
- Close #8333
Test Plan: styles.md should have guidelines about how we make use of Aphrodite
Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

LGTM

@luixxiul luixxiul merged commit 24fafe1 into brave:master Apr 16, 2017
@luixxiul
Copy link
Contributor Author

@cezaraugusto thanks for reviewing.

@luixxiul luixxiul deleted the paymentHistory-refactoring branch April 16, 2017 06:47
@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 16, 2017

@bsclifton please change the milestone if this is going to be merged to 0.14.2, thanks.

#8037 as well.

@luixxiul
Copy link
Contributor Author

luixxiul commented May 1, 2017

FYI: there are several reports that position:sticky does not work on chromium 58. See https://developers.google.com/web/updates/2016/12/position-sticky for the comments.

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