Skip to content

Commit

Permalink
Merge pull request #5 from dappros/featuresSync
Browse files Browse the repository at this point in the history
ability to enable or disable NFT feature
  • Loading branch information
4RGUS authored Aug 16, 2021
2 parents 3249b17 + 2855160 commit 37cb5bc
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 159 deletions.
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

0 comments on commit 37cb5bc

Please sign in to comment.