mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 12:21:31 +03:00
commit
bfffe0cebe
@ -38,7 +38,7 @@ class PostButtonView extends Component {
|
||||
if (this.mode._value) {
|
||||
const { routes, isCollapsePostButtonOpen } = this.props;
|
||||
const nextRouteName = nextProps.routes[0].routes[nextProps.routes[0].routes.length - 1].routeName;
|
||||
const routeName = routes[0].routes[routes[0].routes.length - 1].routeName;
|
||||
const { routeName } = routes[0].routes[routes[0].routes.length - 1];
|
||||
const { isCollapse } = this.state;
|
||||
|
||||
if (
|
||||
|
@ -35,7 +35,7 @@ class PostButtonsForAndroid extends Component {
|
||||
// For closing sub buttons
|
||||
const { routes, isCollapsePostButtonOpen } = this.props;
|
||||
const nextRouteName = nextProps.routes[0].routes[nextProps.routes[0].routes.length - 1].routeName;
|
||||
const routeName = routes[0].routes[routes[0].routes.length - 1].routeName;
|
||||
const { routeName } = routes[0].routes[routes[0].routes.length - 1];
|
||||
const { isCollapse } = this.state;
|
||||
|
||||
if (
|
||||
|
@ -32,7 +32,7 @@ class PostHeaderDescription extends PureComponent {
|
||||
}
|
||||
|
||||
// Component Functions
|
||||
_handleOnUserPress = username => {
|
||||
_handleOnUserPress = (username) => {
|
||||
const { navigation, profileOnPress, reputation } = this.props;
|
||||
|
||||
if (profileOnPress) {
|
||||
|
@ -189,7 +189,7 @@ export const updateUserData = userData => new Promise((resolve, reject) => {
|
||||
|
||||
export const removeUserData = username => new Promise((resolve, reject) => {
|
||||
try {
|
||||
const account = realm.objects(USER_SCHEMA).filtered('username = $0', username)
|
||||
const account = realm.objects(USER_SCHEMA).filtered('username = $0', username);
|
||||
if (Array.from(account).length > 0) {
|
||||
realm.write(() => {
|
||||
realm.delete(account);
|
||||
|
@ -175,7 +175,7 @@ class ApplicationContainer extends Component {
|
||||
|
||||
await getAuthStatus().then((res) => {
|
||||
({ currentUsername } = res);
|
||||
|
||||
|
||||
if (res) {
|
||||
getUserData().then(async (userData) => {
|
||||
if (userData.length > 0) {
|
||||
|
@ -42,7 +42,9 @@ class ApplicationScreen extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isConnected, isDarkTheme, locale, toastNotification } = this.props;
|
||||
const {
|
||||
isConnected, isDarkTheme, locale, toastNotification,
|
||||
} = this.props;
|
||||
const { isShowToastNotification } = this.state;
|
||||
const barStyle = isDarkTheme ? 'light-content' : 'dark-content';
|
||||
const barColor = isDarkTheme ? '#1e2835' : '#fff';
|
||||
|
@ -2,6 +2,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 ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Utils
|
||||
import { getPostSummary } from '../../../utils/formatter';
|
||||
@ -13,7 +14,6 @@ import { BasicHeader } from '../../../components/basicHeader';
|
||||
import { PostListItem } from '../../../components/postListItem';
|
||||
import { PostCardPlaceHolder } from '../../../components/basicUIElements';
|
||||
import { TabBar } from '../../../components/tabBar';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Styles
|
||||
import globalStyles from '../../../globalStyles';
|
||||
@ -29,7 +29,7 @@ class DraftsScreen extends Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedId: null,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
@ -56,7 +56,7 @@ class DraftsScreen extends Component {
|
||||
image={image ? { uri: catchDraftImage(item.body) } : null}
|
||||
username={currentAccount.name}
|
||||
reputation={currentAccount.reputation}
|
||||
handleOnPressItem={() => isSchedules ? this.setState({selectedId: item._id}, () => this.ActionSheet.show()) : editDraft}
|
||||
handleOnPressItem={() => (isSchedules ? this.setState({ selectedId: item._id }, () => this.ActionSheet.show()) : editDraft)}
|
||||
handleOnRemoveItem={isSchedules ? removeSchedule : removeDraft}
|
||||
id={item._id}
|
||||
key={item._id}
|
||||
@ -97,7 +97,9 @@ class DraftsScreen extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { drafts, schedules, intl, moveScheduleToDraft } = this.props;
|
||||
const {
|
||||
drafts, schedules, intl, moveScheduleToDraft,
|
||||
} = this.props;
|
||||
const { selectedId } = this.state;
|
||||
|
||||
return (
|
||||
|
@ -287,7 +287,7 @@ class PinCodeContainer extends Component {
|
||||
[
|
||||
{ text: intl.formatMessage({ id: 'alert.clear' }), onPress: () => this._forgotPinCode() },
|
||||
{ text: intl.formatMessage({ id: 'alert.cancel' }), style: 'destructive' },
|
||||
]
|
||||
],
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -84,11 +84,11 @@ export const makeJsonMetadataReply = tags => ({
|
||||
});
|
||||
|
||||
export const makeJsonMetadata = (meta, tags) => Object.assign({}, meta, {
|
||||
tags,
|
||||
app: 'esteem/2.0.0-mobile',
|
||||
format: 'markdown+html',
|
||||
community: 'esteem.app',
|
||||
});
|
||||
tags,
|
||||
app: 'esteem/2.0.0-mobile',
|
||||
format: 'markdown+html',
|
||||
community: 'esteem.app',
|
||||
});
|
||||
|
||||
export const extractMetadata = (body) => {
|
||||
const urlReg = /(\b(https?|ftp):\/\/[A-Z0-9+&@#/%?=~_|!:,.;-]*[-A-Z0-9+&@#/%=~_|])/gim;
|
||||
|
@ -24,7 +24,7 @@ const imgTagRegex = /(<img[^>]*>)/g;
|
||||
const iframeRegex = /(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/g;
|
||||
const hTagRegex = /(<h([1-6])>([^<]*)<\/h([1-6])>)/g;
|
||||
|
||||
export const markDown2Html = input => {
|
||||
export const markDown2Html = (input) => {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
@ -95,192 +95,178 @@ export const markDown2Html = input => {
|
||||
return output;
|
||||
};
|
||||
|
||||
const replaceAuthorNames = input =>
|
||||
input.replace(authorNameRegex, (match, preceeding1, preceeding2, user) => {
|
||||
const userLower = user.toLowerCase();
|
||||
const preceedings = (preceeding1 || '') + (preceeding2 || '');
|
||||
return `${preceedings}<a class="markdown-author-link" href="${userLower}" data-author="${userLower}"> @${user}</a>`;
|
||||
});
|
||||
const replaceAuthorNames = input => input.replace(authorNameRegex, (match, preceeding1, preceeding2, user) => {
|
||||
const userLower = user.toLowerCase();
|
||||
const preceedings = (preceeding1 || '') + (preceeding2 || '');
|
||||
return `${preceedings}<a class="markdown-author-link" href="${userLower}" data-author="${userLower}"> @${user}</a>`;
|
||||
});
|
||||
|
||||
const replaceTags = input =>
|
||||
input.replace(tagsRegex, tag => {
|
||||
if (/#[\d]+$/.test(tag)) return tag;
|
||||
const preceding = /^\s|>/.test(tag) ? tag[0] : '';
|
||||
tag = tag.replace('>', '');
|
||||
const tag2 = tag.trim().substring(1);
|
||||
const tagLower = tag2.toLowerCase();
|
||||
return `${preceding}<a class="markdown-tag-link" href="${tagLower}" data-tag="${tagLower}">${tag.trim()}</a>`;
|
||||
});
|
||||
const replaceTags = input => input.replace(tagsRegex, (tag) => {
|
||||
if (/#[\d]+$/.test(tag)) return tag;
|
||||
const preceding = /^\s|>/.test(tag) ? tag[0] : '';
|
||||
tag = tag.replace('>', '');
|
||||
const tag2 = tag.trim().substring(1);
|
||||
const tagLower = tag2.toLowerCase();
|
||||
return `${preceding}<a class="markdown-tag-link" href="${tagLower}" data-tag="${tagLower}">${tag.trim()}</a>`;
|
||||
});
|
||||
|
||||
const handleATag = input =>
|
||||
input.replace(aTagRegex, link => {
|
||||
if (dTubeRegex.test(link)) {
|
||||
const dTubeMatch = link.match(dTubeRegex)[0];
|
||||
const execLink = dTubeRegex.exec(dTubeMatch);
|
||||
const handleATag = input => input.replace(aTagRegex, (link) => {
|
||||
if (dTubeRegex.test(link)) {
|
||||
const dTubeMatch = link.match(dTubeRegex)[0];
|
||||
const execLink = dTubeRegex.exec(dTubeMatch);
|
||||
|
||||
if (execLink[2] && execLink[3]) {
|
||||
const embedLink = `https://emb.d.tube/#!/${execLink[2]}/${execLink[3]}`;
|
||||
|
||||
return iframeBody(embedLink);
|
||||
}
|
||||
if (dTubeMatch) {
|
||||
return iframeBody(dTubeMatch);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
if (imgRegex.test(link)) {
|
||||
const imgMatch = link.match(imgRegex)[0];
|
||||
|
||||
if (imgMatch) return `<a src="${imgMatch}">Image</a>`;
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const handleHTag = input => input.replace(hTagRegex, tag => `<div>${tag}</div>`);
|
||||
|
||||
const handleMarkdownLink = input =>
|
||||
input.replace(copiedPostRegex, link => {
|
||||
const postMatch = link.match(copiedPostRegex);
|
||||
|
||||
if (postMatch) {
|
||||
let tag = postMatch[1];
|
||||
|
||||
if (tag === '/busy.org') {
|
||||
tag = 'busy';
|
||||
}
|
||||
|
||||
const _permlink =
|
||||
postMatch[3].indexOf(')') > 0 ? postMatch[3].replace(')', '') : postMatch[3];
|
||||
|
||||
return `<a class="markdown-post-link" href="${_permlink}" data_tag={${tag.trim()}} data_author="${postMatch[2].replace(
|
||||
'@',
|
||||
'',
|
||||
)}">/${_permlink}</a>`;
|
||||
}
|
||||
});
|
||||
|
||||
const handleLinks = input =>
|
||||
input.replace(linkRegex, link => {
|
||||
if (link) {
|
||||
if (
|
||||
link
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.indexOf('https://steemitimages.com/0x0/') === 0 ||
|
||||
imgRegex.test(link)
|
||||
) {
|
||||
const imageMatch = link.match(imgRegex);
|
||||
|
||||
if (imageMatch) {
|
||||
if (imageMatch[0].indexOf('.gif') > 0) {
|
||||
return gifBody(imageMatch[0]);
|
||||
}
|
||||
|
||||
if (imageMatch[0]) {
|
||||
return imageBody(imageMatch[0]);
|
||||
}
|
||||
} else if (link.trim().indexOf('ipfs.busy.org') > 0) {
|
||||
return imageBody(link);
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
if (link.trim().indexOf('ipfs.busy.org') > 0) {
|
||||
return imageBody(link);
|
||||
}
|
||||
|
||||
if (imgRegex.test(link)) {
|
||||
return imageBody(link);
|
||||
}
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const changeMarkdownImage = input =>
|
||||
input.replace(markdownImageRegex, link => {
|
||||
const markdownMatch = link.match(markdownImageRegex);
|
||||
if (markdownMatch[0]) {
|
||||
const firstMarkdownMatch = markdownMatch[0];
|
||||
const _link = firstMarkdownMatch.match(urlRegex)[0];
|
||||
|
||||
return _link;
|
||||
}
|
||||
return link;
|
||||
});
|
||||
|
||||
const centerStyling = input =>
|
||||
input.replace(
|
||||
centerRegex,
|
||||
() => '<center style="text-align: center; align-items: center; justify-content: center;">',
|
||||
);
|
||||
|
||||
const steemitUrlHandle = input =>
|
||||
input.replace(postRegex, link => {
|
||||
const postMatch = link.match(postRegex);
|
||||
const tag = postMatch[2];
|
||||
const author = postMatch[3].replace('@', '');
|
||||
const permlink = postMatch[4];
|
||||
|
||||
return `<a class="markdown-post-link" href="${permlink}" data_tag={${tag}} data_author="${author}">/${permlink}</a>`;
|
||||
});
|
||||
|
||||
const handleImageTag = input =>
|
||||
input.replace(imgTagRegex, imgTag => {
|
||||
const _imgTag = imgTag.trim();
|
||||
const match = _imgTag.match(imgRegex);
|
||||
|
||||
if (match && match[0]) {
|
||||
return match[0];
|
||||
}
|
||||
|
||||
return imgTag;
|
||||
});
|
||||
|
||||
const createYoutubeIframe = input =>
|
||||
input.replace(youTubeRegex, link => {
|
||||
if (link.indexOf(')') || link.indexOf('(')) {
|
||||
return link;
|
||||
}
|
||||
|
||||
const execVideo = youTubeRegex.exec(link);
|
||||
const match = link.match(youTubeRegex);
|
||||
|
||||
if (execVideo[1] && match) {
|
||||
const videoLink = execVideo[1];
|
||||
const embedLink = `https://www.youtube.com/embed/${videoLink}`;
|
||||
if (execLink[2] && execLink[3]) {
|
||||
const embedLink = `https://emb.d.tube/#!/${execLink[2]}/${execLink[3]}`;
|
||||
|
||||
return iframeBody(embedLink);
|
||||
}
|
||||
|
||||
if (dTubeMatch) {
|
||||
return iframeBody(dTubeMatch);
|
||||
}
|
||||
return link;
|
||||
});
|
||||
}
|
||||
|
||||
const handleIframe = input =>
|
||||
input.replace(iframeRegex, link => {
|
||||
const match = link.match(linkRegex);
|
||||
if (imgRegex.test(link)) {
|
||||
const imgMatch = link.match(imgRegex)[0];
|
||||
|
||||
if (match && match[0]) {
|
||||
return iframeBody(match[0]);
|
||||
if (imgMatch) return `<a src="${imgMatch}">Image</a>`;
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const handleHTag = input => input.replace(hTagRegex, tag => `<div>${tag}</div>`);
|
||||
|
||||
const handleMarkdownLink = input => input.replace(copiedPostRegex, (link) => {
|
||||
const postMatch = link.match(copiedPostRegex);
|
||||
|
||||
if (postMatch) {
|
||||
let tag = postMatch[1];
|
||||
|
||||
if (tag === '/busy.org') {
|
||||
tag = 'busy';
|
||||
}
|
||||
|
||||
const _permlink = postMatch[3].indexOf(')') > 0 ? postMatch[3].replace(')', '') : postMatch[3];
|
||||
|
||||
return `<a class="markdown-post-link" href="${_permlink}" data_tag={${tag.trim()}} data_author="${postMatch[2].replace(
|
||||
'@',
|
||||
'',
|
||||
)}">/${_permlink}</a>`;
|
||||
}
|
||||
});
|
||||
|
||||
const handleLinks = input => input.replace(linkRegex, (link) => {
|
||||
if (link) {
|
||||
if (
|
||||
link
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.indexOf('https://steemitimages.com/0x0/') === 0
|
||||
|| imgRegex.test(link)
|
||||
) {
|
||||
const imageMatch = link.match(imgRegex);
|
||||
|
||||
if (imageMatch) {
|
||||
if (imageMatch[0].indexOf('.gif') > 0) {
|
||||
return gifBody(imageMatch[0]);
|
||||
}
|
||||
|
||||
if (imageMatch[0]) {
|
||||
return imageBody(imageMatch[0]);
|
||||
}
|
||||
} else if (link.trim().indexOf('ipfs.busy.org') > 0) {
|
||||
return imageBody(link);
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
if (link.trim().indexOf('ipfs.busy.org') > 0) {
|
||||
return imageBody(link);
|
||||
}
|
||||
|
||||
if (imgRegex.test(link)) {
|
||||
return imageBody(link);
|
||||
}
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) => {
|
||||
const markdownMatch = link.match(markdownImageRegex);
|
||||
if (markdownMatch[0]) {
|
||||
const firstMarkdownMatch = markdownMatch[0];
|
||||
const _link = firstMarkdownMatch.match(urlRegex)[0];
|
||||
|
||||
return _link;
|
||||
}
|
||||
return link;
|
||||
});
|
||||
|
||||
const centerStyling = input => input.replace(
|
||||
centerRegex,
|
||||
() => '<center style="text-align: center; align-items: center; justify-content: center;">',
|
||||
);
|
||||
|
||||
const steemitUrlHandle = input => input.replace(postRegex, (link) => {
|
||||
const postMatch = link.match(postRegex);
|
||||
const tag = postMatch[2];
|
||||
const author = postMatch[3].replace('@', '');
|
||||
const permlink = postMatch[4];
|
||||
|
||||
return `<a class="markdown-post-link" href="${permlink}" data_tag={${tag}} data_author="${author}">/${permlink}</a>`;
|
||||
});
|
||||
|
||||
const handleImageTag = input => input.replace(imgTagRegex, (imgTag) => {
|
||||
const _imgTag = imgTag.trim();
|
||||
const match = _imgTag.match(imgRegex);
|
||||
|
||||
if (match && match[0]) {
|
||||
return match[0];
|
||||
}
|
||||
|
||||
return imgTag;
|
||||
});
|
||||
|
||||
const createYoutubeIframe = input => input.replace(youTubeRegex, (link) => {
|
||||
if (link.indexOf(')') || link.indexOf('(')) {
|
||||
return link;
|
||||
});
|
||||
}
|
||||
|
||||
const createVimeoIframe = input =>
|
||||
input.replace(vimeoRegex, link => {
|
||||
const execLink = vimeoRegex.exec(link);
|
||||
const execVideo = youTubeRegex.exec(link);
|
||||
const match = link.match(youTubeRegex);
|
||||
|
||||
const embedLink = `https://player.vimeo.com/video/${execLink[3]}`;
|
||||
if (execVideo[1] && match) {
|
||||
const videoLink = execVideo[1];
|
||||
const embedLink = `https://www.youtube.com/embed/${videoLink}`;
|
||||
|
||||
return iframeBody(embedLink);
|
||||
});
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const handleIframe = input => input.replace(iframeRegex, (link) => {
|
||||
const match = link.match(linkRegex);
|
||||
|
||||
if (match && match[0]) {
|
||||
return iframeBody(match[0]);
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const createVimeoIframe = input => input.replace(vimeoRegex, (link) => {
|
||||
const execLink = vimeoRegex.exec(link);
|
||||
|
||||
const embedLink = `https://player.vimeo.com/video/${execLink[3]}`;
|
||||
|
||||
return iframeBody(embedLink);
|
||||
});
|
||||
|
||||
const iframeBody = link => `<iframe frameborder='0' allowfullscreen src='${link}'></iframe>`;
|
||||
const imageBody = link =>
|
||||
`<center style="text-align: center; align-items: center; justify-content: center;"><img src="${`https://steemitimages.com/600x0/${link}`}" /></center>`;
|
||||
const imageBody = link => `<center style="text-align: center; align-items: center; justify-content: center;"><img src="${`https://steemitimages.com/600x0/${link}`}" /></center>`;
|
||||
const gifBody = link => `<img src="${`https://steemitimages.com/0x0/${link}`}" />`;
|
||||
const handleImageLink = input => input.replace(imgRegex, link => imageBody(link));
|
||||
|
||||
|
@ -3,8 +3,9 @@ import { markDown2Html } from './markdownToHtml';
|
||||
import { getPostSummary } from './formatter';
|
||||
import { getReputation } from './reputation';
|
||||
|
||||
export const parsePosts = (posts, currentUserName) =>
|
||||
!posts ? null : posts.map(post => parsePost(post, currentUserName));
|
||||
export const parsePosts = (posts, currentUserName) => (
|
||||
!posts ? null : posts.map(post => parsePost(post, currentUserName))
|
||||
);
|
||||
|
||||
export const parsePost = (post, currentUserName) => {
|
||||
if (!post) {
|
||||
@ -32,10 +33,9 @@ export const parsePost = (post, currentUserName) => {
|
||||
post.is_voted = false;
|
||||
}
|
||||
|
||||
const totalPayout =
|
||||
parseFloat(post.pending_payout_value) +
|
||||
parseFloat(post.total_payout_value) +
|
||||
parseFloat(post.curator_payout_value);
|
||||
const totalPayout = parseFloat(post.pending_payout_value)
|
||||
+ parseFloat(post.total_payout_value)
|
||||
+ parseFloat(post.curator_payout_value);
|
||||
|
||||
post.total_payout = totalPayout.toFixed(3);
|
||||
|
||||
@ -44,8 +44,7 @@ export const parsePost = (post, currentUserName) => {
|
||||
|
||||
if (post.active_votes && post.active_votes.length > 0) {
|
||||
for (const i in post.active_votes) {
|
||||
post.vote_perecent =
|
||||
post.active_votes[i].voter === currentUserName ? post.active_votes[i].percent : null;
|
||||
post.vote_perecent = post.active_votes[i].voter === currentUserName ? post.active_votes[i].percent : null;
|
||||
post.active_votes[i].value = (post.active_votes[i].rshares * ratio).toFixed(3);
|
||||
post.active_votes[i].reputation = getReputation(post.active_votes[i].reputation);
|
||||
post.active_votes[i].percent = post.active_votes[i].percent / 100;
|
||||
@ -59,8 +58,7 @@ export const parsePost = (post, currentUserName) => {
|
||||
return post;
|
||||
};
|
||||
|
||||
const isVoted = (activeVotes, currentUserName) =>
|
||||
activeVotes.some(v => v.voter === currentUserName && v.percent > 0);
|
||||
const isVoted = (activeVotes, currentUserName) => activeVotes.some(v => v.voter === currentUserName && v.percent > 0);
|
||||
|
||||
const postImage = (metaData, body) => {
|
||||
const imgTagRegex = /(<img[^>]*>)/g;
|
||||
@ -135,8 +133,8 @@ const postImage = (metaData, body) => {
|
||||
// }
|
||||
// };
|
||||
|
||||
export const parseComments = comments => {
|
||||
comments.map(comment => {
|
||||
export const parseComments = (comments) => {
|
||||
comments.map((comment) => {
|
||||
comment.pending_payout_value = parseFloat(comment.pending_payout_value).toFixed(3);
|
||||
comment.vote_count = comment.active_votes.length;
|
||||
comment.author_reputation = getReputation(comment.author_reputation);
|
||||
|
@ -1,27 +1,27 @@
|
||||
import { Linking } from 'react-native';
|
||||
import qs from 'qs';
|
||||
|
||||
export const sendEmail = async (to, subject, body, options = {}) => {
|
||||
export const sendEmail = async (to, subject, body, options = {}) => {
|
||||
const { cc, bcc } = options;
|
||||
|
||||
let url = `mailto:${to}`;
|
||||
let url = `mailto:${to}`;
|
||||
|
||||
const query = qs.stringify({
|
||||
const query = qs.stringify({
|
||||
subject,
|
||||
body,
|
||||
cc,
|
||||
bcc,
|
||||
});
|
||||
|
||||
if (query.length) {
|
||||
if (query.length) {
|
||||
url += `?${query}`;
|
||||
}
|
||||
|
||||
const canOpen = await Linking.canOpenURL(url);
|
||||
const canOpen = await Linking.canOpenURL(url);
|
||||
|
||||
if (!canOpen) {
|
||||
if (!canOpen) {
|
||||
throw new Error('Provided URL can not be handled');
|
||||
}
|
||||
|
||||
return Linking.openURL(url);
|
||||
};
|
||||
return Linking.openURL(url);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user