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

Implement Reusable Components within Rewards #30

Merged
merged 2 commits into from
Mar 9, 2020

Conversation

kennethlien
Copy link
Contributor

@kennethlien kennethlien commented Feb 27, 2020

What's new in this PR

Implementing reusable components in RewardsScreen, RewardsHome, and PointsHistory

Relevant Links

Related PRs

Using components from Thu's PR, https://github.com/calblueprint/dccentralkitchen/pull/28/files, to make Rewards cleaner.

How to review

The order in which to review files and what to expect when testing locally

Next steps

Lots of components could not be replaced because they only existed in rewards.js, so a possible next step would be to bring those over to BaseComponents.

Tests Performed, Edge Cases

Tested on Expo, things looked alright.

CC: @anniero98 @tommypoa

{' '}
{`${1000 -
(parseInt(user.points) % 1000)} points to your next reward`}
</Text>
</Body>
</View>

<View style={styles.tabBarInfoContainer}>
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this PR task but this is all deprecated leftover from old versions of these designs. We can take all of this out.

Copy link
Member

Choose a reason for hiding this comment

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

Migrate styles into a separate stylesheet

{/* Points history */}
<View>
<ScrollView style={{ marginTop: 50 }}>
<Text style={{ textAlign: 'center' }}> Recent Transactions</Text>
<Caption style={{ textAlign: 'center' }}>
Copy link
Member

Choose a reason for hiding this comment

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

This should be an Overline, left-aligned.

Copy link
Contributor

Choose a reason for hiding this comment

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

In our effort to reduce in-line styling, you could create a container to align things to the left! Especially since all other captions (according to the Figma) should be left-aligned as well. This could done as another ticket too

@@ -1,5 +1,6 @@
import React from 'react';
import { Button, ScrollView, StyleSheet, Text, View } from 'react-native';
import { Body, Title, Caption } from '../BaseComponents';
Copy link
Member

Choose a reason for hiding this comment

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

Only import whichever components are actually used, so remove Body and Title.

@@ -48,7 +53,10 @@ function PointsHistory({ transactions, user, updates, navigation }) {
storeName={transaction.storeName}
/>
))}
<Text style={{ textAlign: 'center' }}> Complete History </Text>
<Caption style={{ textAlign: 'center' }}>
Copy link
Member

Choose a reason for hiding this comment

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

This does not exist in the designs so we can take this out.

@tommypoa
Copy link
Contributor

tommypoa commented Mar 4, 2020

Apart from the parts that should be corrected to align with the Figma (see @wangannie's requests), what you did is generally what was outlined in your sprint task. Nice job!

Copy link
Member

@wangannie wangannie left a comment

Choose a reason for hiding this comment

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

Looks good! I see that you've addressed most of the issues in your most recent progress bar PR, so we can go ahead with this.

{' '}
Complete History{' '}
</Caption>
<Overline>Recent TraNsAcTiOnS</Overline>
Copy link
Member

Choose a reason for hiding this comment

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

😆
but please don't do this..

@wangannie wangannie merged commit fd8b974 into master Mar 9, 2020
@wangannie wangannie deleted the kenneth/points_history branch March 17, 2020 14:49
@wangannie wangannie restored the kenneth/points_history branch March 17, 2020 14:49
@wangannie wangannie deleted the kenneth/points_history branch March 24, 2020 22:26
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