From ac6906c890c2fcbc83412c6293411b696a145f89 Mon Sep 17 00:00:00 2001 From: feruz Date: Tue, 2 Mar 2021 16:16:52 +0200 Subject: [PATCH 1/5] render helper update --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 63b5ede8a..e809602bc 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@babel/runtime": "^7.5.5", - "@ecency/render-helper": "^2.0.16", + "@ecency/render-helper": "^2.1.0", "@esteemapp/dhive": "0.15.0", "@esteemapp/react-native-autocomplete-input": "^4.2.1", "@esteemapp/react-native-modal-popover": "^0.0.15", diff --git a/yarn.lock b/yarn.lock index 14e267f83..ea0d3de7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -698,10 +698,10 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@ecency/render-helper@^2.0.16": - version "2.0.16" - resolved "https://registry.yarnpkg.com/@ecency/render-helper/-/render-helper-2.0.16.tgz#f67a6ffde8557e2b21d5bebf887570052376f42b" - integrity sha512-Km+KhjVSLV10Ogql3Xv8VCKQQmbZwIE54LW2dtn3MezrqZmrGTB4Dcf/8JJAN0CKvKqd17EXsfm/ybHwE+DSZA== +"@ecency/render-helper@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@ecency/render-helper/-/render-helper-2.1.0.tgz#826cc2d401942468516394f885bf329ed39fe30f" + integrity sha512-gYOJRnHT9NaEY1J3bOlgMxudU4I0Egh5GjnUUbgno5IDASttcYX7poXlWBDmelawfPx/Atv0MYbfzPrhGamfYg== dependencies: he "^1.2.0" lru-cache "^5.1.1" From 7ebe8c64a58bf629641f9092aa81152cfb031b77 Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 3 Mar 2021 08:25:06 +0200 Subject: [PATCH 2/5] follows user navigation --- src/screens/follows/screen/followsScreen.js | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/screens/follows/screen/followsScreen.js b/src/screens/follows/screen/followsScreen.js index 6b201483a..8b5ee68c2 100644 --- a/src/screens/follows/screen/followsScreen.js +++ b/src/screens/follows/screen/followsScreen.js @@ -2,8 +2,10 @@ import React, { PureComponent } from 'react'; import { View, Text, FlatList, ActivityIndicator } from 'react-native'; import { injectIntl } from 'react-intl'; +import { withNavigation } from 'react-navigation'; // Constants +import ROUTES from '../../../constants/routeNames'; // Components import { BasicHeader, UserListItem } from '../../../components'; @@ -25,12 +27,29 @@ class FollowsScreen extends PureComponent { // Component Life Cycles // Component Functions + _handleOnUserPress = (username) => { + const { navigation } = this.props; + + navigation.navigate({ + routeName: ROUTES.SCREENS.PROFILE, + params: { + username, + }, + key: username, + }); + }; _renderItem = ({ item, index }) => { const { isFollowing } = this.props; const username = isFollowing ? item.following : item.follower; - return ; + return ( + this._handleOnUserPress(username)} + /> + ); }; render() { @@ -66,5 +85,5 @@ class FollowsScreen extends PureComponent { } } -export default injectIntl(FollowsScreen); +export default withNavigation(injectIntl(FollowsScreen)); /* eslint-enable */ From 70d864190d318e6a72fc342be0269d3e04368847 Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 3 Mar 2021 08:37:06 +0200 Subject: [PATCH 3/5] fix communities fetch --- src/providers/hive/dhive.js | 2 +- src/screens/communities/container/communitiesContainer.js | 2 +- .../tabs/communities/container/communitiesResultsContainer.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/hive/dhive.js b/src/providers/hive/dhive.js index 4f719deee..980c1a49b 100644 --- a/src/providers/hive/dhive.js +++ b/src/providers/hive/dhive.js @@ -295,7 +295,7 @@ export const getCommunityTitle = async (tag) => export const getCommunities = async ( last = '', limit = 100, - query = '', + query = null, sort = 'rank', observer = '', ) => diff --git a/src/screens/communities/container/communitiesContainer.js b/src/screens/communities/container/communitiesContainer.js index 162a05e83..7de2b79e7 100644 --- a/src/screens/communities/container/communitiesContainer.js +++ b/src/screens/communities/container/communitiesContainer.js @@ -30,7 +30,7 @@ const CommunitiesContainer = ({ children, navigation }) => { useEffect(() => { getSubscriptions(currentAccount.username).then((subs) => { subs.forEach((item) => item.push(true)); - getCommunities('', 50, '', 'rank').then((communities) => { + getCommunities('', 50, null, 'rank').then((communities) => { communities.forEach((community) => Object.assign(community, { isSubscribed: subs.some( diff --git a/src/screens/searchResult/screen/tabs/communities/container/communitiesResultsContainer.js b/src/screens/searchResult/screen/tabs/communities/container/communitiesResultsContainer.js index 713b2eab0..36e96f35c 100644 --- a/src/screens/searchResult/screen/tabs/communities/container/communitiesResultsContainer.js +++ b/src/screens/searchResult/screen/tabs/communities/container/communitiesResultsContainer.js @@ -45,7 +45,7 @@ const CommunitiesResultsContainer = ({ children, navigation, searchValue }) => { setData([]); setNoResult(false); - getCommunities('', searchValue ? 100 : 20, searchValue, 'rank') + getCommunities('', searchValue ? 100 : 20, searchValue || null, 'rank') .then((communities) => { if (currentAccount && currentAccount.username) { getSubscriptions(currentAccount.username).then((subs) => { From 8b1d77ddfbd185ca3fb64967074ea7fa0e1f7fed Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 3 Mar 2021 10:03:40 +0200 Subject: [PATCH 4/5] inactivity notification route --- src/screens/application/container/applicationContainer.js | 5 +++++ src/screens/notification/container/notificationContainer.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index ff16f6300..6382453ed 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -435,6 +435,11 @@ class ApplicationContainer extends Component { }; break; + case 'inactive': + routeName = ROUTES.SCREENS.EDITOR; + key = push.source || 'inactive'; + break; + default: break; } diff --git a/src/screens/notification/container/notificationContainer.js b/src/screens/notification/container/notificationContainer.js index a58b3f241..bfe954a6a 100644 --- a/src/screens/notification/container/notificationContainer.js +++ b/src/screens/notification/container/notificationContainer.js @@ -45,6 +45,7 @@ class NotificationContainer extends Component { this.setState({ isNotificationRefreshing: true }); getActivities({ user: user || username, type, since }) .then((res) => { + console.log(res); const lastId = res.length > 0 ? [...res].pop().id : null; if (lastId === lastNotificationId || res.length === 0) { this.setState({ @@ -92,6 +93,8 @@ class NotificationContainer extends Component { routeName = ROUTES.TABBAR.WALLET; } else if (type === 'spin') { routeName = ROUTES.SCREENS.BOOST; + } else if (type === 'inactive') { + routeName = ROUTES.SCREENS.EDITOR; } if (routeName) { From 1f13e0b6d8148331d9f5b41a78fa0e0ae60b8da1 Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 3 Mar 2021 14:15:49 +0200 Subject: [PATCH 5/5] wallet improvements --- src/components/wallet/view/walletView.js | 6 +++--- src/constants/options/points.js | 4 ++-- src/containers/index.js | 4 ++-- src/containers/transferContainer.js | 4 +++- ...mWalletContainer.js => walletContainer.js} | 20 +++++++++---------- .../application/screen/applicationScreen.js | 2 +- src/screens/wallet/screen/btcView.js | 6 +++--- src/screens/wallet/screen/sbdView.js | 6 +++--- src/screens/wallet/screen/spView.js | 6 +++--- src/screens/wallet/screen/steemView.js | 6 +++--- src/screens/wallet/screen/walletScreen.js | 3 ++- .../wallet/screen/walletScreenStyles.js | 3 +++ 12 files changed, 38 insertions(+), 32 deletions(-) rename src/containers/{steemWalletContainer.js => walletContainer.js} (95%) diff --git a/src/components/wallet/view/walletView.js b/src/components/wallet/view/walletView.js index 1288b5dff..963cf1e60 100644 --- a/src/components/wallet/view/walletView.js +++ b/src/components/wallet/view/walletView.js @@ -9,7 +9,7 @@ import { MainButton } from '../../mainButton'; import { CollapsibleCard } from '../../collapsibleCard'; import { WalletDetails } from '../../walletDetails'; import { WalletDetailsPlaceHolder } from '../../basicUIElements'; -import { ThemeContainer, SteemWalletContainer } from '../../../containers'; +import { ThemeContainer, WalletContainer } from '../../../containers'; // Styles import styles from './walletStyles'; @@ -32,7 +32,7 @@ const WalletView = ({ setEstimatedWalletValue, selectedUser, handleOnScroll }) = ); return ( - )} - + ); }; diff --git a/src/constants/options/points.js b/src/constants/options/points.js index 035f38ed7..f4327526b 100644 --- a/src/constants/options/points.js +++ b/src/constants/options/points.js @@ -29,7 +29,7 @@ export default { nameKey: 'wallet.delegation', descriptionKey: 'wallet.delegation_desc', iconType: 'MaterialCommunityIcons', - point: 5, + point: 10, }, 100: { icon: 'pencil-outline', @@ -77,7 +77,7 @@ export default { nameKey: 'wallet.login', descriptionKey: 'wallet.login_desc', iconType: 'MaterialIcons', - point: 100, + point: 10, }, 30: { icon: 'check-all', diff --git a/src/containers/index.js b/src/containers/index.js index abe7bdab2..7f31e9a33 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -6,7 +6,7 @@ import ProfileContainer from './profileContainer'; import ProfileEditContainer from './profileEditContainer'; import RedeemContainer from './redeemContainer'; import SpinGameContainer from './spinGameContainer'; -import SteemWalletContainer from './steemWalletContainer'; +import WalletContainer from './walletContainer'; import ThemeContainer from './themeContainer'; import TransferContainer from './transferContainer'; @@ -19,7 +19,7 @@ export { ProfileEditContainer, RedeemContainer, SpinGameContainer, - SteemWalletContainer, + WalletContainer, ThemeContainer, TransferContainer, }; diff --git a/src/containers/transferContainer.js b/src/containers/transferContainer.js index 8c342bb08..35b319a93 100644 --- a/src/containers/transferContainer.js +++ b/src/containers/transferContainer.js @@ -23,6 +23,7 @@ import { getUser } from '../providers/ecency/ePoint'; // Utils import { countDecimals } from '../utils/number'; +import bugsnag from '../config/bugsnag'; /* * Props Name Description Value @@ -195,7 +196,8 @@ class TransferContainer extends Component { }) .catch((err) => { navigation.goBack(); - dispatch(toastNotification(err.message)); + bugsnag.notify(err); + dispatch(toastNotification(intl.formatMessage({ id: 'alert.key_warning' }))); }); }; diff --git a/src/containers/steemWalletContainer.js b/src/containers/walletContainer.js similarity index 95% rename from src/containers/steemWalletContainer.js rename to src/containers/walletContainer.js index c6e3e3755..b923df5a8 100644 --- a/src/containers/steemWalletContainer.js +++ b/src/containers/walletContainer.js @@ -21,12 +21,12 @@ import { getEstimatedAmount } from '../utils/vote'; // Constants import ROUTES from '../constants/routeNames'; -const STEEM_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'powerUp']; +const HIVE_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'powerUp']; const BTC_DROPDOWN = ['transfer_token']; -const SBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert']; -const SAVING_STEEM_DROPDOWN = ['withdraw_steem']; -const SAVING_SBD_DROPDOWN = ['withdraw_sbd']; -const STEEM_POWER_DROPDOWN = ['delegate', 'power_down']; +const HBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert']; +const SAVING_HIVE_DROPDOWN = ['withdraw_steem']; +const SAVING_HBD_DROPDOWN = ['withdraw_sbd']; +const HIVE_POWER_DROPDOWN = ['delegate', 'power_down']; const WalletContainer = ({ children, @@ -302,12 +302,12 @@ const WalletContainer = ({ estimatedSpValue, delegationsAmount, navigate: _navigate, - steemDropdown: STEEM_DROPDOWN, - sbdDropdown: SBD_DROPDOWN, + steemDropdown: HIVE_DROPDOWN, + sbdDropdown: HBD_DROPDOWN, btcDropdown: BTC_DROPDOWN, - savingSteemDropdown: SAVING_STEEM_DROPDOWN, - savingSbdDropdown: SAVING_SBD_DROPDOWN, - steemPowerDropdown: STEEM_POWER_DROPDOWN, + savingSteemDropdown: SAVING_HIVE_DROPDOWN, + savingSbdDropdown: SAVING_HBD_DROPDOWN, + steemPowerDropdown: HIVE_POWER_DROPDOWN, unclaimedBalance: unclaimedBalance && unclaimedBalance.trim(), estimatedAmount, }) diff --git a/src/screens/application/screen/applicationScreen.js b/src/screens/application/screen/applicationScreen.js index 7b197ca64..d8d52f19f 100644 --- a/src/screens/application/screen/applicationScreen.js +++ b/src/screens/application/screen/applicationScreen.js @@ -150,7 +150,7 @@ class ApplicationScreen extends Component { {isShowToastNotification && ( )} diff --git a/src/screens/wallet/screen/btcView.js b/src/screens/wallet/screen/btcView.js index ca9cab4d5..d71d46ccd 100644 --- a/src/screens/wallet/screen/btcView.js +++ b/src/screens/wallet/screen/btcView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -50,7 +50,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) ]} /> )} - + )} diff --git a/src/screens/wallet/screen/sbdView.js b/src/screens/wallet/screen/sbdView.js index e1c14a61c..7e8b835de 100644 --- a/src/screens/wallet/screen/sbdView.js +++ b/src/screens/wallet/screen/sbdView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -52,7 +52,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) ]} /> )} - + )} diff --git a/src/screens/wallet/screen/spView.js b/src/screens/wallet/screen/spView.js index 42e23987e..bf29217ec 100644 --- a/src/screens/wallet/screen/spView.js +++ b/src/screens/wallet/screen/spView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View, Text } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) = {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -66,7 +66,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) = ]} /> )} - + )} diff --git a/src/screens/wallet/screen/steemView.js b/src/screens/wallet/screen/steemView.js index e95d190ef..4c720aa70 100644 --- a/src/screens/wallet/screen/steemView.js +++ b/src/screens/wallet/screen/steemView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload } {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -56,7 +56,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload } ]} /> )} - + )} diff --git a/src/screens/wallet/screen/walletScreen.js b/src/screens/wallet/screen/walletScreen.js index 7780d597f..004e8f02c 100644 --- a/src/screens/wallet/screen/walletScreen.js +++ b/src/screens/wallet/screen/walletScreen.js @@ -50,9 +50,10 @@ const WalletScreen = () => { <> setCurrentIndex(index)} >