Add sharing button logics
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Text, ScrollView, FlatList, StyleSheet, View } from 'react-native';
|
import { Text, ScrollView, FlatList, StyleSheet, View, Share } from 'react-native';
|
||||||
import Hyperlink from 'react-native-hyperlink'
|
import Hyperlink from 'react-native-hyperlink'
|
||||||
import { Button, Card, Chip } from 'react-native-paper';
|
import { Button, Card, Chip } from 'react-native-paper';
|
||||||
import API from './../API.js';
|
import API from './../API.js';
|
||||||
@@ -12,6 +12,7 @@ import { useSnapshot } from 'valtio';
|
|||||||
import GlobalState from '../contexts/GlobalState.js';
|
import GlobalState from '../contexts/GlobalState.js';
|
||||||
import i18n from "../i18nMessages.js";
|
import i18n from "../i18nMessages.js";
|
||||||
|
|
||||||
|
|
||||||
let Post = (props) => {
|
let Post = (props) => {
|
||||||
const gState = useSnapshot(GlobalState);
|
const gState = useSnapshot(GlobalState);
|
||||||
const viewer = gState.me;
|
const viewer = gState.me;
|
||||||
@@ -90,7 +91,12 @@ let Post = (props) => {
|
|||||||
{likes}
|
{likes}
|
||||||
</Button>
|
</Button>
|
||||||
<Button icon="forum" labelStyle={{ fontSize: 18 }} style={{ flow: 1 }} onPress={() => { changeshowCommentsB(!showCommentsB) }} >{post.comments.length}</Button>
|
<Button icon="forum" labelStyle={{ fontSize: 18 }} style={{ flow: 1 }} onPress={() => { changeshowCommentsB(!showCommentsB) }} >{post.comments.length}</Button>
|
||||||
<Button icon="ios-share" style={{ flow: 1 }} labelStyle={{ fontSize: 18 }}></Button>
|
<Button icon="ios-share" style={{ flow: 1 }} labelStyle={{ fontSize: 18 }} onPress={()=>{
|
||||||
|
Share.share({
|
||||||
|
//message: "https://social.emmint.com/post/" + props.post._id,
|
||||||
|
url: "https://social.emmint.com/feed/post/" + props.post._id
|
||||||
|
});
|
||||||
|
}}></Button>
|
||||||
<Button
|
<Button
|
||||||
icon={!bookmarked ? "bookmark-outline" : "bookmark"}
|
icon={!bookmarked ? "bookmark-outline" : "bookmark"}
|
||||||
style={{ flow: 1 }}
|
style={{ flow: 1 }}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View, Share } from 'react-native';
|
||||||
import { Avatar, Button, Card, Title, Paragraph } from 'react-native-paper';
|
import { Avatar, Button, Card, Title, Paragraph } from 'react-native-paper';
|
||||||
import UserName from './UserName';
|
import UserName from './UserName';
|
||||||
import FollowButton from './basics/FollowButton';
|
import FollowButton from './basics/FollowButton';
|
||||||
@@ -31,6 +31,23 @@ const ProfileHeader = ({ profileObj }) => {
|
|||||||
}}>
|
}}>
|
||||||
<FollowButton profile={profileObj} />
|
<FollowButton profile={profileObj} />
|
||||||
</View>
|
</View>
|
||||||
|
<View style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: -290,
|
||||||
|
right: 80,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
backgroundColor: "#ddd",
|
||||||
|
borderRadius: 25,
|
||||||
|
opacity: 0.7
|
||||||
|
}}>
|
||||||
|
<Button icon="ios-share" labelStyle={{ fontSize: 24, paddingTop:10 }} onPress={() => {
|
||||||
|
Share.share({
|
||||||
|
message: "https://social.emmint.com/feed/" + profileObj._id,
|
||||||
|
title: profileObj.profile.firstName + " " + profileObj.profile.lastName
|
||||||
|
});
|
||||||
|
}}></Button>
|
||||||
|
</View>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card>
|
</Card>
|
||||||
{/*
|
{/*
|
||||||
|
|||||||
Reference in New Issue
Block a user