Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wallet] Redesign - Add header components #3803

Merged
merged 3 commits into from
May 16, 2020
Merged

Conversation

i1skn
Copy link
Contributor

@i1skn i1skn commented May 13, 2020

Description

  • add TopBarIconButton and TopBarTextButton.
  • add generic HeaderTitleWithSubtitle
  • refresh header with balance

Tested

Android emulator

Backwards compatibility

Yes

Screenshots

1

Screenshot_1589378972

2

Screenshot_1589379000

3

Screenshot_1589378963

4

Screenshot_1589378978

5 (when top bar button is pressed)

Screenshot_1589459370

@i1skn i1skn mentioned this pull request May 13, 2020
50 tasks
@i1skn i1skn force-pushed the i1skn/redesign-top-navigation branch 3 times, most recently from 0e98cd9 to e13fd1b Compare May 13, 2020 15:02
@i1skn i1skn requested a review from a team May 13, 2020 15:06
@codecov
Copy link

codecov bot commented May 13, 2020

Codecov Report

Merging #3803 into master will increase coverage by 0.00%.
The diff coverage is 85.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3803   +/-   ##
=======================================
  Coverage   75.50%   75.51%           
=======================================
  Files         608      608           
  Lines       15655    15660    +5     
  Branches     1762     1695   -67     
=======================================
+ Hits        11821    11825    +4     
- Misses       3469     3473    +4     
+ Partials      365      362    -3     
Flag Coverage Δ
#mobile 75.35% <85.71%> (+<0.01%) ⬆️
#web 75.71% <ø> (ø)
Impacted Files Coverage Δ
packages/mobile/src/backup/BackupPhrase.tsx 73.58% <33.33%> (-1.42%) ⬇️
packages/mobile/src/backup/DelayButton.tsx 88.46% <100.00%> (ø)
packages/mobile/src/components/CancelButton.v2.tsx 66.66% <100.00%> (ø)
packages/mobile/src/navigator/TopBarButton.v2.tsx 100.00% <100.00%> (ø)
packages/web/src/utils/utils.ts 79.31% <0.00%> (ø)
packages/web/src/dev/ValidatorsList.tsx 67.74% <0.00%> (ø)
packages/web/src/utils/abortableFetch.ts 71.42% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7a4ff0...884dd38. Read the comment docs.


const styles = StyleSheet.create({
container: {
paddingLeft: variables.contentPadding + 7,
Copy link
Member

Choose a reason for hiding this comment

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

im not sure about using these variables in new design. since everything is multiples of 8. the +7 worries me

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, setting up new variables may be nice.
But also, I find variables for things like padding to be unhelpful. How often will we say 'reduce padding across the app by 2'. Even if we did, unlikely that most things would line up right after the var change

Copy link
Contributor Author

@i1skn i1skn May 14, 2020

Choose a reason for hiding this comment

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

I've moved this logic to mobile package. Regarding the padding itself I've changed it to +6 (correlates with the design) to the standard padding we have.

Screenshot 2020-05-14 at 12 56 26

@@ -5,7 +5,7 @@ import TopBarButton from 'src/navigator/TopBarButton.v2'

describe('TopBarButton', () => {
it('displays children', () => {
const { queryByText } = render(<TopBarButton>label</TopBarButton>)
const { queryByText } = render(<TopBarButton title={'label'} />)
Copy link
Member

Choose a reason for hiding this comment

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

hmm I think we should avoid changing interfaces

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 it should be case-by-case. A title prop does make more sense to me than a child component

Copy link
Contributor

@jmrossy jmrossy left a comment

Choose a reason for hiding this comment

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

Mostly looks great!

packages/react-components/icons/BackChevron.v2.tsx Outdated Show resolved Hide resolved

const styles = StyleSheet.create({
container: {
paddingLeft: variables.contentPadding + 7,
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, setting up new variables may be nice.
But also, I find variables for things like padding to be unhelpful. How often will we say 'reduce padding across the app by 2'. Even if we did, unlikely that most things would line up right after the var change

packages/react-components/components/BackButton.v2.tsx Outdated Show resolved Hide resolved
@@ -5,7 +5,7 @@ import TopBarButton from 'src/navigator/TopBarButton.v2'

describe('TopBarButton', () => {
it('displays children', () => {
const { queryByText } = render(<TopBarButton>label</TopBarButton>)
const { queryByText } = render(<TopBarButton title={'label'} />)
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 it should be case-by-case. A title prop does make more sense to me than a child component

available
</Trans>
) : (
// TODO: a null balance doesn't necessarily mean it's loading
Copy link
Contributor

Choose a reason for hiding this comment

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

I find the possibility of null balance creates ugly conditionals all across the app and I wonder if we'd be better off just defaulting to 0. We'd lose a signal that says 'I don't know the balance' but it would simplify many places

Copy link
Contributor Author

@i1skn i1skn May 14, 2020

Choose a reason for hiding this comment

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

I think, this is a bit out of the scope of this PR. But I agree, we should come up with a convenient approach how we represent unknown balance.

@i1skn
Copy link
Contributor Author

i1skn commented May 14, 2020

@aaronmgdr I've reworked TopBarButton and split it into TopBarIconButton and TopBarTextButton. I know that you have an opened PR, which relies on it and I'm happy to wait until we merge your one first.

@i1skn i1skn force-pushed the i1skn/redesign-top-navigation branch from cdd45cc to a75d6d2 Compare May 14, 2020 12:50
@i1skn i1skn requested a review from a team May 14, 2020 16:08
@i1skn i1skn force-pushed the i1skn/redesign-top-navigation branch from 07a2c81 to 884dd38 Compare May 16, 2020 11:09
@i1skn i1skn merged commit d2de735 into master May 16, 2020
@i1skn i1skn deleted the i1skn/redesign-top-navigation branch May 16, 2020 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants