mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
enhanced a bit fixed keys removed packages
This commit is contained in:
parent
22d901aee9
commit
ec23d1765c
@ -22,8 +22,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"@esteemapp/react-native-scrollable-tab-view": "^0.8.2",
|
||||
"@esteemapp/react-native-tags": "^1.3.1",
|
||||
"appcenter": "^1.10.0",
|
||||
"appcenter-analytics": "^1.10.0",
|
||||
"appcenter-crashes": "^1.10.0",
|
||||
@ -55,7 +53,7 @@
|
||||
"react-native-markdown-renderer": "^3.2.8",
|
||||
"react-native-modal-dropdown": "^0.6.2",
|
||||
"react-native-modal-popover": "0.0.12",
|
||||
"react-native-restart": "0.0.6",
|
||||
"react-native-scrollable-tab-view": "^0.10.0",
|
||||
"react-native-sentry": "^0.42.0",
|
||||
"react-native-slider": "^0.11.0",
|
||||
"react-native-vector-icons": "^6.0.2",
|
||||
|
@ -48,7 +48,7 @@ class LeaderboardView extends PureComponent {
|
||||
<FlatList
|
||||
data={users}
|
||||
refreshing={refreshing}
|
||||
keyExtractor={item => item.voter}
|
||||
keyExtractor={item => item._id}
|
||||
removeClippedSubviews={false}
|
||||
onRefresh={() => fetchLeaderBoard()}
|
||||
renderItem={({ item, index }) => this._renderItem(item, index)}
|
||||
|
@ -31,7 +31,7 @@ class PointsContainer extends Component {
|
||||
componentDidMount() {
|
||||
this._fetchuserPointActivities();
|
||||
|
||||
this.fetchInterval = setInterval(this._fetchuserPointActivities, 360000);
|
||||
this.fetchInterval = setInterval(this._fetchuserPointActivities, 6 * 60 * 1000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -1,9 +1,15 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import {
|
||||
Text, View, FlatList, ScrollView, RefreshControl, TouchableOpacity,
|
||||
Text,
|
||||
View,
|
||||
FlatList,
|
||||
ScrollView,
|
||||
RefreshControl,
|
||||
TouchableOpacity,
|
||||
} from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { Popover, PopoverController } from 'react-native-modal-popover';
|
||||
import { get, size } from 'lodash';
|
||||
|
||||
// Components
|
||||
import { LineBreak, WalletLineItem } from '../../basicUIElements';
|
||||
@ -22,153 +28,166 @@ import styles from './pointsStyles';
|
||||
|
||||
class PointsView extends Component {
|
||||
/* Props
|
||||
* ------------------------------------------------
|
||||
* @prop { type } name - Description....
|
||||
*/
|
||||
* ------------------------------------------------
|
||||
* @prop { type } name - Description....
|
||||
*/
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
|
||||
// Component Functions
|
||||
|
||||
refreshControl = () => {
|
||||
const { fetchUserActivity, refreshing, isDarkTheme } = this.props;
|
||||
refreshControl = () => {
|
||||
const { fetchUserActivity, refreshing, isDarkTheme } = this.props;
|
||||
|
||||
return (
|
||||
<RefreshControl
|
||||
refreshing={refreshing}
|
||||
onRefresh={fetchUserActivity}
|
||||
progressBackgroundColor="#357CE6"
|
||||
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
|
||||
titleColor="#fff"
|
||||
colors={['#fff']}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<RefreshControl
|
||||
refreshing={refreshing}
|
||||
onRefresh={fetchUserActivity}
|
||||
progressBackgroundColor="#357CE6"
|
||||
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
|
||||
titleColor="#fff"
|
||||
colors={['#fff']}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
userActivities, userPoints, intl, isClaiming, claimPoints,
|
||||
} = this.props;
|
||||
// TODO: this feature temporarily closed.
|
||||
const isActiveIcon = false;
|
||||
render() {
|
||||
const {
|
||||
userActivities,
|
||||
userPoints,
|
||||
intl,
|
||||
isClaiming,
|
||||
claimPoints,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
return (
|
||||
<Fragment>
|
||||
<LineBreak height={12} />
|
||||
<ScrollView
|
||||
style={styles.scrollContainer}
|
||||
refreshControl={this.refreshControl()}
|
||||
>
|
||||
<Text style={styles.pointText}>{userPoints.points}</Text>
|
||||
<Text style={styles.subText}>eSteem Points</Text>
|
||||
{get(userPoints, 'unclaimed_points') > 0 && (
|
||||
<MainButton
|
||||
isLoading={isClaiming}
|
||||
isDisable={isClaiming}
|
||||
style={styles.mainButton}
|
||||
height={50}
|
||||
onPress={() => claimPoints()}
|
||||
>
|
||||
<View style={styles.mainButtonWrapper}>
|
||||
<Text style={styles.unclaimedText}>
|
||||
{userPoints.unclaimed_points}
|
||||
</Text>
|
||||
<View style={styles.mainIconWrapper}>
|
||||
<Icon
|
||||
name="add"
|
||||
iconType="MaterialIcons"
|
||||
color="#357ce6"
|
||||
size={23}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</MainButton>
|
||||
)}
|
||||
|
||||
<Fragment>
|
||||
<LineBreak height={12} />
|
||||
<ScrollView
|
||||
style={styles.scrollContainer}
|
||||
refreshControl={this.refreshControl()}
|
||||
>
|
||||
<Text style={styles.pointText}>{userPoints.points}</Text>
|
||||
<Text style={styles.subText}>eSteem Points</Text>
|
||||
{userPoints.unclaimed_points > 0
|
||||
&& (
|
||||
<MainButton
|
||||
isLoading={isClaiming}
|
||||
isDisable={isClaiming}
|
||||
style={styles.mainButton}
|
||||
height={50}
|
||||
onPress={() => claimPoints()}
|
||||
>
|
||||
<View style={styles.mainButtonWrapper}>
|
||||
<Text style={styles.unclaimedText}>{userPoints.unclaimed_points}</Text>
|
||||
<View style={styles.mainIconWrapper}>
|
||||
<Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} />
|
||||
</View>
|
||||
</View>
|
||||
</MainButton>
|
||||
)
|
||||
}
|
||||
<View style={styles.iconsWrapper}>
|
||||
<FlatList
|
||||
style={styles.iconsList}
|
||||
data={POINTS_KEYS}
|
||||
horizontal
|
||||
keyExtractor={(item, index) => (item.type + index).toString()}
|
||||
renderItem={({ item }) => (
|
||||
<PopoverController>
|
||||
{({
|
||||
openPopover,
|
||||
closePopover,
|
||||
popoverVisible,
|
||||
setPopoverAnchor,
|
||||
popoverAnchorRect,
|
||||
}) => (
|
||||
<View styles={styles.iconWrapper}>
|
||||
<View style={styles.iconWrapper}>
|
||||
<TouchableOpacity
|
||||
ref={setPopoverAnchor}
|
||||
onPress={openPopover}
|
||||
>
|
||||
<IconButton
|
||||
iconStyle={styles.icon}
|
||||
style={styles.iconButton}
|
||||
iconType={POINTS[item.type].iconType}
|
||||
name={POINTS[item.type].icon}
|
||||
badgeCount={POINTS[item.type].point}
|
||||
badgeStyle={styles.badge}
|
||||
badgeTextStyle={styles.badgeText}
|
||||
disabled
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<Text style={styles.subText}>
|
||||
{intl.formatMessage({ id: POINTS[item.type].nameKey })}
|
||||
</Text>
|
||||
<Popover
|
||||
backgroundStyle={styles.overlay}
|
||||
contentStyle={styles.popoverDetails}
|
||||
arrowStyle={styles.arrow}
|
||||
visible={popoverVisible}
|
||||
onClose={() => {
|
||||
closePopover();
|
||||
}}
|
||||
fromRect={popoverAnchorRect}
|
||||
placement="top"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
>
|
||||
<View style={styles.popoverWrapper}>
|
||||
<Text style={styles.popoverText}>
|
||||
{intl.formatMessage({
|
||||
id: POINTS[item.type].descriptionKey,
|
||||
})}
|
||||
</Text>
|
||||
</View>
|
||||
</Popover>
|
||||
</View>
|
||||
)}
|
||||
</PopoverController>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={styles.iconsWrapper}>
|
||||
<FlatList
|
||||
style={styles.iconsList}
|
||||
data={POINTS_KEYS}
|
||||
horizontal
|
||||
renderItem={({ item }) => (
|
||||
<PopoverController key={item.type}>
|
||||
{({
|
||||
openPopover, closePopover, popoverVisible, setPopoverAnchor, popoverAnchorRect,
|
||||
}) => (
|
||||
<View styles={styles.iconWrapper} key={item.type}>
|
||||
<View style={styles.iconWrapper}>
|
||||
<TouchableOpacity
|
||||
ref={setPopoverAnchor}
|
||||
onPress={openPopover}
|
||||
>
|
||||
<IconButton
|
||||
iconStyle={styles.icon}
|
||||
style={styles.iconButton}
|
||||
iconType={POINTS[item.type].iconType}
|
||||
name={POINTS[item.type].icon}
|
||||
badgeCount={POINTS[item.type].point}
|
||||
badgeStyle={styles.badge}
|
||||
badgeTextStyle={styles.badgeText}
|
||||
disabled
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<Text style={styles.subText}>{intl.formatMessage({ id: POINTS[item.type].nameKey })}</Text>
|
||||
<Popover
|
||||
backgroundStyle={styles.overlay}
|
||||
contentStyle={styles.popoverDetails}
|
||||
arrowStyle={styles.arrow}
|
||||
visible={popoverVisible}
|
||||
onClose={() => {
|
||||
closePopover();
|
||||
}}
|
||||
fromRect={popoverAnchorRect}
|
||||
placement="top"
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
>
|
||||
<View style={styles.popoverWrapper}>
|
||||
<Text style={styles.popoverText}>{intl.formatMessage({ id: POINTS[item.type].descriptionKey })}</Text>
|
||||
</View>
|
||||
</Popover>
|
||||
</View>
|
||||
)}
|
||||
</PopoverController>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={styles.listWrapper}>
|
||||
{userActivities && userActivities.length < 1
|
||||
? <Text style={styles.subText}>{intl.formatMessage({ id: 'points.no_activity' })}</Text>
|
||||
: (
|
||||
<FlatList
|
||||
data={userActivities}
|
||||
renderItem={({ item, index }) => (
|
||||
<WalletLineItem
|
||||
key={item.id.toString()}
|
||||
index={index + 1}
|
||||
text={intl.formatMessage({ id: item.textKey })}
|
||||
description={getTimeFromNow(item.created)}
|
||||
isCircleIcon
|
||||
isThin
|
||||
isBlackText
|
||||
iconName={item.icon}
|
||||
iconType={item.iconType}
|
||||
rightText={`${item.amount} ESTM`}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</View>
|
||||
|
||||
</ScrollView>
|
||||
</Fragment>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
<View style={styles.listWrapper}>
|
||||
{size(userActivities) < 1 ? (
|
||||
<Text style={styles.subText}>
|
||||
{intl.formatMessage({ id: 'points.no_activity' })}
|
||||
</Text>
|
||||
) : (
|
||||
<FlatList
|
||||
data={userActivities}
|
||||
keyExtractor={item => item.id.toString()}
|
||||
renderItem={({ item, index }) => (
|
||||
<WalletLineItem
|
||||
index={index + 1}
|
||||
text={intl.formatMessage({ id: item.textKey })}
|
||||
description={getTimeFromNow(get(item, 'created'))}
|
||||
isCircleIcon
|
||||
isThin
|
||||
isBlackText
|
||||
iconName={get(item, 'icon')}
|
||||
iconType={get(item, 'iconType')}
|
||||
rightText={`${get(item, 'amount')} ESTM`}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(PointsView);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { View, FlatList, Text } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Components
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { View, FlatList, Text } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Utils
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View, StatusBar, Platform } from 'react-native';
|
||||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Actions
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
@ -3,7 +3,7 @@ import { View, ScrollView } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { Comments } from '../../../components/comments';
|
||||
import { CollapsibleCard } from '../../../components/collapsibleCard';
|
||||
import { Header } from '../../../components/header';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
32
yarn.lock
32
yarn.lock
@ -1090,20 +1090,6 @@
|
||||
lodash "^4.17.11"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@esteemapp/react-native-scrollable-tab-view@^0.8.2":
|
||||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/@esteemapp/react-native-scrollable-tab-view/-/react-native-scrollable-tab-view-0.8.2.tgz#44c0b0dbfc5dca7361a0c60f21e5e6e95d486742"
|
||||
integrity sha512-RjhzM0pSPHTHyMoyGa3NZRBBDB4gvco8TVmDo7MKzUqjF8a8BQYp43o8IMR5tkKN7UzGgKNsStuRch7MEb+0jQ==
|
||||
dependencies:
|
||||
create-react-class "^15.6.2"
|
||||
prop-types "^15.6.0"
|
||||
react-timer-mixin "^0.13.3"
|
||||
|
||||
"@esteemapp/react-native-tags@^1.3.1":
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@esteemapp/react-native-tags/-/react-native-tags-1.3.1.tgz#8345384b21f4cfe26cd01bfea738b9b0ec7b04c2"
|
||||
integrity sha512-r/EHz8h5wYOPNHA9nv6b2hcaX6pFJI36NHII4ADWJ4Ll9ikQIHCQsDmlS7X8FMmnRQZonETEKglMULfU0of9qw==
|
||||
|
||||
"@samverschueren/stream-to-observable@^0.3.0":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
|
||||
@ -7357,11 +7343,6 @@ react-native-modal-popover@0.0.12:
|
||||
lodash.debounce "^4.0.8"
|
||||
prop-types "^15.6.2"
|
||||
|
||||
react-native-restart@0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.6.tgz#77770d078683947b2c1f2adb876f179269d8443a"
|
||||
integrity sha512-ysKvNOjCeCS8A4ouQkJ8DZRYH4wgPdPEJqqqSGFuNzK4eAi3VPOeneQ3w0HHYeOui5fc6fV9y9ClOB9LcKbKpQ==
|
||||
|
||||
react-native-safe-area-view@0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174"
|
||||
@ -7374,6 +7355,15 @@ react-native-screens@^1.0.0-alpha.11:
|
||||
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b"
|
||||
integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA==
|
||||
|
||||
react-native-scrollable-tab-view@^0.10.0:
|
||||
version "0.10.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-scrollable-tab-view/-/react-native-scrollable-tab-view-0.10.0.tgz#8ce7908254685ee37d35df7d849676eaa1e81132"
|
||||
integrity sha512-7FWw9X2hLozWqpGJTAU/p7ONdTTO635bbAZ5AUPDrB4JwaLbhNV6ePjsNUjsCaopgCwz/EdmH0hTCPeja9dh4w==
|
||||
dependencies:
|
||||
create-react-class "^15.6.2"
|
||||
prop-types "^15.6.0"
|
||||
react-timer-mixin "^0.13.3"
|
||||
|
||||
react-native-sentry@^0.42.0:
|
||||
version "0.42.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-sentry/-/react-native-sentry-0.42.0.tgz#9cd59659d9b6cd36d6fc4c48f50613cd82cde25f"
|
||||
@ -9378,9 +9368,9 @@ xcode@^2.0.0:
|
||||
simple-plist "^1.0.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
"xcode@git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b":
|
||||
"xcode@https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b":
|
||||
version "1.0.1-dev"
|
||||
resolved "git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b"
|
||||
resolved "https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b"
|
||||
dependencies:
|
||||
simple-plist "^0.2.1"
|
||||
uuid "3.0.1"
|
||||
|
Loading…
Reference in New Issue
Block a user