-
Notifications
You must be signed in to change notification settings - Fork 4
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
Points History and Rewards tab bar styling + Rewards navigation animations #46
Changes from all commits
c967de1
0b46b1d
3ebf40f
810f535
6a9ccf2
4287a41
d3aaf1e
67bfd2d
96dd276
be8c4c4
65ec165
5ef6e6e
1cd0aec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { FontAwesome5 } from '@expo/vector-icons'; | ||
import React from 'react'; | ||
import { CircleIconContainer } from './BaseComponents'; | ||
|
||
export default class CircleIcon extends React.Component { | ||
render() { | ||
return ( | ||
<CircleIconContainer color={this.props.circleColor}> | ||
<FontAwesome5 | ||
name={this.props.icon} | ||
size={22} | ||
solid | ||
color={this.props.iconColor} | ||
style={{ paddingTop: 1 }} | ||
/> | ||
</CircleIconContainer> | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
import React from 'react'; | ||
import Colors from '../../assets/Colors'; | ||
import { | ||
RewardsCardContainer, | ||
RewardDescriptionContainer, | ||
StarIcon | ||
RewardsCardContainer | ||
} from '../../styled/rewards'; | ||
import { Subhead, Caption } from '../BaseComponents'; | ||
import { FontAwesome5 } from '@expo/vector-icons'; | ||
import Colors from '../../assets/Colors'; | ||
import { Caption, Subhead } from '../BaseComponents'; | ||
import CircleIcon from '../CircleIcon'; | ||
|
||
class RewardsCard extends React.Component { | ||
render() { | ||
return ( | ||
<RewardsCardContainer> | ||
<StarIcon> | ||
<FontAwesome5 | ||
name="star" | ||
solid | ||
size={24} | ||
color={Colors.primaryGreen} | ||
/> | ||
</StarIcon> | ||
<CircleIcon | ||
icon="star" | ||
iconColor={Colors.primaryGreen} | ||
circleColor={Colors.lightest} | ||
/> | ||
Comment on lines
+14
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ty for the fix here, it was so jank before LOL |
||
<RewardDescriptionContainer> | ||
<Subhead color={Colors.darkerGreen}>$5 Reward</Subhead> | ||
<Caption color={Colors.darkerGreen}>1000 points</Caption> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from 'react'; | ||
import { View, ScrollView } from 'react-native'; | ||
import { Body, Overline, Title } from '../BaseComponents'; | ||
import { ScrollView } from 'react-native'; | ||
import { ProgressBar } from 'react-native-paper'; | ||
import Colors from '../../assets/Colors'; | ||
import { | ||
RewardsProgressContainer, | ||
AvailiableRewardsContainer | ||
AvailableRewardsContainer, | ||
RewardsProgressContainer | ||
} from '../../styled/rewards'; | ||
import { ProgressBar } from 'react-native-paper'; | ||
import { Body, Overline, Title } from '../BaseComponents'; | ||
import RewardsCard from './RewardsCard'; | ||
import Colors from '../../assets/Colors'; | ||
|
||
/** | ||
* @prop | ||
|
@@ -23,35 +23,38 @@ function createList(N) { | |
|
||
function RewardsHome({ user }) { | ||
return ( | ||
<View> | ||
<ScrollView> | ||
<RewardsProgressContainer> | ||
<Overline style={{ marginTop: 24, marginBottom: 15 }}> | ||
REWARD PROGRESS | ||
</Overline> | ||
<Title style={{ marginBottom: 2 }}> | ||
{parseInt(user.points) % 1000} / 1000 | ||
</Title> | ||
<ProgressBar | ||
style={{ height: 20, borderRadius: 20, marginBottom: 15 }} | ||
progress={(parseInt(user.points) % 1000) / 1000} | ||
color={Colors.primaryGreen} | ||
/> | ||
<Body style={{ marginBottom: 28 }}> | ||
Earn {`${1000 - (parseInt(user.points) % 1000)}`} points to unlock | ||
your next $5 reward | ||
</Body> | ||
<Overline style={{ marginBottom: 8 }}> | ||
AVAILIABLE REWARDS ({Math.floor(parseInt(user.points) / 1000)}) | ||
</Overline> | ||
</RewardsProgressContainer> | ||
<AvailiableRewardsContainer> | ||
{createList(Math.floor(parseInt(user.points) / 1000)).map(a => ( | ||
<RewardsCard></RewardsCard> | ||
))} | ||
</AvailiableRewardsContainer> | ||
</ScrollView> | ||
</View> | ||
<ScrollView style={{ marginLeft: 16, paddingRight: 16 }}> | ||
<RewardsProgressContainer> | ||
<Overline style={{ marginTop: 24, marginBottom: 12 }}> | ||
Reward Progress | ||
</Overline> | ||
<Title style={{ marginBottom: 2 }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Figma has the first number in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Kenneth and I agreed on abandoning that when the alignment of 2 different line heights was getting really annoying 😶 |
||
{parseInt(user.points) % 1000} / 1000 | ||
</Title> | ||
<ProgressBar | ||
style={{ | ||
height: 20, | ||
width: '100%', | ||
borderRadius: 20, | ||
marginBottom: 15 | ||
}} | ||
progress={(parseInt(user.points) % 1000) / 1000} | ||
color={Colors.primaryGreen} | ||
/> | ||
<Body style={{ marginBottom: 28 }}> | ||
Earn {`${1000 - (parseInt(user.points) % 1000)}`} points to unlock | ||
your next $5 reward | ||
</Body> | ||
<Overline style={{ marginBottom: 8 }}> | ||
Available Rewards ({Math.floor(parseInt(user.points) / 1000)}) | ||
</Overline> | ||
</RewardsProgressContainer> | ||
<AvailableRewardsContainer> | ||
{createList(Math.floor(parseInt(user.points) / 1000)).map(a => ( | ||
<RewardsCard></RewardsCard> | ||
))} | ||
</AvailableRewardsContainer> | ||
</ScrollView> | ||
); | ||
} | ||
|
||
|
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.
style thing? i think a lot of our other stuff has the icon vertically centered so maybe we should change this to match that, but @12aschen should chime in
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.
Not sure what you mean—vertically centered to what? Lines 29 & 30 should make it centered.