Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to enable and disable NFT feature #5

Merged
merged 5 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions ios/ethora.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Screens/anotherUserProfileScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import CustomHeader from '../components/shared/customHeader';
import {CommonButton} from '../components/shared/customButtons';
import {Swipeable} from 'react-native-gesture-handler';
import {commonColors, textStyles, coinImagePath} from '../../docs/config';
import {commonColors, textStyles, coinImagePath, itemsTransfersAllowed} from '../../docs/config';


const {primaryColor, primaryDarkColor} = commonColors;
Expand Down Expand Up @@ -318,7 +318,7 @@ const loadTabContent = props => {
</Text>
</Animated.Text>
</TouchableOpacity>
<TouchableOpacity
{itemsTransfersAllowed && <TouchableOpacity
// onLayout={event =>
// this.setState({xCoinTabTwo: event.nativeEvent.layout.x})
// }
Expand All @@ -332,7 +332,7 @@ const loadTabContent = props => {
}}>
Items ({itemsBalance})
</Animated.Text>
</TouchableOpacity>
</TouchableOpacity>}
{/* </View> */}
</View>
<View style={{marginTop: hp('1.47%'), height: hp('43%')}}>
Expand Down Expand Up @@ -579,7 +579,7 @@ function AnotherProfile(props) {
updatedItemsBalance = updatedItemsBalance + parseFloat(item.balance);
});
setItemsBalance(updatedItemsBalance);
setAssetCount(updatedItemsBalance + updatedCoinBalance);
setAssetCount((itemsTransfersAllowed ? updatedItemsBalance : 0) + updatedCoinBalance);

return () => {};
}, [itemsData, coinData]);
Expand Down
88 changes: 59 additions & 29 deletions src/Screens/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,36 @@ class Chat extends Component {
viewPosition: 0,
});
}
onLongPressAvatar(m) {
let extraData = {};
if (!m._id.includes(xmppConstants.CONFERENCEDOMAIN)) {
const jid = m._id.split('@' + xmppConstants.DOMAIN)[0];
const walletFromJid = reverseUnderScoreManipulation(jid);
const token = this.props.loginReducer.token;
extraData = {
type: 'transfer',
amnt: null,
name: m.name,
message_id: m._id,
walletFromJid,
token,
senderName: this.state.name,
};
} else {
extraData = {
type: 'transfer',
amnt: null,
name: m.name,
message_id: m._id,
senderName: this.state.name,
};
}
this.setState({
showModal: true,
modalType: 'tokenTransfer',
extraData,
});
}

//lifecycle when the component gets updated
async componentDidUpdate(prevProps, prevState) {
Expand Down Expand Up @@ -845,33 +875,33 @@ class Chat extends Component {
formatedSize = this.formatBytes(parseFloat(size), 2);
console.log(formatedSize);
return(
<View
style={{
borderRadius: 5,
padding: 5,
width:hp("22%"),
height:hp("22%"),
justifyContent:"center"
}}
>
<TouchableOpacity onPress={()=>this.startDownload(props)} style={styles.downloadContainer}>

<View style={styles.sizeContainer}>
<Text style={styles.sizeTextStyle}>{formatedSize.size}</Text>
<Text style={styles.sizeTextStyle}>{formatedSize.unit}</Text>
</View>
<TouchableOpacity
onPress={() => this.startDownload(props)}

style={{
borderRadius: 5,
// padding: 5,
width: hp('24%'),
height: hp('24%'),
justifyContent: 'center',
}}>
<View
style={styles.downloadContainer}>
{/* <View style={styles.sizeContainer}>
<Text style={styles.sizeTextStyle}>{formatedSize.size}</Text>
<Text style={styles.sizeTextStyle}>{formatedSize.unit}</Text>
</View> */}
<FastImage
style={styles.messageImageContainer}
source={{
// @ts-ignore
uri: props.currentMessage.image,
priority: FastImage.priority.normal
}}
resizeMode={FastImage.resizeMode.cover}
/>

</TouchableOpacity>
</View>
style={styles.messageImageContainer}
source={{
// @ts-ignore
uri: props.currentMessage.image,
priority: FastImage.priority.normal,
}}
resizeMode={FastImage.resizeMode.cover}
/>
</View>
</TouchableOpacity>
)
}

Expand Down Expand Up @@ -1035,7 +1065,7 @@ class Chat extends Component {
renderMessage={this.renderMessage}
renderAvatarOnTop={true}
onLongPress={(e, m) => this.onLongPressMessage(e, m)}
onLongPressAvatar={e => this.onLongPressMessage(e)}
onLongPressAvatar={e => this.onLongPressAvatar(e)}
renderMessageImage = {this.renderMessageImage}
/>
<ModalList
Expand All @@ -1060,8 +1090,8 @@ const styles = StyleSheet.create({
alignItems:'center'
},
messageImageContainer:{
width:hp("20%"),
height:hp("20%"),
width:hp("22%"),
height:hp("22%"),
borderRadius:5
},
sizeContainer:{
Expand Down
2 changes: 1 addition & 1 deletion src/Screens/createNewChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class CreateNewGroup extends Component {

</View>
</TouchableOpacity>
<TextInput onChangeText={(chatName)=>this.setState({chatName})} placeholder="Chat name" placeholderTextColor={primaryColor} style={styles.textInputOuter} />
<TextInput onChangeText={(chatName)=>this.setState({chatName})} placeholder="Chat name" placeholderTextColor={primaryColor} style={styles.textInputOuter} maxLength={30} />
</View>

<TextInput scrollEnabled placeholder="Short description about the chat" placeholderTextColor={primaryColor} multiline style={styles.textFieldouter} numberOfLines={5} />
Expand Down
Loading