...
 
Commits (3)
......@@ -320,7 +320,10 @@
"postedIn":"posted in",
"channel":"channel",
"deleted":"This post was deleted",
"dontHave":"You don't have any notifications"
"dontHave":"You don't have any notifications",
"rewardsStateIncrease": "Congratulations! You just became a {{state}} user.\nWe've increased your daily token reward multiplier to {{multiplier}}x",
"rewardsStateDecrease": "We miss you! You just dropped down to a {{state}} user.\nYour daily token reward multiplier has been reduced to {{multiplier}}x",
"rewardsSummary": "You earned {{amount}} tokens yesterday."
},
"notificationSettings":{
"enableDisable":"Enable and disable push notifications",
......@@ -517,6 +520,7 @@
"estimatedReward":"Estimated Reward",
"yourShare":"Your Share",
"yourScore":"Your Score",
"yourRewardFactor": "Your Reward Multiplier",
"networkScore":"Network Score",
"transactionsTitle":"Transactions",
"transactionsDescription":"A list of transactions you have made with your addresses",
......
......@@ -47,6 +47,9 @@ import ReportActionedView from './view/ReportActionedView';
import MessengerInviteView from './view/MessengerInviteView';
import styles from './style';
import RewardsStateIncreaseView from "./view/RewardsStateIncreaseView";
import RewardsStateDecreaseView from "./view/RewardsStateDecreaseView";
import RewardsSummaryView from "./view/RewardsSummaryView";
/**
* Main Notification row Component
......@@ -193,6 +196,14 @@ export default class Notification extends Component {
case "report_actioned":
return <ReportActionedView entity={entity} navigation={this.props.navigation} styles={styles} />
case "rewards_state_increase":
return <RewardsStateIncreaseView navigation={this.props.navigation} styles={styles} state={entity.params.state} multiplier={entity.params.reward_factor}/>
case "rewards_state_decrease":
return <RewardsStateDecreaseView navigation={this.props.navigation} styles={styles} state={entity.params.state} multiplier={entity.params.reward_factor}/>
case "rewards_summary":
return <RewardsSummaryView navigation={this.props.navigation} styles={styles} amount={entity.params.amount}/>
default:
return (
......@@ -203,4 +214,4 @@ export default class Notification extends Component {
}
}
}
\ No newline at end of file
}
import React, {
Component
} from 'react';
import {
Text,
View
} from 'react-native';
import i18n from "../../../common/services/i18n.service";
/**
* Custom Message Notification Component
*/
export default class RewardsStateDecreaseView extends Component {
navToWallet = () => {
this.props.navigation.push('Wallet');
}
render() {
const styles = this.props.styles;
return (
<View style={styles.bodyContents}>
<Text onPress={this.navToWallet}>{i18n.t('notification.rewardsStateDecrease', {state: this.props.state, 'multiplier': this.props.multiplier})}</Text>
</View>
)
}
}
import React, {
Component
} from 'react';
import {
Text,
View
} from 'react-native';
import i18n from "../../../common/services/i18n.service";
/**
* Custom Message Notification Component
*/
export default class RewardsStateIncreaseView extends Component {
navToWallet = () => {
this.props.navigation.push('Wallet');
}
render() {
const styles = this.props.styles;
return (
<View style={styles.bodyContents}>
<Text onPress={this.navToWallet}>{i18n.t('notification.rewardsStateIncrease', {state: this.props.state, 'multiplier': this.props.multiplier})}</Text>
</View>
)
}
}
import React, {
Component
} from 'react';
import {
Text,
View
} from 'react-native';
import i18n from "../../../common/services/i18n.service";
/**
* Custom Message Notification Component
*/
export default class RewardsSummaryView extends Component {
navToWallet = () => {
this.props.navigation.push('Wallet');
}
render() {
const styles = this.props.styles;
return (
<View style={styles.bodyContents}>
<Text onPress={this.navToWallet}>{i18n.t('notification.rewardsSummary', {amount: this.props.amount})}</Text>
</View>
)
}
}
......@@ -21,7 +21,6 @@ export default class WalletOverviewView extends Component {
}
render() {
const duration = moment.duration(this.props.wallet.overview.nextPayout, 'seconds');
const timer = moment.utc(duration.as('milliseconds')).format('HH:mm:ss')
return (
......@@ -48,8 +47,13 @@ export default class WalletOverviewView extends Component {
</View>
<View style={ styles.cell }>
<Text style={ styles.titles }>{i18n.t('wallet.networkScore')}</Text>
<Text style={ styles.amount }>{ number(this.props.wallet.overview.totalNetworkContribution || 0) }</Text>
<Text style={ styles.titles }>{i18n.t('wallet.networkScore')}</Text>
<Text style={ styles.amount }>{ number(this.props.wallet.overview.totalNetworkContribution || 0) }</Text>
</View>
<View style={ styles.cell }>
<Text style={ styles.titles }>{i18n.t('wallet.yourRewardFactor')}</Text>
<Text style={ styles.amount }>{ number(this.props.wallet.overview.yourRewardFactor || 1, 0, 1) }x</Text>
</View>
<View style={ styles.cell }>
......
import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import {default as WalletOverviewIcon, Icons} from './icon/WalletOverviewIcon';
import {inject} from "mobx-react";
import {observer} from "mobx-react/native";
@inject('wallet')
@observer
export default class WalletScoresView extends Component {
/* componentDidMount() {
this.props.wallet.refresh();
}*/
export default class WalletOverviewView extends Component {
render() {
return (
<View style={styles.container}>
<WalletOverviewIcon
icon={Icons.votes}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.comments}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.subscribers}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.reminds}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.referrals}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.onchain_transactions}
/>
<WalletOverviewIcon
icon={Icons.checkins}
overview={this.props.wallet.overview}
/>
<WalletOverviewIcon
icon={Icons.development}
......
......@@ -107,7 +107,18 @@ class WalletStore {
this.addresses = [];
this.refreshing = false;
this.loaded = false;
// Onboarding
this.overview = {
contributionValues: {
comments: 2,
reminds: 4,
votes: 1,
subscribers: 4,
referrals: 50,
referrals_welcome: 50,
checkin: 2,
jury_duty: 25
}
};
this.onboardingShown = false;
this.ledger = new TokensStore();
storageService.removeItem('walletOnboardingComplete');
......
......@@ -5,32 +5,38 @@ import {StyleSheet, Text, View, Image} from 'react-native';
import {CommonStyle} from '../../styles/Common';
import FastImage from 'react-native-fast-image';
import {observer} from "mobx-react/native";
export const Icons = {
'votes': {
'asset': require('../../assets/contributions/votes.png'),
'title': 'Votes',
'score': '+1'
'score': '+1',
'overview': 'votes'
},
'comments': {
'asset': require('../../assets/contributions/comments.png'),
'title': 'Comments',
'score': '+2'
'score': '+2',
'overview': 'comments'
},
'subscribers': {
'asset': require('../../assets/contributions/subscribers.png'),
'title': 'Subscribers',
'score': '+4'
'score': '+4',
'overview': 'subscribers'
},
'reminds': {
'asset': require('../../assets/contributions/reminds.png'),
'title': 'Reminds',
'score': '+4'
'score': '+4',
'overview': 'reminds'
},
'referrals': {
'asset': require('../../assets/contributions/referrals.png'),
'title': 'Referrals',
'score': '+10'
'score': '+10',
'overview': 'referrals'
},
'onchain_transactions': {
'asset': require('../../assets/contributions/onchain-transactions.png'),
......@@ -40,7 +46,8 @@ export const Icons = {
'checkins': {
'asset': require('../../assets/contributions/checkins.png'),
'title': 'Check-ins',
'score': '+2'
'score': '+2',
'overview': 'checkin'
},
'development': {
'asset': require('../../assets/contributions/code.png'),
......@@ -51,6 +58,7 @@ export const Icons = {
/**
* Custom Button component
*/
@observer
export default class WalletOverviewIcon extends Component {
/**
......@@ -61,7 +69,9 @@ export default class WalletOverviewIcon extends Component {
asset: '',
title: '',
score: '',
}
overview: ''
},
overview: {}
};
/**
......@@ -75,6 +85,9 @@ export default class WalletOverviewIcon extends Component {
* Render
*/
render() {
if (typeof this.props.overview.contributionValues !== 'undefined') {
this.props.icon.score = '+' + this.props.overview.contributionValues[this.props.icon.overview];
}
const {icon} = this.props;
return (
......@@ -122,4 +135,4 @@ const styles = StyleSheet.create({
color: '#4CAF50',
fontWeight: '600',
}
});
\ No newline at end of file
});