Skip to content

Commit

Permalink
Ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dendidibe committed Jun 19, 2023
1 parent a7c18bd commit bce5727
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 45 deletions.
3 changes: 1 addition & 2 deletions client-reactnative/src/Screens/Chat/NewChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,12 @@ const NewChatScreen = (props: NewChatScreenProps) => {
{ roomName: chatName, roomDescription: chatDescription },
chatStore.xmpp
);

chatAvatar &&
setRoomImage(
manipulatedWalletAddress + "@" + apiStore.xmppDomains.DOMAIN,
roomHash + apiStore.xmppDomains.CONFERENCEDOMAIN,
chatAvatar,
"",
"none",
"icon",
chatStore.xmpp
);
Expand Down
79 changes: 41 additions & 38 deletions client-reactnative/src/components/Profile/ProfileTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import {useNavigation} from '@react-navigation/native';
import {HStack, VStack} from 'native-base';
import React, {useState} from 'react';
import {FlatList, Image, StyleSheet, Text, View} from 'react-native';
import { useNavigation } from "@react-navigation/native";
import { HStack, VStack } from "native-base";
import React, { useState } from "react";
import { FlatList, Image, StyleSheet, Text, View } from "react-native";
import {
coinImagePath,
coinReplacedName,
commonColors,
itemsTransfersAllowed,
textStyles,
} from '../../../docs/config';
import {IDocument, TBalance} from '../../stores/types';
import {NftListItem} from '../Transactions/NftListItem';
import {DocumentListItem} from './DocumentListItem';
import {ProfileTab} from './ProfileTab';
} from "../../../docs/config";
import { IDocument, TBalance } from "../../stores/types";
import { NftListItem } from "../Transactions/NftListItem";
import { DocumentListItem } from "./DocumentListItem";
import { ProfileTab } from "./ProfileTab";
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp,
} from 'react-native-responsive-screen';
import {NftMediaModal} from '../NftMediaModal';
import {HomeStackNavigationProp} from '../../navigation/types';
} from "react-native-responsive-screen";
import { NftMediaModal } from "../NftMediaModal";
import { HomeStackNavigationProp } from "../../navigation/types";

