mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 21:01:31 +03:00
commit
37b295018d
@ -1,7 +1,7 @@
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { withNavigation } from 'react-navigation';
|
||||
import { Alert } from 'react-native';
|
||||
import { Alert, Share } from 'react-native';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
@ -16,6 +16,7 @@ import { default as ROUTES } from '../../../constants/routeNames';
|
||||
|
||||
// Utilities
|
||||
import { writeToClipboard } from '../../../utils/clipboard';
|
||||
import { getPostUrl } from '../../../utils/post';
|
||||
|
||||
// Component
|
||||
import PostDropdownView from '../view/postDropdownView';
|
||||
@ -40,7 +41,7 @@ class PostDropdownContainer extends PureComponent {
|
||||
|
||||
switch (index) {
|
||||
case '0':
|
||||
writeToClipboard(`https://steemit.com${content.url}`);
|
||||
writeToClipboard(getPostUrl(content.url));
|
||||
break;
|
||||
|
||||
case '1':
|
||||
@ -52,12 +53,26 @@ class PostDropdownContainer extends PureComponent {
|
||||
case '2':
|
||||
this._replyNavigation();
|
||||
break;
|
||||
case '3':
|
||||
setTimeout(() => {
|
||||
this._share();
|
||||
}, 500);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
_share = () => {
|
||||
const { content } = this.props;
|
||||
|
||||
Share.share({
|
||||
message: content.title,
|
||||
url: getPostUrl(content.url),
|
||||
});
|
||||
};
|
||||
|
||||
_reblog = () => {
|
||||
const {
|
||||
currentAccount, content, isLoggedIn, pinCode, intl,
|
||||
@ -115,7 +130,7 @@ class PostDropdownContainer extends PureComponent {
|
||||
return (
|
||||
<Fragment>
|
||||
<PostDropdownView
|
||||
options={OPTIONS}
|
||||
options={OPTIONS.map(item => intl.formatMessage({ id: `post_dropdown.${item}` }).toUpperCase())}
|
||||
handleOnDropdownSelect={this._handleOnDropdownSelect}
|
||||
{...this.props}
|
||||
/>
|
||||
|
@ -179,5 +179,11 @@
|
||||
"author_payout": "Author Payout",
|
||||
"curation_payout": "Curation Payout",
|
||||
"payout_date": "Payout"
|
||||
},
|
||||
"post_dropdown": {
|
||||
"copy": "copy link",
|
||||
"reblog": "reblog",
|
||||
"reply": "reply",
|
||||
"share": "share"
|
||||
}
|
||||
}
|
||||
|
@ -179,5 +179,11 @@
|
||||
"author_payout": "Автору",
|
||||
"curation_payout": "Кураторам",
|
||||
"payout_date": "Выплата"
|
||||
},
|
||||
"post_dropdown": {
|
||||
"copy": "copy link",
|
||||
"reblog": "reblog",
|
||||
"reply": "reply",
|
||||
"share": "share"
|
||||
}
|
||||
}
|
||||
|
@ -179,5 +179,11 @@
|
||||
"author_payout": "Yazar Ödemeleri",
|
||||
"curation_payout": "Küratör Ödemeleri",
|
||||
"payout_date": "Ödeme"
|
||||
},
|
||||
"post_dropdown": {
|
||||
"copy": "kopyala",
|
||||
"reblog": "reblog",
|
||||
"reply": "cevapla",
|
||||
"share": "paylaş"
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1 @@
|
||||
export default ['COPY LINK', 'REBLOG', 'REPLY'];
|
||||
|
||||
export const VALUE = ['copy', 'reblog', 'reply'];
|
||||
export default ['copy', 'reblog', 'reply', 'share'];
|
||||
|
@ -12,3 +12,9 @@ export const postSumTotal = (content) => {
|
||||
? parseToken(content.total_payout_value) + parseToken(content.curator_payout_value)
|
||||
: 0;
|
||||
};
|
||||
|
||||
export const getPostUrl = (url) => {
|
||||
const BASE_URL = 'https://steemit.com';
|
||||
|
||||
return BASE_URL + url;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user