-
Notifications
You must be signed in to change notification settings - Fork 973
Restructure paymentsTab with grid property #10238
Conversation
I added |
</table> | ||
<div className={css(gridStyles.row1col1, styles.walletBar__title)} data-l10n-id='monthlyBudget' /> | ||
<div className={css(gridStyles.row1col2, styles.walletBar__title)} data-l10n-id='accountBalance' /> | ||
<div className={css(gridStyles.row1col3)} /> |
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 blank item.
Codecov Report
@@ Coverage Diff @@
## master #10238 +/- ##
==========================================
+ Coverage 54.15% 54.16% +0.01%
==========================================
Files 247 247
Lines 21575 21579 +4
Branches 3344 3346 +2
==========================================
+ Hits 11684 11689 +5
+ Misses 9891 9890 -1
|
@@ -38,6 +39,12 @@ class SettingDropdown extends ImmutableComponent { | |||
} | |||
} | |||
|
|||
class PanelDropdown extends ImmutableComponent { | |||
render () { | |||
return <FormDropdown data-isPanel='true' {...this.props} /> |
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.
you're actually passing a string here, so this is actually truthy and not true
. For such cases you'd need to pass as a boolean like data-isPanel={true}
, but standard will complain. Hidden values are evaluated to true
anyway and make standard happy, so <FormDropdown data-isPanel {...this.props} />
is the right take.
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.
<FormDropdown data-isPanel {...this.props} /> is the right take.
OK I'm changing.
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.
|
||
settings_panel: { | ||
// ref: browserButton_panelItem | ||
width: '180px' |
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.
if browserButton_panelItem
shares the same value then it should be both hosted in global.js
, then the comment can be removed
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.
@@ -59,7 +58,7 @@ const styles = StyleSheet.create({ | |||
backgroundColor: globalStyles.color.lightGray, | |||
borderRadius: globalStyles.radius.borderRadiusUIbox, | |||
padding: '40px', | |||
fontSize: paymentStyles.font.regular, | |||
fontSize: globalStyles.payments.fontSize.regular, |
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 are we changing styles here?
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.
To remove paymentsStyles
for now. It is not maintained well and moving the values to global.js makes it the code much more understandable.
I'm going to re-introduce paymentStyles
after files related with about:preferences#payments are polished and the other stuff (which could be related with them) on other files than ones under payment
is also converted to normalize the common styles, if any.
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.
If paymentStyles
would be left, there would remain only this line as other two will be removed. It does not make much sense to have a const for one style, IMO.
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.
ok I'm against payments.js
styles anyway so doing what you did is better up to a point that we remove that file.
@@ -84,11 +83,10 @@ class EnabledContent extends ImmutableComponent { | |||
|
|||
return <section className={css(styles.balance)}> | |||
<FormTextbox data-test-id='fundsAmount' readOnly value={btcToCurrencyString(value, ledgerData)} /> | |||
<a className={css(styles.iconLink)} href='https://brave.com/Payments_FAQ.html' target='_blank'> | |||
<a className={css(styles.balance__iconLink)} href='https://brave.com/Payments_FAQ.html' target='_blank'> |
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.
++ much better
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.
Added rel='noopener'
as well:
91de03c#diff-5d8199641ea1ba12e0394859f7eb0c55R86
} | ||
const styles = StyleSheet.create({ | ||
walletBar: { | ||
display: 'grid', |
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.
yessssssss
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.
Grid rules 🦁
@@ -327,6 +328,13 @@ const globalStyles = { | |||
background: '#ccc' | |||
} | |||
} | |||
}, | |||
|
|||
// TODO (Suguru): move them to payment.js after style refactoring is done |
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.
@cezaraugusto this TODO will be revisited.
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.
ok thanks. also pls move things out of that most you can. I think that file should be removed
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 see. I'm going to address that on another PR (as it is out of scope of this PR and it'll take some time).
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.
great work, thanks ++
I tested before the conflict, can you rebase please? we can merge after that |
@cezaraugusto rebased. this is ready for re-review, thanks. |
@luixxiul can you rebase again pls |
Closes #10236 Replace display:table with display:grid to align elements Also: - Update enabledContent.js to BEM style (Closes #10146) - Add PanelDropdown - Remove paymentStyles from payment for now (until conversion is done) - Add Panel Dropdown to styles.js (Closes #10245) Auditors: @cezaraugusto Test Plan 1: 1. Open `about:preferences#payments` 2. Enable payments 3. Make sure the elements are aligned equally on both rows and columns 4. Disable payments 5. Make sure the switch is placed on the same place Test Plan 2: 1. Open about:styles#dropdowns 2. Make sure PanelDropdown appears there
@luixxiul is this expected ? |
the right column should be aligned to the gray box. something must have been fallen out during 0.19 series. will check out. |
Closes #10236
Replace display:table with display:grid to align elements
Also:
Test Plan 1:
about:preferences#payments
Test Plan 2:
If this does not look changed, nothing is broken :-)
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests