Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Feb 16, 2024
2 parents 45a1cbd + c057698 commit b6c5173
Show file tree
Hide file tree
Showing 127 changed files with 1,931 additions and 619 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "3.0.45"
versionName "3.0.46"
resValue "string", "build_config_package", "app.esteem.mobile.android"
multiDexEnabled true
// react-native-image-crop-picker
Expand Down
343 changes: 171 additions & 172 deletions ios/Ecency.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ios/Ecency/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.45</string>
<string>3.0.46</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/EcencyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.45</string>
<string>3.0.46</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ SPEC CHECKSUMS:
BugsnagReactNative: fa312f53a83ca21c0afdfeaec98a9c5eeb8fc4ed
BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cde416483dac037923206447da6e1454df403714
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: a6454570f573a0f6f1d397e5a95c13e8e45d1700
FBReactNativeSpec: 09e8dfba44487e5dc4882a9f5318cde67549549c
Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
Expand All @@ -1038,7 +1038,7 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: ddf459d2625ca33f115492de5ba6d970e2576311
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
GoogleAppMeasurement: 4c19f031220c72464d460c9daa1fb5d1acce958e
GoogleDataTransport: ea169759df570f4e37bdee1623ec32a7e64e67c4
GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
Expand Down
4 changes: 2 additions & 2 deletions ios/eshare/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>3.0.45</string>
<string>3.0.46</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecency",
"version": "3.0.45",
"version": "3.0.46",
"displayName": "Ecency",
"private": true,
"rnpm": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.5.5",
"@bugsnag/react-native": "^7.11.0",
"@ecency/render-helper": "^2.2.26",
"@ecency/render-helper": "^2.2.31",
"@esteemapp/dhive": "0.15.0",
"@esteemapp/react-native-autocomplete-input": "^4.2.1",
"@esteemapp/react-native-multi-slider": "^1.1.0",
Expand Down
19 changes: 18 additions & 1 deletion src/components/header/container/headerContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ import HeaderView from '../view/headerView';
import { AccountContainer } from '../../../containers';
import { parseReputation } from '../../../utils/user';
import { toggleQRModal } from '../../../redux/actions/uiAction';
import ROUTES from '../../../constants/routeNames';

