added less inforatmion status

This commit is contained in:
ue 2018-10-04 21:46:39 +03:00
parent 074906643e
commit f37b3f5544
10 changed files with 110 additions and 58 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

BIN
src/assets/no_post.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

View File

@ -1,5 +1,6 @@
import LineBreak from "./view/lineBreakView";
import TextWithIcon from "./view/textWithIconView";
import PercentBar from "./view/percentBarView";
import NoPost from "./view/noPostView";
export { LineBreak, TextWithIcon, PercentBar };
export { LineBreak, TextWithIcon, PercentBar, NoPost };

View File

@ -0,0 +1,21 @@
import EStyleSheet from "react-native-extended-stylesheet";
export default EStyleSheet.create({
wrapper: {
flexDirection: "column",
alignItems: "center",
height: "$deviceHeight",
backgroundColor: "$white",
},
image: {
width: "$deviceWidth - 40",
height: 192,
marginTop: 16,
},
text: {
color: "$primaryGray",
fontSize: 14,
marginTop: 12,
fontWeight: "bold",
},
});

View File

@ -0,0 +1,13 @@
import React from "react";
import { View, Text, Image, ScrollView } from "react-native";
import NO_POST from "../../../assets/no_post.png";
import styles from "./noPostStyles";
const NoPost = ({ text, name }) => (
<View style={styles.wrapper}>
<Image style={styles.image} source={NO_POST} />
<Text style={styles.text}>{"@" + name + " " + text}</Text>
</View>
);
export default NoPost;

View File

@ -11,13 +11,13 @@ const TextWithIcon = ({ iconName, text, isClickable, onPress }) => (
onPress={() => onPress && onPress()}
>
<View style={styles.wrapper}>
<Ionicons style={styles.icon} name={iconName} />
{text && <Ionicons style={styles.icon} name={iconName} />}
<Text style={styles.text}>{text}</Text>
</View>
</TouchableHighlight>
) : (
<View style={styles.wrapper}>
<Ionicons style={styles.icon} name={iconName} />
{text && <Ionicons style={styles.icon} name={iconName} />}
<Text style={styles.text}>{text}</Text>
</View>
)}

View File

@ -63,7 +63,7 @@ class CollapsibleCardView extends Component {
};
render() {
const { title, children, isLoading } = this.props;
const { title, children, defaultTitle } = this.props;
const { expanded } = this.state;
return (
@ -77,6 +77,7 @@ class CollapsibleCardView extends Component {
color="#788187"
fontSize={12}
title={title}
defaultTitle={defaultTitle}
iconName={expanded ? "md-arrow-dropdown" : "md-arrow-dropup"}
/>
</TouchableHighlight>

View File

@ -26,12 +26,13 @@ class ContainerHeaderView extends Component {
render() {
const {
title,
isBoldTitle,
color,
hasSeperator,
defaultTitle,
fontSize,
hasSeperator,
iconName,
isBoldTitle,
title,
} = this.props;
return (
@ -44,7 +45,7 @@ class ContainerHeaderView extends Component {
fontSize && { fontSize: fontSize },
]}
>
{title}
{title ? title : defaultTitle}
</Text>
{iconName && <Ionicons style={styles.icon} name={iconName} />}
</View>

View File

@ -3,7 +3,7 @@ import { View, Image, Text } from "react-native";
import { DropdownButton } from "../../../components/dropdownButton";
// Constants
import TEMP_IMAGE from "../../../assets/drawer-cover.png";
import DEFAULT_IMAGE from "../../../assets/default_cover_image.png";
// Components
import { TextWithIcon } from "../../basicUIElements";
@ -59,7 +59,7 @@ class ProfileSummaryView extends Component {
<Image
style={styles.longImage}
source={{ uri: coverImage }}
defaultSource={TEMP_IMAGE}
defaultSource={DEFAULT_IMAGE}
/>
<PercentBar percent={percent} margin={24}>
<View style={styles.percentTitleWrapper}>

View File

@ -8,13 +8,11 @@ import FastImage from "react-native-fast-image";
// Components
import ScrollableTabView from "@esteemapp/react-native-scrollable-tab-view";
import { TabBar } from "../../../components/tabBar";
import DiscoverPage from "../../discover/discover";
import { PostCard } from "../../../components/postCard";
import { ProfileSummary } from "../../../components/profileSummary";
import Comment from "../../../components/comment/comment";
import { FilterBar } from "../../../components/filterBar";
import { DropdownButton } from "../../../components/dropdownButton";
import { NoPost } from "../../../components/basicUIElements";
// Utilitites
import { getUserData, getAuthStatus } from "../../../realm/realm";
import {
@ -176,36 +174,45 @@ class ProfileScreen extends React.Component {
});
};
_getPostRenderItem = () => {};
render() {
const {
user,
follows,
about,
posts,
commments,
isLoggedIn,
isLoading,
about,
} = this.state;
let _about, cover_image, location, website;
const votingPower = user && user.voting_power && user.voting_power / 100;
const fullInHour = Math.ceil((100 - votingPower) * 0.833333);
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
if (about) {
location = about.location;
_about = about.about;
website = about.website;
cover_image = about.cover_image;
}
console.log(this.state);
console.log(this.props);
const votingPower = user.voting_power && user.voting_power / 100;
const fullIn = Math.ceil((100 - votingPower) * 0.833333);
return (
<View style={styles.container}>
<CollapsibleCard title={about.about} expanded={true}>
<CollapsibleCard
title={_about}
defaultTitle="Profile details"
expanded={true}
>
<ProfileSummary
percent={votingPower}
hours={fullIn}
location={about.location}
link={about.website}
date={getFormatedCreatedDate(user.created)}
hours={fullInHour}
location={location}
link={website}
date={getFormatedCreatedDate(user && user.created)}
followerCount={follows.follower_count}
followingCount={follows.following_count}
coverImage={about.cover_image}
coverImage={cover_image}
/>
</CollapsibleCard>
@ -236,6 +243,7 @@ class ProfileScreen extends React.Component {
onDropdownSelect={this._handleOnDropdownSelect}
rightIconName="md-apps"
/>
{posts && posts.length > 0 ? (
<FlatList
data={posts}
showsVerticalScrollIndicator={false}
@ -258,8 +266,12 @@ class ProfileScreen extends React.Component {
onEndThreshold={0}
bounces={false}
/>
) : (
<NoPost name={user.name} text="haven't posted anything yet" />
)}
</View>
<View tabLabel="Comments" style={styles.commentsTabBar}>
{commments && commments.length > 0 ? (
<FlatList
data={commments}
showsVerticalScrollIndicator={false}
@ -270,6 +282,9 @@ class ProfileScreen extends React.Component {
onEndThreshold={0}
bounces={false}
/>
) : (
<NoPost name={user.name} text="haven't commented anything yet" />
)}
</View>
<View tabLabel={"$" + user.balance}>
<Card>