Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

UI for Rewards monthly statement #513

Closed
wants to merge 1 commit into from
Closed

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Jul 9, 2019

Core: brave/brave-core#2733

Changes

Implements UI portions for Rewards Monthly Statement for brave/brave-browser#930

Test plan

Link / storybook path to visual changes

https://brave-ui-3c5q3df9x.now.sh/?path=/story/feature-components-rewards-modal--monthly-statement

https://brave-ui-3c5q3df9x.now.sh/?path=/story/feature-components-rewards-concepts-desktop--printable-monthly-statement

Integration

  • Does this contain changes to src/components or src/

    • Will you publish to npm immediately after this PR, or wait until sometime in the future?
    • Incompatible API change to something existing (major version increase)
    • Adding new backwards-compatible functionality? (minor version increase)
    • Fixing a bug backwards-compatibly? (patch version increase)
  • Does this contain changes to src/features for brave-core?

    • Are there non backwards-compatible changes required for brave-core? Do not merge until brave-core PR is approvable. Link to brave-core PR:
    • Will you create brave-core PR to update to this commit after it is merged?
    • Wants uplift to brave-core feature branch?
      • When uplift-approved, merge to brave-core-0.VV.x feature branch
      • Create additional brave-core PRs for each feature branch to update commit

@rossmoody
Copy link
Contributor

I think this one might need an up to date design spec attached to it, right? @jenn-rhim I see the one in the issue but this PR seems to have tabbed navigation within the modal and is missing a few of the UI elements like Download as PDF and opening/closing balance line items. I think it might be tough for QA to know what's right without it.

Once we have that it'd be good to tighten up a few style nits like the floating divider line.

image

@rossmoody
Copy link
Contributor

Issue updated with design. Thanks for pointing me in the right direction Jason.

@jasonrsadler
Copy link
Contributor Author

@rossmoody
Download as PDF and Opening/Closing balances are deferred and are being handled in subsequent PRs.

Overflow problem for shrinking window is fixed.

