Merge branch 'master' of github.com:esteemapp/esteem-mobile into feature/reblog-screen

This commit is contained in:
Mustafa Buyukcelebi 2019-08-12 18:29:30 +03:00
commit b4de12ecb6
84 changed files with 574 additions and 106 deletions

View File

@ -18,19 +18,34 @@ const UserListItem = ({
handleOnLongPress,
isClickable,
text,
middleText,
rightTextStyle,
}) => (
<TouchableOpacity
onLongPress={() => handleOnLongPress && handleOnLongPress()}
disabled={!isClickable}
onPress={() => handleOnPress && handleOnPress()}
>
<View style={[styles.voteItemWrapper, index % 2 !== 0 && styles.voteItemWrapperGray]}>
<View style={[styles.voteItemWrapper, index % 2 === 0 && styles.voteItemWrapperGray]}>
{itemIndex && <Text style={styles.itemIndex}>{itemIndex}</Text>}
<UserAvatar noAction={userCanPress} style={styles.avatar} username={username} />
<View style={styles.userDescription}>
<Text style={styles.name}>{text || username}</Text>
{description && <Text style={styles.date}>{description}</Text>}
</View>
{middleText && (
<View style={styles.middleWrapper}>
<Text
style={[
styles.value,
isRightColor && styles.valueGray,
isBlackRightColor && styles.valueBlack,
]}
>
{middleText}
</Text>
</View>
)}
{isHasRightItem && (
<View style={styles.rightWrapper}>
<Text
@ -38,6 +53,7 @@ const UserListItem = ({
styles.value,
isRightColor && styles.valueGray,
isBlackRightColor && styles.valueBlack,
rightTextStyle,
]}
>
{rightText}

View File

@ -47,6 +47,7 @@ export default EStyleSheet.create({
rightWrapper: {
textAlign: 'center',
alignItems: 'center',
width: 80,
},
text: {
color: '$iconColor',
@ -68,4 +69,7 @@ export default EStyleSheet.create({
fontSize: 10,
marginRight: 17,
},
middleWrapper: {
marginRight: 30,
},
});

View File

@ -48,7 +48,7 @@ class LeaderboardContainer extends PureComponent {
});
};
_fetchLeaderBoard = async () => {
_fetchLeaderBoard = async selectedFilter => {
const { intl, isConnected } = this.props;
let users;
@ -57,7 +57,7 @@ class LeaderboardContainer extends PureComponent {
this.setState({ refreshing: true });
try {
users = await getLeaderboard();
users = await getLeaderboard(selectedFilter);
} catch (error) {
Alert.alert(
intl.formatMessage({ id: 'alert.error' }),

View File

@ -5,12 +5,29 @@ export default EStyleSheet.create({
flex: 1,
padding: 8,
},
text: {
title: {
color: '$primaryDarkGray',
fontSize: 14,
fontWeight: 'bold',
marginLeft: 20,
fontFamily: '$primaryFont',
paddingBottom: 10,
flexGrow: 1,
},
rewardText: {
color: '$primaryBlue',
},
columnTitleWrapper: {
flexDirection: 'row',
marginTop: 10,
justifyContent: 'flex-end',
},
columnTitle: {
color: '$primaryDarkGray',
fontSize: 12,
fontWeight: 'bold',
marginRight: 40,
marginBottom: 10,
fontFamily: '$primaryFont',
},
});

View File

@ -1,11 +1,12 @@
import React, { PureComponent } from 'react';
import React, { PureComponent, Fragment } from 'react';
import { View, FlatList, Text } from 'react-native';
import { injectIntl } from 'react-intl';
import get from 'lodash/get';
// Components
import { UserListItem, ListPlaceHolder } from '../../basicUIElements';
import { FilterBar } from '../../filterBar';
import FILTER_OPTIONS, { VALUE } from '../../../constants/options/leaderboard';
// Styles
import styles from './leaderboardStyles';
@ -28,9 +29,11 @@ class LeaderboardView extends PureComponent {
isHasRightItem
isClickable
isBlackRightColor
rightText={get(item, 'count')}
rightText={get(item, 'points')}
middleText={get(item, 'count')}
itemIndex={index + 1}
handleOnPress={() => handleOnUserPress(get(item, '_id'))}
rightTextStyle={styles.rewardText}
/>
);
};
@ -39,22 +42,37 @@ class LeaderboardView extends PureComponent {
const { users, intl, fetchLeaderBoard, refreshing } = this.props;
return (
<View style={styles.container}>
<Text style={styles.text}>
{intl.formatMessage({
id: 'notification.leaderboard_title',
})}
</Text>
<FlatList
data={users}
refreshing={refreshing}
keyExtractor={item => get(item, '_id', Math.random()).toString()}
removeClippedSubviews={false}
ListEmptyComponent={<ListPlaceHolder />}
onRefresh={() => fetchLeaderBoard()}
renderItem={({ item, index }) => this._renderItem(item, index)}
<Fragment>
<FilterBar
dropdownIconName="arrow-drop-down"
options={VALUE.map(val => intl.formatMessage({ id: `leaderboard.${val}` }))}
selectedOptionIndex={0}
defaultText={intl.formatMessage({ id: `leaderboard.${VALUE[0]}` })}
onDropdownSelect={selectedIndex => fetchLeaderBoard(FILTER_OPTIONS[selectedIndex])}
/>
</View>
<View style={styles.container}>
<View style={styles.columnTitleWrapper}>
<Text style={styles.title}>
{intl.formatMessage({
id: 'notification.leaderboard_title',
})}
</Text>
<Text style={[styles.columnTitle]}>Activities</Text>
<Text style={[styles.columnTitle]}>Reward</Text>
</View>
<FlatList
data={users}
refreshing={refreshing}
keyExtractor={item => get(item, '_id', Math.random()).toString()}
removeClippedSubviews={false}
ListEmptyComponent={<ListPlaceHolder />}
onRefresh={() => fetchLeaderBoard()}
renderItem={({ item, index }) => this._renderItem(item, index)}
/>
</View>
</Fragment>
);
}
}

View File

@ -24,13 +24,18 @@
"notification": "Bithé",
"leaderboard": "Papeun Rangking",
"epoint": "Points",
"leaderboard_title": "Ureung Palèng Lè pakek",
"leaderboard_title": "Top Users",
"recent": "Ataban nyoë",
"yesterday": "Baroë",
"this_week": "Peukan Nyoë",
"this_month": "Buleuën Nyoë",
"older_then": "Leubéh Lam Sibulëun"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "الإشعارات",
"leaderboard": "المتصدرين",
"epoint": "نقاط",
"leaderboard_title": "أفضل مستخدم يومي",
"leaderboard_title": "Top Users",
"recent": "الأخيرة",
"yesterday": "يوم أمس",
"this_week": "هذا الأسبوع",
"this_month": "هذا الشهر",
"older_then": "أقدم من شهر"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "منشور",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Bildirişlər",
"leaderboard": "Liderlər cədvəli",
"epoint": "Xallar",
"leaderboard_title": "Günlük Liderlər",
"leaderboard_title": "Top Users",
"recent": "Təzəlikcə",
"yesterday": "Dünən",
"this_week": "Bu Həftə",
"this_month": "Bu Ay",
"older_then": "Bir Aydan Köhnə"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Göndəriş",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Benachrichtigungen",
"leaderboard": "Rangliste",
"epoint": "eSteem Punkte",
"leaderboard_title": "Tägliche Top-User",
"leaderboard_title": "Top Users",
"recent": "Vor kurzem",
"yesterday": "Gestern",
"this_week": "Diese Woche",
"this_month": "Diesen Monat",
"older_then": "Älter als ein Monat"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Beitrag",
"esteemPoints": "eSteem Punkte",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notificaciones",
"leaderboard": "Tabla de posiciones",
"epoint": "Points",
"leaderboard_title": "Mejor usuario diario",
"leaderboard_title": "Top Users",
"recent": "Reciente",
"yesterday": "Ayer",
"this_week": "Esta semana",
"this_month": "Este mes",
"older_then": "Más de un mes"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Teavitused",
"leaderboard": "Edetabel",
"epoint": "Punktid",
"leaderboard_title": "Päeva Parim Kasutaja",
"leaderboard_title": "Top Users",
"recent": "Hiljutised",
"yesterday": "Eile",
"this_week": "See Nädal",
"this_month": "See Kuu",
"older_then": "Vanem Kui Kuu"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Postitus",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "اطلاعیه ها",
"leaderboard": "جدول رده بندی",
"epoint": "امتیازها",
"leaderboard_title": "بهترین کاربران روز",
"leaderboard_title": "Top Users",
"recent": "اخیر",
"yesterday": "دیروز",
"this_week": "این هفته",
"this_month": "این ماه",
"older_then": "قدیمی تر از 1 ماه"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "پست",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Viimeisimmät",
"yesterday": "Eilen",
"this_week": "Tällä viikolla",
"this_month": "Tässä kuussa",
"older_then": "Kuukautta vanhempi"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Classement",
"epoint": "Points",
"leaderboard_title": "Top des utilisateurs du jour",
"leaderboard_title": "Top Users",
"recent": "Récent",
"yesterday": "Hier",
"this_week": "Cette semaine",
"this_month": "Ce mois",
"older_then": "Vieux de plus de 1 mois"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Stika",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Aftumist",
"yesterday": "Fairnindag",
"this_week": "So dagawiko",
"this_month": "So menoþs",
"older_then": "Fairnizo þau Aina Menoþ"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Waurd",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "התראות",
"leaderboard": "לוח תוצאות",
"epoint": "נקודות",
"leaderboard_title": "המשתמשים המובילים היום",
"leaderboard_title": "Top Users",
"recent": "לאחרונה",
"yesterday": "אתמול",
"this_week": "השבוע",
"this_month": "החודש הזה",
"older_then": "ישן יותר מחודש"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "פוסט",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "अधिसूचनाएं",
"leaderboard": "अधिनायकपटल",
"epoint": "अंक",
"leaderboard_title": "प्रत्येक दिन का सर्वोच्च प्रयोगकर्ता",
"leaderboard_title": "Top Users",
"recent": "ताजा",
"yesterday": "बीता कल",
"this_week": "इस सप्ताह",
"this_month": "इस महीने",
"older_then": "एक महीना से अधिक पुराना"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "लेख",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Obavijesti",
"leaderboard": "Rang lista",
"epoint": "Points",
"leaderboard_title": "Dnevni top korisnik",
"leaderboard_title": "Top Users",
"recent": "Nedavno",
"yesterday": "Jučer",
"this_week": "Ovog Tjedna",
"this_month": "Ovaj Mjesec",
"older_then": "Starije od mjesec dana"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Értesítések",
"leaderboard": "Ranglista",
"epoint": "Pontok",
"leaderboard_title": "Napi Top Felhasználók",
"leaderboard_title": "Top Users",
"recent": "Friss",
"yesterday": "Tegnap",
"this_week": "Ezen a héten",
"this_month": "Ebben a hónapban",
"older_then": "Egy Hónapnál Régebbi"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Bejegyzés",
"esteemPoints": "eSteem Pontok",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Pemberitahuan",
"leaderboard": "Papan Peringkat",
"epoint": "Poin",
"leaderboard_title": "Pengguna harian paling atas",
"leaderboard_title": "Top Users",
"recent": "Baru digunakan",
"yesterday": "Kemarin",
"this_week": "Minggu ini",
"this_month": "Bulan ini",
"older_then": "Lebih Lama Dari Sebulan"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Kiriman",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifiche",
"leaderboard": "Classifica",
"epoint": "Points",
"leaderboard_title": "Top Utenti Giornalieri",
"leaderboard_title": "Top Users",
"recent": "Recenti",
"yesterday": "Ieri",
"this_week": "Questa settimana",
"this_month": "Questo Mese",
"older_then": "Più Di Un Mese Fa"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "알림",
"leaderboard": "순위표",
"epoint": "포인트",
"leaderboard_title": "일별 상위 사용자",
"leaderboard_title": "Top Users",
"recent": "최근",
"yesterday": "어제",
"this_week": "이번 주",
"this_month": "이번 달",
"older_then": "1 달 이상"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "포스팅",
"esteemPoints": "eSteem 포인트",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Pranešimai",
"leaderboard": "Lyderiai",
"epoint": "Taškai",
"leaderboard_title": "Dienos Top Vartotojas",
"leaderboard_title": "Top Users",
"recent": "Naujausi",
"yesterday": "Vakar",
"this_week": "Šią savaitę",
"this_month": "Šį mėnesį",
"older_then": "Senesni nei vieno mėnesio"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Įrašas",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Pemberitahuan",
"leaderboard": "Papan Pendahulu",
"epoint": "Mata ganjaran",
"leaderboard_title": "Pengguna tertinggi harian",
"leaderboard_title": "Top Users",
"recent": "Terbaru",
"yesterday": "Semalam",
"this_week": "Minggu ini",
"this_month": "Bulan Ini",
"older_then": "Lebih dari sebulan"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Hantar",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notificaties",
"leaderboard": "Scorebord",
"epoint": "Points",
"leaderboard_title": "Dagelijkse Topgebruiker",
"leaderboard_title": "Top Users",
"recent": "Recent(e)",
"yesterday": "Gisteren",
"this_week": "Deze week",
"this_month": "Deze maand",
"older_then": "Ouder dan een maand"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Alerts",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "People Wey Dey Top Today",
"leaderboard_title": "Top Users",
"recent": "Latest",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "E don pass one month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Tori",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notificações",
"leaderboard": "Quadro de Liderança",
"epoint": "Pontos",
"leaderboard_title": "Usuário do Topo Hoje",
"leaderboard_title": "Top Users",
"recent": "Recente",
"yesterday": "Ontem",
"this_week": "Esta Semana",
"this_month": "Este Mês",
"older_then": "Com mais de um mês"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Publicar",
"esteemPoints": "eSteem Pontos",

View File

@ -24,13 +24,18 @@
"notification": "Notificări",
"leaderboard": "Clasament",
"epoint": "Puncte",
"leaderboard_title": "Utilizatori de Top Zilnic",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Ieri",
"this_week": "Săptămâna aceasta",
"this_month": "Luna Aceasta",
"older_then": "Mai vechi de o lună"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Postare",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Уведомления",
"leaderboard": "Лидеры",
"epoint": "Баллы",
"leaderboard_title": "Доска Лидерства",
"leaderboard_title": "Top Users",
"recent": "Недавно",
"yesterday": "Вчера",
"this_week": "На неделе",
"this_month": "В этом месяце",
"older_then": "Давно"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Пост",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Obaveštenja",
"leaderboard": "Rang lista",
"epoint": "Points",
"leaderboard_title": "Najbolji korisnici na dnevnom nivou",
"leaderboard_title": "Top Users",
"recent": "Nedavno",
"yesterday": "Juče",
"this_week": "Ove nedelje",
"this_month": "Ovaj mesec",
"older_then": "Stariji od mesec dana"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "This Week"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Bildirimler",
"leaderboard": "Liderler Tablosu",
"epoint": "Puanlar",
"leaderboard_title": "Günlük lider kullanıcılar",
"leaderboard_title": "Top Users",
"recent": "Geçen",
"yesterday": "Dün",
"this_week": "Bu Hafta",
"this_month": "Bu Ay",
"older_then": "Bir Aydan Daha Önce"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Gönderi",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Notifications",
"leaderboard": "Leaderboard",
"epoint": "Points",
"leaderboard_title": "Daily Top User",
"leaderboard_title": "Top Users",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "Thông báo",
"leaderboard": "Bảng xếp hạng",
"epoint": "Các điểm thưởng",
"leaderboard_title": "Người dùng tiêu biểu hàng ngày",
"leaderboard_title": "Top Users",
"recent": "Gần đây",
"yesterday": "Hôm qua",
"this_week": "Tuần này",
"this_month": "Tháng này",
"older_then": "Cách đây hơn 1 tháng"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Bài đăng",
"esteemPoints": "các Điểm eSteem",

View File

@ -24,13 +24,18 @@
"notification": "Awon Akiyesi",
"leaderboard": "Ate asiwaju",
"epoint": "Points",
"leaderboard_title": "Olori ojumo",
"leaderboard_title": "Top Users",
"recent": "Ai pe",
"yesterday": "Ana",
"this_week": "Ose yi",
"this_month": "Osu yi",
"older_then": "Ti koja osu kan"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "通知",
"leaderboard": "排行榜",
"epoint": "Points",
"leaderboard_title": "每日最高排名用户",
"leaderboard_title": "Top Users",
"recent": "最近",
"yesterday": "昨天",
"this_week": "本周",
"this_month": "本月",
"older_then": "一个月前"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -24,13 +24,18 @@
"notification": "通知",
"leaderboard": "排行榜",
"epoint": "Points",
"leaderboard_title": "每日最高排名用戶",
"leaderboard_title": "Top Users",
"recent": "最新",
"yesterday": "昨天",
"this_week": "本週",
"this_month": "本月",
"older_then": "一個月前"
},
"leaderboard": {
"daily": "Daily",
"weekly": "Weekly",
"monthly": "Monthly"
},
"points": {
"post": "Post",
"esteemPoints": "eSteem Points",

View File

@ -0,0 +1,3 @@
export default ['day', 'week', 'month'];
export const VALUE = ['daily', 'weekly', 'monthly'];

View File

@ -19,6 +19,7 @@ export const getDrafts = data =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -35,6 +36,7 @@ export const removeDraft = (username, id) =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -54,6 +56,7 @@ export const addDraft = data =>
resolve(drafts.pop());
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -76,6 +79,7 @@ export const updateDraft = data =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -132,7 +136,15 @@ export const addFavorite = (currentUsername, targetUsername) =>
export const removeFavorite = (currentUsername, targetUsername) =>
api.delete(`/favoriteUser/${currentUsername}/${targetUsername}`);
export const getLeaderboard = () => api.get('/leaderboard').then(resp => resp.data);
export const getLeaderboard = duration =>
api
.get('/leaderboard', { params: { duration } })
.then(resp => {
return resp.data;
})
.catch(error => {
bugsnag.notify(error);
});
export const getActivities = data =>
new Promise((resolve, reject) => {
@ -173,6 +185,7 @@ export const getActivities = data =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -185,6 +198,7 @@ export const getUnreadActivityCount = data =>
resolve(res.data ? res.data.count : 0);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -197,6 +211,7 @@ export const markActivityAsRead = (user, id = null) =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -209,6 +224,7 @@ export const setPushToken = data =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -223,6 +239,7 @@ export const search = data =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});
@ -237,6 +254,7 @@ export const searchPath = q =>
resolve(res.data);
})
.catch(error => {
bugsnag.notify(error);
reject(error);
});
});

View File

@ -6,6 +6,7 @@ import Push from 'appcenter-push';
import { Client } from 'dsteem';
import VersionNumber from 'react-native-version-number';
import Config from 'react-native-config';
import { injectIntl } from 'react-intl';
// Realm
import {
@ -62,6 +63,7 @@ class SettingsContainer extends Component {
this.state = {
serverList: [],
isNotificationMenuOpen: props.isNotificationSettingsOpen,
isLoading: false,
};
}
@ -108,18 +110,20 @@ class SettingsContainer extends Component {
const server = serverList[action];
let serverResp;
let isError = false;
let alertMessage;
const client = new Client(server, { timeout: 3000 });
dispatch(setApi(server));
this.setState({ isLoading: true });
try {
serverResp = await client.database.getDynamicGlobalProperties();
} catch (e) {
isError = true;
dispatch(toastNotification(intl.formatMessage({ id: 'alert.connection_fail' })));
alertMessage = 'alert.connection_fail';
} finally {
if (!isError)
dispatch(toastNotification(intl.formatMessage({ id: 'alert.connection_success' })));
if (!isError) alertMessage = 'alert.connection_success';
}
if (!isError) {
@ -128,7 +132,8 @@ class SettingsContainer extends Component {
const isAlive = localTime - serverTime < 15000;
if (!isAlive) {
dispatch(toastNotification(intl.formatMessage({ id: 'alert.server_fail' })));
alertMessage = 'settings.server_fail';
isError = true;
return;
@ -141,6 +146,9 @@ class SettingsContainer extends Component {
await setServer(server);
checkClient();
}
this.setState({ isLoading: false });
dispatch(toastNotification(intl.formatMessage({ id: alertMessage })));
};
_currencyChange = action => {
@ -341,7 +349,7 @@ class SettingsContainer extends Component {
};
render() {
const { serverList, isNotificationMenuOpen } = this.state;
const { serverList, isNotificationMenuOpen, isLoading } = this.state;
return (
<SettingsScreen
@ -349,6 +357,7 @@ class SettingsContainer extends Component {
handleOnChange={this._handleOnChange}
isNotificationMenuOpen={isNotificationMenuOpen}
handleOnButtonPress={this._handleButtonPress}
isLoading={isLoading}
{...this.props}
/>
);
@ -378,4 +387,4 @@ const mapStateToProps = state => ({
currentAccount: state.account.currentAccount,
});
export default connect(mapStateToProps)(SettingsContainer);
export default injectIntl(connect(mapStateToProps)(SettingsContainer));

View File

@ -1,5 +1,6 @@
/* eslint-disable react/jsx-wrap-multilines */
import React, { PureComponent, Fragment } from 'react';
import { ScrollView, View } from 'react-native';
import { ScrollView, View, RefreshControl } from 'react-native';
import { injectIntl } from 'react-intl';
// Utils
@ -31,7 +32,7 @@ class SettingsScreen extends PureComponent {
// Component Life Cycles
// Component Functions
// TODO: REFACTOR ME !
render() {
const {
handleOnChange,
@ -53,6 +54,7 @@ class SettingsScreen extends PureComponent {
transfersNotification,
voteNotification,
handleOnButtonPress,
isLoading,
} = this.props;
return (
@ -63,7 +65,18 @@ class SettingsScreen extends PureComponent {
})}
/>
<ScrollView style={styles.container}>
<ScrollView
style={styles.container}
refreshControl={
<RefreshControl
refreshing={isLoading}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
}
>
<View style={styles.settingsCard}>
<SettingsItem
title={intl.formatMessage({