This commit is contained in:
noumantahir 2022-10-19 14:23:40 +05:00
parent 3a05b7f4e2
commit 183cd587de
27 changed files with 80 additions and 85 deletions

View File

@ -9,7 +9,6 @@ import { IconButton } from '../iconButton';
// Styles
import styles from './avatarHeaderStyles';
const AvatarHeader = ({
username,
name,
@ -18,7 +17,6 @@ const AvatarHeader = ({
showImageUploadActions,
isUploading,
}) => () => {
const navigation = useNavigation();
return (
@ -66,5 +64,5 @@ const AvatarHeader = ({
</SafeAreaView>
</LinearGradient>
);
}
export default AvatarHeader;
};
export default AvatarHeader;

View File

@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
// Services and Actions
import { useNavigation } from '@react-navigation/native';
import { getCommunityTitle } from '../../../../providers/hive/dhive';
// Middleware
@ -11,7 +12,6 @@ import ROUTES from '../../../../constants/routeNames';
// Component
import TagView from './tagView';
import { useNavigation } from '@react-navigation/native';
/*
* Props Name Description Value
@ -103,4 +103,4 @@ const TagContainer = ({
);
};
export default TagContainer;
export default TagContainer;

View File

@ -5,6 +5,7 @@ import { injectIntl } from 'react-intl';
import get from 'lodash/get';
import { postBodySummary } from '@ecency/render-helper';
import { useNavigation } from '@react-navigation/native';
import { getComments, deleteComment } from '../../../providers/hive/dhive';
// Services and Actions
import { writeToClipboard } from '../../../utils/clipboard';
@ -20,7 +21,6 @@ import CommentsView from '../view/commentsView';
import { useAppSelector } from '../../../hooks';
import { updateCommentCache } from '../../../redux/actions/cacheActions';
import { CommentCacheStatus } from '../../../redux/reducers/cacheReducer';
import { useNavigation } from '@react-navigation/native';
const CommentsContainer = ({
author,
@ -49,7 +49,6 @@ const CommentsContainer = ({
incrementRepliesCount,
handleOnReplyPress,
}) => {
const navigation = useNavigation();
const lastCacheUpdate = useAppSelector((state) => state.cache.lastUpdate);
@ -383,4 +382,4 @@ const mapStateToProps = (state) => ({
pinCode: state.application.pin,
});
export default connect(mapStateToProps)(injectIntl(CommentsContainer));
export default connect(mapStateToProps)(injectIntl(CommentsContainer));

View File

@ -4,24 +4,17 @@ import has from 'lodash/has';
// Component
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import HeaderView from '../view/headerView';
import { AccountContainer, ThemeContainer } from '../../../containers';
import { parseReputation } from '../../../utils/user';
import { toggleQRModal } from '../../../redux/actions/uiAction';
import { useNavigation } from '@react-navigation/native';
const HeaderContainer = ({
selectedUser,
isReverse,
handleOnBackPress,
hideUser,
showQR,
}) => {
const HeaderContainer = ({ selectedUser, isReverse, handleOnBackPress, hideUser, showQR }) => {
const navigation = useNavigation();
const dispatch = useDispatch();
const _handleOpenDrawer = () => {
if (has(navigation, 'openDrawer') && typeof get(navigation, 'openDrawer') === 'function') {
navigation.openDrawer();
@ -71,4 +64,4 @@ const HeaderContainer = ({
);
};
export default HeaderContainer;
export default HeaderContainer;

View File

@ -90,4 +90,4 @@ const mapStateToProps = (state) => ({
isConnected: state.application.isConnected,
});
export default connect(mapStateToProps)(injectIntl(LeaderboardContainer));
export default connect(mapStateToProps)(injectIntl(LeaderboardContainer));

View File

@ -1,10 +1,10 @@
import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import get from 'lodash/get';
import { useNavigation } from '@react-navigation/native';
import { default as ROUTES } from '../../../constants/routeNames';
import styles from './parentPostStyles';
import { useNavigation } from '@react-navigation/native';
const ParentPost = ({ post }) => {
const navigation = useNavigation();
@ -31,4 +31,4 @@ const ParentPost = ({ post }) => {
);
};
export default ParentPost;
export default ParentPost;

View File

@ -1,11 +1,11 @@
import React from 'react';
import { TouchableOpacity } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { Icon } from '../icon';
// Constant
import { default as ROUTES } from '../../constants/routeNames';
import scalePx from '../../utils/scalePx';
import { useNavigation } from '@react-navigation/native';
const PostButtonView = () => {
const navigation = useNavigation();
@ -27,7 +27,7 @@ const PostButtonView = () => {
size={scalePx(26)}
/>
</TouchableOpacity>
)
);
};
export default PostButtonView;

View File

@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import get from 'lodash/get';
// Services
import { useNavigation } from '@react-navigation/native';
import { getPost } from '../../../providers/hive/dhive';
import { getPostReblogs } from '../../../providers/ecency/ecency';
@ -12,7 +13,6 @@ import PostCardView from '../view/postCardView';
import { default as ROUTES } from '../../../constants/routeNames';
import { useAppDispatch } from '../../../hooks';
import { showProfileModal } from '../../../redux/actions/uiAction';
import { useNavigation } from '@react-navigation/native';
/*
* Props Name Description Value
*@props --> props name here description here Value Type Here
@ -153,4 +153,4 @@ const mapStateToProps = (state) => ({
nsfw: state.application.nsfw,
});
export default connect(mapStateToProps)(PostCardContainer);
export default connect(mapStateToProps)(PostCardContainer);

View File

@ -9,6 +9,7 @@ import ActionSheetView from 'react-native-actions-sheet';
import { connect } from 'react-redux';
// Services and Actions
import { useNavigation } from '@react-navigation/native';
import { writeToClipboard } from '../../../../utils/clipboard';
import { toastNotification } from '../../../../redux/actions/uiAction';
@ -19,7 +20,6 @@ import { isCommunity } from '../../../../utils/communityValidation';
import { GLOBAL_POST_FILTERS_VALUE } from '../../../../constants/options/filters';
import { PostHtmlRenderer, VideoPlayer } from '../../..';
import getWindowDimensions from '../../../../utils/getWindowDimensions';
import { useNavigation } from '@react-navigation/native';
const WIDTH = getWindowDimensions().width;
@ -355,4 +355,4 @@ const areEqual = (prevProps, nextProps) => {
const mapStateToProps = (state) => ({});
export default React.memo(injectIntl(connect(mapStateToProps)(PostBody)), areEqual);
export default React.memo(injectIntl(connect(mapStateToProps)(PostBody)), areEqual);

View File

@ -4,6 +4,7 @@ import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
// Components
import { useNavigation } from '@react-navigation/native';
import { Tag } from '../../../basicUIElements';
import { Icon } from '../../../icon';
import { UserAvatar } from '../../../userAvatar';
@ -13,7 +14,6 @@ import styles from './postHeaderDescriptionStyles';
import { default as ROUTES } from '../../../../constants/routeNames';
import { IconButton } from '../../..';
import { showProfileModal } from '../../../../redux/actions/uiAction';
import { useNavigation } from '@react-navigation/native';
// Constants
const DEFAULT_IMAGE = require('../../../../assets/ecency.png');
@ -180,7 +180,9 @@ class PostHeaderDescription extends PureComponent {
const mapStateToProps = () => ({});
const mapHookToProps = () => ({
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)(injectIntl((props)=><PostHeaderDescription {...props} {...mapHookToProps()} />));
export default connect(mapStateToProps)(
injectIntl((props) => <PostHeaderDescription {...props} {...mapHookToProps()} />),
);

View File

@ -4,6 +4,7 @@ import { injectIntl } from 'react-intl';
import get from 'lodash/get';
// Action
import { useNavigation } from '@react-navigation/native';
import { toastNotification } from '../../../redux/actions/uiAction';
// Dsteem
@ -15,7 +16,6 @@ import { default as ROUTES } from '../../../constants/routeNames';
// Component
import PostDisplayView from '../view/postDisplayView';
import { useNavigation } from '@react-navigation/native';
const PostDisplayContainer = ({
post,
@ -155,4 +155,4 @@ const mapStateToProps = (state) => ({
isLoggedIn: state.application.isLoggedIn,
});
export default connect(mapStateToProps)(injectIntl(PostDisplayContainer));
export default connect(mapStateToProps)(injectIntl(PostDisplayContainer));

View File

@ -14,6 +14,7 @@ import { get } from 'lodash';
// COMPONENTS
import FastImage from 'react-native-fast-image';
import { useNavigation } from '@react-navigation/native';
import { PostCard } from '../../postCard';
import { FilterBar } from '../../filterBar';
import {
@ -32,7 +33,6 @@ import { default as ROUTES } from '../../../constants/routeNames';
import globalStyles from '../../../globalStyles';
import PostsList from '../../postsList';
import { isDarkTheme } from '../../../redux/actions/applicationActions';
import { useNavigation } from '@react-navigation/native';
let _onEndReachedCalledDuringMomentum = true;
@ -395,4 +395,4 @@ const PostsView = ({
};
export default PostsView;
/* eslint-enable */
/* eslint-enable */

View File

@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import get from 'lodash/get';
// Services and Actions
import { useNavigation } from '@react-navigation/native';
import { search } from '../../../providers/ecency/ecency';
import { lookupAccounts, getTrendingTags, getPurePost } from '../../../providers/hive/dhive';
@ -15,7 +16,6 @@ import postUrlParser from '../../../utils/postUrlParser';
// Component
import SearchModalView from '../view/searchModalView';
import { useNavigation } from '@react-navigation/native';
/*
* Props name Description Value
@ -23,13 +23,7 @@ import { useNavigation } from '@react-navigation/native';
*
*/
const SearchModalContainer = ({
isConnected,
handleOnClose,
username,
isOpen,
placeholder,
}) => {
const SearchModalContainer = ({ isConnected, handleOnClose, username, isOpen, placeholder }) => {
const navigation = useNavigation();
const [searchResults, setSearchResults] = useState({});
@ -241,4 +235,4 @@ const mapStateToProps = (state) => ({
isConnected: state.application.isConnected,
});
export default connect(mapStateToProps)(SearchModalContainer);
export default connect(mapStateToProps)(SearchModalContainer);

View File

@ -3,6 +3,7 @@ import { SafeAreaView, FlatList, Text } from 'react-native';
import { useIntl } from 'react-intl';
// Utils
import { useNavigation } from '@react-navigation/native';
import { getTimeFromNow } from '../../../utils/time';
// Components
@ -13,7 +14,6 @@ import ROUTES from '../../../constants/routeNames';
// Styles
import styles from './votersDisplayStyles';
import { useNavigation } from '@react-navigation/native';
const VotersDisplayView = ({ votes, createdAt = '2010-01-01T00:00:00' }) => {
const navigation = useNavigation();
@ -79,4 +79,4 @@ const VotersDisplayView = ({ votes, createdAt = '2010-01-01T00:00:00' }) => {
);
};
export default VotersDisplayView;
export default VotersDisplayView;

View File

@ -82,7 +82,9 @@ const mapStateToProps = (state) => ({
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)(injectIntl((props)=><WalletContainer {...mapHooksToProps(props)}/>));
export default connect(mapStateToProps)(
injectIntl((props) => <WalletContainer {...mapHooksToProps(props)} />),
);

View File

@ -5,6 +5,7 @@ import { useIntl } from 'react-intl';
import get from 'lodash/get';
// Components
import { useNavigation } from '@react-navigation/native';
import { Icon, MainButton, DropdownButton, WalletLineItem } from '../..';
// Constants
@ -12,7 +13,6 @@ import { default as ROUTES } from '../../../constants/routeNames';
// Styles
import styles from './walletHeaderStyles';
import { useNavigation } from '@react-navigation/native';
const WalletHeaderView = ({
claim,
@ -148,4 +148,4 @@ const WalletHeaderView = ({
};
export default WalletHeaderView;
/* eslint-enable */
/* eslint-enable */

View File

@ -5,6 +5,7 @@ import get from 'lodash/get';
import { useIntl } from 'react-intl';
// Services and Actions
import { useNavigation } from '@react-navigation/native';
import { getPointsSummary, claimPoints, getPointsHistory } from '../providers/ecency/ePoint';
import { getAccount, boost } from '../providers/hive/dhive';
import { getUserDataWithUsername } from '../realm/realm';
@ -18,7 +19,6 @@ import ROUTES from '../constants/routeNames';
// Utils
import { groomingPointsTransactionData, getPointsEstimate } from '../utils/wallet';
import { useNavigation } from '@react-navigation/native';
/*
* Props Name Description Value
@ -38,9 +38,8 @@ const PointsContainer = ({
globalProps,
pinCode,
currency,
route
route,
}) => {
const navigation = useNavigation();
const [userPoints, setUserPoints] = useState({});

View File

@ -6,6 +6,7 @@ import { Alert } from 'react-native';
import { injectIntl } from 'react-intl';
// Providers
import { useNavigation } from '@react-navigation/native';
import {
followUser,
unfollowUser,
@ -27,7 +28,6 @@ import { toastNotification, setRcOffer, showActionModal } from '../redux/actions
// Constants
import { default as ROUTES } from '../constants/routeNames';
import { updateCurrentAccount } from '../redux/actions/accountAction';
import { useNavigation } from '@react-navigation/native';
class ProfileContainer extends Component {
constructor(props) {
@ -453,7 +453,7 @@ class ProfileContainer extends Component {
const { route } = this.props;
if (route && route.params && route.params.fetchData) {
navigationParams.fetchData();
route.params.fetchData();
}
};
@ -522,7 +522,7 @@ class ProfileContainer extends Component {
deepLinkFilter,
} = this.state;
const { currency, isDarkTheme, isLoggedIn, children, isHideImage, route } = this.props;
const activePage = route.params?.state ?? 0;
const { currencyRate, currencySymbol } = currency;
@ -591,8 +591,10 @@ const mapStateToProps = (state) => ({
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)(injectIntl((props)=><ProfileContainer {...mapHooksToProps(props)}/>));
export default connect(mapStateToProps)(
injectIntl((props) => <ProfileContainer {...mapHooksToProps(props)} />),
);
/* eslint-enable */

View File

@ -5,12 +5,12 @@ import { injectIntl } from 'react-intl';
import ImagePicker from 'react-native-image-crop-picker';
import get from 'lodash/get';
import { useNavigation } from '@react-navigation/native';
import { uploadImage } from '../providers/ecency/ecency';
import { profileUpdate, signImage } from '../providers/hive/dhive';
import { updateCurrentAccount } from '../redux/actions/accountAction';
import { setAvatarCacheStamp } from '../redux/actions/uiAction';
import { useNavigation } from '@react-navigation/native';
// import ROUTES from '../constants/routeNames';
@ -145,7 +145,7 @@ class ProfileEditContainer extends Component {
};
_handleOnSubmit = async () => {
const { currentAccount, pinCode, dispatch, navigation, intl, route} = this.props;
const { currentAccount, pinCode, dispatch, navigation, intl, route } = this.props;
const { name, location, website, about, coverUrl, avatarUrl, pinned } = this.state;
this.setState({ isLoading: true });
@ -229,10 +229,12 @@ const mapStateToProps = (state) => ({
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)(injectIntl((props)=><ProfileEditContainer {...mapHooksToProps(props)}/>));
export default connect(mapStateToProps)(
injectIntl((props) => <ProfileEditContainer {...mapHooksToProps(props)} />),
);
const IMAGE_PICKER_AVATAR_OPTIONS = {
includeBase64: true,

View File

@ -4,10 +4,10 @@ import { connect } from 'react-redux';
import get from 'lodash/get';
import { injectIntl } from 'react-intl';
import { useNavigation } from '@react-navigation/native';
import { promote, boost, isPostAvailable } from '../providers/hive/dhive';
import { toastNotification } from '../redux/actions/uiAction';
import { getUserDataWithUsername } from '../realm/realm';
import { useNavigation } from '@react-navigation/native';
/*
* Props Name Description Value
@ -151,7 +151,9 @@ const mapStateToProps = (state) => ({
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)(injectIntl((props)=><RedeemContainer {...mapHooksToProps(props)}/>));
export default connect(mapStateToProps)(
injectIntl((props) => <RedeemContainer {...mapHooksToProps(props)} />),
);

View File

@ -3,6 +3,7 @@ import { useSelector, useDispatch } from 'react-redux';
import { shuffle, isEmpty } from 'lodash';
import { useIntl } from 'react-intl';
import { useNavigation } from '@react-navigation/native';
import ROUTES from '../../../constants/routeNames';
import { getCommunities, getSubscriptions } from '../../../providers/hive/dhive';
@ -21,7 +22,6 @@ import {
mergeSubCommunitiesCacheInDiscoverList,
mergeSubCommunitiesCacheInSubList,
} from '../../../utils/communitiesUtils';
import { useNavigation } from '@react-navigation/native';
const CommunitiesContainer = ({ children }) => {
const navigation = useNavigation();

View File

@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
import { connect, useDispatch, useSelector } from 'react-redux';
import { useIntl } from 'react-intl';
import { useNavigation } from '@react-navigation/native';
import { getCommunity } from '../../../providers/hive/dhive';
import { subscribeCommunity, leaveCommunity } from '../../../redux/actions/communitiesAction';
@ -9,9 +10,8 @@ import { subscribeCommunity, leaveCommunity } from '../../../redux/actions/commu
import ROUTES from '../../../constants/routeNames';
import { updateSubscribedCommunitiesCache } from '../../../redux/actions/cacheActions';
import { statusMessage } from '../../../redux/constants/communitiesConstants';
import { useNavigation } from '@react-navigation/native';
const CommunityContainer = ({tag, children, currentAccount, pinCode, isLoggedIn }) => {
const CommunityContainer = ({ tag, children, currentAccount, pinCode, isLoggedIn }) => {
const navigation = useNavigation();
const [data, setData] = useState(null);
const [isSubscribed, setIsSubscribed] = useState(false);

View File

@ -4,6 +4,7 @@ import { View, Text, FlatList, ActivityIndicator } from 'react-native';
import { injectIntl } from 'react-intl';
// Constants
import { useNavigation } from '@react-navigation/native';
import ROUTES from '../../../constants/routeNames';
// Components
@ -11,7 +12,6 @@ import { BasicHeader, UserListItem } from '../../../components';
// Utils
import styles from './followScreenStyles';
import { useNavigation } from '@react-navigation/native';
class FollowsScreen extends PureComponent {
/* Props
@ -92,9 +92,8 @@ class FollowsScreen extends PureComponent {
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default injectIntl((props)=><FollowsScreen {...mapHooksToProps(props)}/>);
export default injectIntl((props) => <FollowsScreen {...mapHooksToProps(props)} />);
/* eslint-enable */

View File

@ -17,7 +17,7 @@ class RedeemScreen extends PureComponent {
const { route } = this.props;
return (
<Fragment>
<PointsContainer route={route} >
<PointsContainer route={route}>
{({
accounts,
currentAccountName,

View File

@ -4,10 +4,10 @@ import { useIntl } from 'react-intl';
import { useSelector } from 'react-redux';
import get from 'lodash/get';
import { useNavigation } from '@react-navigation/native';
import { lookupAccounts } from '../../providers/hive/dhive';
import { signUp } from '../../providers/ecency/ecency';
import ROUTES from '../../constants/routeNames';
import { useNavigation } from '@react-navigation/native';
const RegisterContainer = ({ children }) => {
const navigation = useNavigation();

View File

@ -9,7 +9,7 @@ const SpinGameScreen = ({ route }) => {
return (
<SpinGameContainer>
{({ startGame, score, gameRight, nextDate, isLoading, statusCheck }) => (
<InAppPurchaseContainer route= {route} fetchData={statusCheck} skus={['499spins']}>
<InAppPurchaseContainer route={route} fetchData={statusCheck} skus={['499spins']}>
{({ buyItem, getItems, spinProduct, isProcessing }) => (
<SpinGame
buyItem={buyItem}

View File

@ -3,6 +3,8 @@ import { View, Alert, StatusBar } from 'react-native';
import { WebView } from 'react-native-webview';
import { connect } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import { injectIntl } from 'react-intl';
import { loginWithSC2 } from '../../providers/hive/auth';
import { hsOptions } from '../../constants/hsOptions';
@ -14,7 +16,6 @@ import { login as loginAction } from '../../redux/actions/applicationActions';
import { default as ROUTES } from '../../constants/routeNames';
import persistAccountGenerator from '../../utils/persistAccountGenerator';
import { fetchSubscribedCommunities } from '../../redux/actions/communitiesAction';
import { useNavigation } from '@react-navigation/native';
class HiveSigner extends PureComponent {
constructor(props) {
@ -108,7 +109,9 @@ const mapStateToProps = (state) => ({
const mapHooksToProps = (props) => ({
...props,
navigation:useNavigation()
})
navigation: useNavigation(),
});
export default connect(mapStateToProps)((props)=><HiveSigner {...mapHooksToProps(props)} />);
export default connect(mapStateToProps)(
injectIntl((props) => <HiveSigner {...mapHooksToProps(props)} />),
);