@@ -21,17 +21,18 @@ export interface Props {
children?: React.ReactNode
rows?: Row[]
rowTheme?: {[key: string]: string}
customStyle?: {[key: string]: string}
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @petemill and @cezaraugusto as it changes common component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After conferring with @cezaraugusto and @petemill, removed modifications to table and tabs component

text-align: center;
font-family: ${p => p.theme.fontFamily.body};
height: 60px;
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @petemill and @cezaraugusto as it changes common component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After conferring with @cezaraugusto and @petemill, removed modifications to table and tabs component

@@ -58,6 +58,8 @@ export interface SummaryItem {

export interface Props {
contributeRows: ContributeRow[]
donationRows: ContributeRow[]
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't use donation phrase anymore. We only have AC, tip and recurring tip

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

</StyledVerified>
<div>
<Tabs activeTabId={this.state.tabId} onChange={this.onChange}>
<div data-key='cont1' data-title={'Transactions'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

translation needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{getLocale('noStatementTransactions')}
</TableTransactions>
</div>
<div data-key='cont2' data-title={'Monthly contributions'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

translation needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{getLocale('paymentMonthly', { day: paymentDay })}
</StyledTableSubTitle>
</div>
<div data-key='cont3' data-title={'Auto-Contribute'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

translation needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{getLocale('paymentMonthly', { day: paymentDay })}
</StyledTableSubTitle>
</div>
<div data-key='cont4' data-title={'Tips'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

translation needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

</StyledVerifiedIcon>
<StyledVerifiedText>{getLocale('braveVerified')}</StyledVerifiedText>
</StyledVerified>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

is this div needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed


export const StyledTitle = styled<{}, 'div'>('div')`
font-weight: 600;
color: #1B1D2F;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

`

export const StyledSubTitle = styled<{}, 'span'>('span')`
color: #838391;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

export const StyledSelectOption = styled<{}, 'div'>('div')`
font-size: 22px;
font-weight: 300;
color: #4C54D2;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

export const StyledIconText = styled<{}, 'div'>('div')`
font-size: 14px;
line-height: 1.43;
color: #838391;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

export const StyledWarning = styled<{}, 'div'>('div')`
display: flex;
justify-content: center;
border-top: 1px solid #ebecf0;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

Copy link
Member

Choose a reason for hiding this comment

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

++ If there is not a generic and shareabel theme color, then we can create one after asking design team @jenn-rhim @rossmoody, e.g. warningBackgroundBorder.

If this is a rewards-specific color rule then maybe we should start a rewards theme.

font-weight: 300;
line-height: 2.79;
letter-spacing: 0.2px;
color: #4b4c5c;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

font-size: 12px;
align-items: center;
line-height: 2;
color: #9e9fab;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

`

export const StyledAlertWrapper = styled<{}, 'div'>('div')`
color: #E9AB18;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

`

export const StyledActionIcon = styled<{}, 'span'>('span')`
color: #A1A8F2;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color


export const StyledVerifiedIcon = styled<{}, 'div'>('div')`
display: flex;
color: #392DD1;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use theme color

@NejcZdovc
Copy link
Contributor

@jasonrsadler which version is correct? There is a lot of differences.

left is yours on the right is what we have in the abstract
image

@jasonrsadler
Copy link
Contributor Author

jasonrsadler commented Jul 11, 2019

@NejcZdovc
This is the spec I received as final (and is named as final). @rossmoody, which one is considered final?
wallet activity-nav -- final

@jasonrsadler
Copy link
Contributor Author

@NejcZdovc Re: theme colors and fonts above. These are the colors that match the spec as well as fonts to match as closely as possible. We don't currently have theme colors to match these and would propose a follow up be done to streamline these.

@rossmoody
Copy link
Contributor

It's worth it to have @jenn-rhim weigh in on this one. I'm not close enough to this to know what is or isn't correct. I found that mockup in Abstract but if we've been working off a supplied design it's probably safe to assume that's the right version. I'll update the issue.

@NejcZdovc
Copy link
Contributor

@jasonrsadler colors should be picked from theme pallet, so let's try to find the closest color to what it is picked in the design

@NejcZdovc
Copy link
Contributor

@jasonrsadler what you pasted and what I did in my comparison is almost the same, the only thing that is different is footer text wrapping

@jasonrsadler
Copy link
Contributor Author

jasonrsadler commented Jul 11, 2019

@NejcZdovc regardless, they are different spec files in abstract and I didn’t recognize that file. Again, if we’re adhering to the spec, these are the correct colors. We should define and themify these as appropriate outside of this PR.

@jasonrsadler jasonrsadler force-pushed the monthly-statement branch 8 times, most recently from 62d3320 to 4275145 Compare July 12, 2019 12:06
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.

Copy link
Member

@petemill petemill left a comment

Choose a reason for hiding this comment

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

Would be good to have a better way to override Table margin than wrap with negative margin.

Then for colors as @NejcZdovc stated, please use theme colors so we don't dig the whole deeper of difficulty to create dark theme.

`

export const StyledTable = styled<{}, 'div'>('div')`
margin: -24px 0;
Copy link
Member

Choose a reason for hiding this comment

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

This will cause an overlap if the default margin changes of the Table component changes. Can we simply call something like?

styled(Table)`
  margin: 0;
`

The whole situation isn't ideal, but somehow resetting it to 0 is better than negative-offsetting the currently-set margin value.

text-align: center;
font-family: ${p => p.theme.fontFamily.body};
height: 60px;
padding-top:5px;
Copy link
Member

Choose a reason for hiding this comment

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

space between property and value

export const StyledWarning = styled<{}, 'div'>('div')`
display: flex;
justify-content: center;
border-top: 1px solid #ebecf0;
Copy link
Member

Choose a reason for hiding this comment

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

++ If there is not a generic and shareabel theme color, then we can create one after asking design team @jenn-rhim @rossmoody, e.g. warningBackgroundBorder.

If this is a rewards-specific color rule then maybe we should start a rewards theme.

contributeTx: '#9752cb',
recurringDonationTx: '#696fdc',
grantsTx: '#c12d7c',
earningFromAdsTx: '#c12d7c'
Copy link
Member

Choose a reason for hiding this comment

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

Theme colors

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

Can you please remove this check as I don't see it in abstract

image

Icon is missing on the second tab
image

Icon missing on the last tab
image

Can we remove jumping UI when you switch between tabs. (not talking about modal height, but on text moving left and right; see summary table at the top)
Screen Recording 2019-07-15 at 9 31 12 PM 2019-07-15 21_39_02

This needs to be changed to Total until we support start/end month
image

We are missing month in printable version
image

@ryanml ryanml closed this Jul 25, 2019
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.

6 participants