const HeaderContainer = ({ selectedUser, isReverse, handleOnBackPress, hideUser, showQR }) => {
const HeaderContainer = ({
selectedUser,
isReverse,
handleOnBackPress,
hideUser,
showQR,
showBoost,
}) => {
const navigation = useNavigation();
const dispatch = useDispatch();
const isDarkTheme = useSelector((state) => state.application.isDarkTheme);
Expand All @@ -33,6 +41,13 @@ const HeaderContainer = ({ selectedUser, isReverse, handleOnBackPress, hideUser,
dispatch(toggleQRModal(true));
};

const _handleOnBoostPress = () => {
// navigate to boost plus screen;
navigation.navigate(ROUTES.SCREENS.REDEEM, {
redeemType: 'boost_plus',
});
};

return (
<AccountContainer>
{({ currentAccount, isLoggedIn, isLoginDone }) => {
Expand All @@ -45,6 +60,7 @@ const HeaderContainer = ({ selectedUser, isReverse, handleOnBackPress, hideUser,
handleOnPressBackButton={_handleOnPressBackButton}
handleOnQRPress={_handleQRPress}
handleOpenDrawer={_handleOpenDrawer}
handleOnBoostPress={_handleOnBoostPress}
isDarkTheme={isDarkTheme}
isLoggedIn={isLoggedIn}
isLoginDone={isLoginDone}
Expand All @@ -53,6 +69,7 @@ const HeaderContainer = ({ selectedUser, isReverse, handleOnBackPress, hideUser,
username={get(_user, 'name')}
hideUser={hideUser}
showQR={showQR}
showBoost={showBoost}
/>
);
}}
Expand Down
12 changes: 12 additions & 0 deletions src/components/header/view/headerStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ export default EStyleSheet.create({
color: '$iconColor',
justifyContent: 'center',
},
boostContainer: {
flexDirection: 'row',
marginRight: 10,
},
boostIconContainer: {
marginLeft: 6,
},
boostPlusIcon: {
fontSize: 24,
color: '$primaryBlue',
justifyContent: 'center',
},
backButton: {
marginLeft: 24,
},
Expand Down
12 changes: 12 additions & 0 deletions src/components/header/view/headerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const HeaderView = ({
handleOnPressBackButton,
handleOnQRPress,
handleOpenDrawer,
handleOnBoostPress,
isDarkTheme,
isLoggedIn,
isLoginDone,
Expand All @@ -28,6 +29,7 @@ const HeaderView = ({
username,
hideUser,
showQR,
showBoost,
}) => {
const navigation = useNavigation();

Expand Down Expand Up @@ -116,6 +118,16 @@ const HeaderView = ({
/>
)}
<IconButton iconStyle={styles.backIcon} name="md-search" onPress={_onPressSearchButton} />

{showBoost && isLoggedIn && (
<IconButton
style={styles.boostIconContainer}
iconStyle={styles.boostPlusIcon}
name="fire"
iconType="FontAwesome5"
onPress={handleOnBoostPress}
/>
)}
</View>
)}
</>
Expand Down
10 changes: 5 additions & 5 deletions src/components/postCard/children/postCardActionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import ROUTES from '../../../constants/routeNames';

interface Props {
content: any;
reblogs: any[];
handleCardInteraction: (
id: PostCardActionIds,
payload?: any,
onCallback?: (data: any) => void,
) => void;
}

export const PostCardActionsPanel = ({ content, reblogs, handleCardInteraction }: Props) => {
export const PostCardActionsPanel = ({ content, handleCardInteraction }: Props) => {
const activeVotes = content?.active_votes || [];

const _onVotersPress = () => {
Expand All @@ -36,11 +35,12 @@ export const PostCardActionsPanel = ({ content, reblogs, handleCardInteraction }
};

const _onReblogsPress = () => {
if (reblogs?.length) {
if (content.reblogs > 0) {
handleCardInteraction(PostCardActionIds.NAVIGATE, {
name: ROUTES.SCREENS.REBLOGS,
params: {
reblogs,
author: content.author,
permlink: content.permlink,
},
});
}
Expand Down Expand Up @@ -78,7 +78,7 @@ export const PostCardActionsPanel = ({ content, reblogs, handleCardInteraction }
iconStyle={styles.commentIcon}
iconType="MaterialIcons"
isClickable
text={get(reblogs, 'length', 0)}
text={content.reblogs || ''}
onPress={_onReblogsPress}
/>
<TextWithIcon
Expand Down
7 changes: 1 addition & 6 deletions src/components/postCard/container/postCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const PostCard = ({
content,
isHideImage,
nsfw,
reblogs,
imageRatio,
setImageRatio,
handleCardInteraction,
Expand All @@ -48,11 +47,7 @@ const PostCard = ({
setImageRatio={setImageRatio}
handleCardInteraction={handleCardInteraction}
/>
<PostCardActionsPanel
content={content}
reblogs={reblogs || []}
handleCardInteraction={handleCardInteraction}
/>
<PostCardActionsPanel content={content} handleCardInteraction={handleCardInteraction} />
</View>
);
};
Expand Down
17 changes: 13 additions & 4 deletions src/components/postElements/body/view/postBodyView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Fragment, useState, useEffect, useRef } from 'react';
import { SafeAreaView, PermissionsAndroid, Platform, View, Text } from 'react-native';
import { SafeAreaView, PermissionsAndroid, Platform, View, Text, Alert } from 'react-native';
import CameraRoll from '@react-native-community/cameraroll';
import { useIntl } from 'react-intl';
import EStyleSheet from 'react-native-extended-stylesheet';
Expand All @@ -10,7 +10,11 @@ import ActionSheetView from 'react-native-actions-sheet';
// Services and Actions
import { useNavigation } from '@react-navigation/native';
import { writeToClipboard } from '../../../../utils/clipboard';
import { showProfileModal, toastNotification } from '../../../../redux/actions/uiAction';
import {
handleDeepLink,
showProfileModal,
toastNotification,
} from '../../../../redux/actions/uiAction';

// Constants
import { default as ROUTES } from '../../../../constants/routeNames';
Expand All @@ -22,6 +26,7 @@ import getWindowDimensions from '../../../../utils/getWindowDimensions';
import { useAppDispatch } from '../../../../hooks';
import { IconButton } from '../../../buttons';
import styles from './postBodyStyles';
import { isHiveUri } from '../../../../utils/hive-uri';

const WIDTH = getWindowDimensions().width;

Expand Down Expand Up @@ -249,8 +254,12 @@ const PostBody = ({ body, metadata, onLoadEnd, width }) => {
};

const _handleSetSelectedLink = (link) => {
setSelectedLink(link);
actionLink.current.show();
if (isHiveUri(link)) {
dispatch(handleDeepLink(link));
} else {
setSelectedLink(link);
actionLink.current.show();
}
};

const _handleSetSelectedImage = (imageLink, postImgUrls) => {
Expand Down
11 changes: 8 additions & 3 deletions src/components/postHtmlRenderer/postInteractionHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RNFetchBlob from 'rn-fetch-blob';
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import ROUTES from '../../constants/routeNames';
import { toastNotification } from '../../redux/actions/uiAction';
import { handleDeepLink, toastNotification } from '../../redux/actions/uiAction';
import { writeToClipboard } from '../../utils/clipboard';

import { OptionsModal } from '../atoms';
Expand All @@ -20,6 +20,7 @@ import VideoPlayer from '../videoPlayer/videoPlayerView';
import { IconButton } from '../buttons';
import styles from './postHtmlRendererStyles';
import { PostTypes } from '../../constants/postTypes';
import { isHiveUri } from '../../utils/hive-uri';

interface PostHtmlInteractionHandlerProps {
postType?: PostTypes;
Expand Down Expand Up @@ -55,8 +56,12 @@ export const PostHtmlInteractionHandler = forwardRef(
}
},
handleLinkPress: (url: string) => {
setSelectedLink(url);
actionLink.current?.show();
if (isHiveUri(url)) {
dispatch(handleDeepLink(url));
} else {
setSelectedLink(url);
actionLink.current?.show();
}
},
handleYoutubePress: (videoId, startTime) => {
if (videoId && youtubePlayerRef.current) {
Expand Down
13 changes: 4 additions & 9 deletions src/components/postView/container/postDisplayContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { toastNotification } from '../../../redux/actions/uiAction';

// Dsteem
import { deleteComment } from '../../../providers/hive/dhive';
import { getPostReblogs } from '../../../providers/ecency/ecency';

// Constants
import { default as ROUTES } from '../../../constants/routeNames';
Expand Down Expand Up @@ -39,7 +38,6 @@ const PostDisplayContainer = ({

const [activeVotes, setActiveVotes] = useState([]);
const [activeVotesCount, setActiveVotesCount] = useState(0);
const [reblogs, setReblogs] = useState([]);

useEffect(() => {
if (post) {
Expand All @@ -48,9 +46,6 @@ const PostDisplayContainer = ({
const activeVotesCount = get(post, 'stats.total_votes', 0);
setActiveVotes(votes);
setActiveVotesCount(activeVotesCount);
getPostReblogs(post).then((result) => {
setReblogs(result || []);
});
}
}, [post]);

Expand All @@ -72,13 +67,14 @@ const PostDisplayContainer = ({
};

const _handleOnReblogsPress = () => {
if (reblogs.length > 0) {
if (post.reblogs > 0) {
navigation.navigate({
name: ROUTES.SCREENS.REBLOGS,
params: {
reblogs,
author: post.author,
permlink: post.permlink,
},
key: post.permlink + reblogs.length,
key: post.permlink + post.reblogs.length,
} as never);
}
};
Expand Down Expand Up @@ -143,7 +139,6 @@ const PostDisplayContainer = ({
post={post}
activeVotes={activeVotes}
activeVotesCount={activeVotesCount}
reblogs={reblogs}
isWavePost={isWavePost}
fetchPost={_fetchPost}
handleOnEditPress={_handleOnEditPress}
Expand Down
5 changes: 2 additions & 3 deletions src/components/postView/view/postDisplayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const PostDisplayView = ({
permlink,
handleOnRemovePress,
activeVotes,
reblogs,
isWavePost,
activeVotesCount,
}) => {
Expand Down Expand Up @@ -97,7 +96,7 @@ const PostDisplayView = ({
};

const _handleOnReblogsPress = () => {
if (reblogs.length > 0 && handleOnReblogsPress) {
if (post.reblogs > 0 && handleOnReblogsPress) {
handleOnReblogsPress();
}
};
Expand Down Expand Up @@ -152,7 +151,7 @@ const PostDisplayView = ({
iconType="MaterialIcons"
isClickable
onPress={_handleOnReblogsPress}
text={reblogs.length}
text={post.reblogs || ''}
textMarginLeft={20}
/>
{isLoggedIn && (
Expand Down
Loading

0 comments on commit b6c5173

Please sign in to comment.