const renderItem = ({item, index}: {item: any; index: number}) => (
const renderItem = ({ item, index }: { item: any; index: number }) => (
<Item
tokenSymbol={item.tokenSymbol}
tokenName={item.tokenName}
Expand All @@ -39,18 +39,19 @@ const Item = ({
}) => (
<HStack
paddingX={10}
justifyContent={'space-between'}
alignItems={'center'}
width={'full'}>
<HStack justifyContent={'center'} alignItems={'center'}>
justifyContent={"space-between"}
alignItems={"center"}
width={"full"}
>
<HStack justifyContent={"center"} alignItems={"center"}>
<Image source={coinImagePath} style={styles.tokenIconStyle} />

<Text style={styles.coinsItemText}>{/* {tokenSymbol} */}</Text>
</HStack>
<VStack justifyContent={'center'} alignItems={'center'}>
<VStack justifyContent={"center"} alignItems={"center"}>
<Text style={styles.coinsItemText}>{coinReplacedName}</Text>
</VStack>
<VStack justifyContent={'center'} alignItems={'center'}>
<VStack justifyContent={"center"} alignItems={"center"}>
<Text style={[styles.coinsItemText]}>
{parseFloat(balance).toFixed(0)}
</Text>
Expand Down Expand Up @@ -109,14 +110,14 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({

const [mediaModalData, setMediaModalData] = useState({
open: false,
url: '',
mimetype: '',
url: "",
mimetype: "",
});

return (
<View style={{marginTop: hp('1%'), backgroundColor: 'white'}}>
<HStack paddingX={wp('4%')}>
{itemsTransfersAllowed && (
<View style={{ marginTop: hp("1%"), backgroundColor: "white" }}>
<HStack paddingX={wp("4%")}>
{itemsTransfersAllowed && !!nftItems.length && (
<ProfileTab
isTabActive={activeAssetTab === 1}
onPress={() => setActiveAssetTab(1)}
Expand All @@ -143,7 +144,7 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
)}
</HStack>

<View style={{marginBottom: hp('34%'), backgroundColor: 'white'}}>
<View style={{ marginBottom: hp("34%"), backgroundColor: "white" }}>
{activeAssetTab === 1 &&
nftItems.length === 0 &&
documents.length === 0 && (
Expand All @@ -154,14 +155,14 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
keyExtractor={(item, index) => index.toString()}
/>
)}
{activeAssetTab === 1 && (
{activeAssetTab === 1 && !!nftItems.length && (
<FlatList
data={nftItems}
renderItem={e => (
renderItem={(e) => (
<RenderAssetItem
item={e.item}
onClick={() =>
navigation.navigate('NftItemHistory', {
navigation.navigate("NftItemHistory", {
item: e.item,
userWalletAddress: userWalletAddress,
})
Expand All @@ -182,11 +183,11 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
{activeAssetTab === 2 && (
<FlatList
data={collections}
renderItem={e => (
renderItem={(e) => (
<RenderAssetItem
item={e.item}
onClick={() =>
navigation.navigate('NftItemHistory', {
navigation.navigate("NftItemHistory", {
item: e.item,
userWalletAddress: userWalletAddress,
})
Expand All @@ -207,7 +208,7 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
{activeAssetTab === 3 && (
<FlatList
data={documents}
renderItem={e => (
renderItem={(e) => (
<DocumentListItem
item={e.item}
onAssetPress={() =>
Expand All @@ -218,7 +219,7 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
})
}
onItemPress={() => {
navigation.navigate('DocumentHistoryScreen', {
navigation.navigate("DocumentHistoryScreen", {
item: e.item,
userWalletAddress: userWalletAddress,
});
Expand All @@ -232,7 +233,9 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({
</View>
<NftMediaModal
modalVisible={mediaModalData.open}
closeModal={() => setMediaModalData(prev => ({...prev, open: false}))}
closeModal={() =>
setMediaModalData((prev) => ({ ...prev, open: false }))
}
url={mediaModalData.url}
mimetype={mediaModalData.mimetype}
/>
Expand All @@ -242,21 +245,21 @@ export const ProfileTabs: React.FC<IProfileTabs> = ({

const styles = StyleSheet.create({
tokenIconStyle: {
height: hp('3%'),
width: hp('3%'),
height: hp("3%"),
width: hp("3%"),
},

mainContainerStyle: {
backgroundColor: commonColors.primaryDarkColor,
flex: 1,
},
tabText: {
fontSize: hp('1.97%'),
fontSize: hp("1.97%"),
fontFamily: textStyles.boldFont,
},
coinsItemText: {
fontFamily: textStyles.mediumFont,
fontSize: hp('1.97%'),
color: '#000000',
fontSize: hp("1.97%"),
color: "#000000",
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TransactionsListItem = (props: TransactionListProps) => {
<VStack ml={'2'}>
<Box>
<Text fontSize={hp('1.7%')} fontWeight={'bold'}>
{truncateString(name, 1)}
{truncateString(name, 15)}
</Text>
</Box>
<Box>
Expand Down
5 changes: 1 addition & 4 deletions client-reactnative/src/stores/walletStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,7 @@ export class WalletStore {
runInAction(() => {
this.offset = this.offset + response.data.limit;
this.total = response.data.total;
this.anotherUserTransaction = [
...this.anotherUserTransaction,
...response.data.items,
].map((item) => mapTransactions(item, walletAddress));
this.anotherUserTransaction = response.data.items.map((item) => mapTransactions(item, walletAddress));
});
}
} catch (error) {
Expand Down

0 comments on commit bce5727

Please sign in to comment.