mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-01 00:43:12 +03:00
added less inforatmion status
This commit is contained in:
parent
074906643e
commit
f37b3f5544
BIN
src/assets/default_cover_image.png
Normal file
BIN
src/assets/default_cover_image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
BIN
src/assets/no_post.png
Normal file
BIN
src/assets/no_post.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 306 KiB |
@ -1,5 +1,6 @@
|
|||||||
import LineBreak from "./view/lineBreakView";
|
import LineBreak from "./view/lineBreakView";
|
||||||
import TextWithIcon from "./view/textWithIconView";
|
import TextWithIcon from "./view/textWithIconView";
|
||||||
import PercentBar from "./view/percentBarView";
|
import PercentBar from "./view/percentBarView";
|
||||||
|
import NoPost from "./view/noPostView";
|
||||||
|
|
||||||
export { LineBreak, TextWithIcon, PercentBar };
|
export { LineBreak, TextWithIcon, PercentBar, NoPost };
|
||||||
|
21
src/components/basicUIElements/view/noPostStyles.js
Normal file
21
src/components/basicUIElements/view/noPostStyles.js
Normal 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",
|
||||||
|
},
|
||||||
|
});
|
13
src/components/basicUIElements/view/noPostView.js
Normal file
13
src/components/basicUIElements/view/noPostView.js
Normal 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;
|
@ -11,13 +11,13 @@ const TextWithIcon = ({ iconName, text, isClickable, onPress }) => (
|
|||||||
onPress={() => onPress && onPress()}
|
onPress={() => onPress && onPress()}
|
||||||
>
|
>
|
||||||
<View style={styles.wrapper}>
|
<View style={styles.wrapper}>
|
||||||
<Ionicons style={styles.icon} name={iconName} />
|
{text && <Ionicons style={styles.icon} name={iconName} />}
|
||||||
<Text style={styles.text}>{text}</Text>
|
<Text style={styles.text}>{text}</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableHighlight>
|
</TouchableHighlight>
|
||||||
) : (
|
) : (
|
||||||
<View style={styles.wrapper}>
|
<View style={styles.wrapper}>
|
||||||
<Ionicons style={styles.icon} name={iconName} />
|
{text && <Ionicons style={styles.icon} name={iconName} />}
|
||||||
<Text style={styles.text}>{text}</Text>
|
<Text style={styles.text}>{text}</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
@ -63,7 +63,7 @@ class CollapsibleCardView extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { title, children, isLoading } = this.props;
|
const { title, children, defaultTitle } = this.props;
|
||||||
const { expanded } = this.state;
|
const { expanded } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -77,6 +77,7 @@ class CollapsibleCardView extends Component {
|
|||||||
color="#788187"
|
color="#788187"
|
||||||
fontSize={12}
|
fontSize={12}
|
||||||
title={title}
|
title={title}
|
||||||
|
defaultTitle={defaultTitle}
|
||||||
iconName={expanded ? "md-arrow-dropdown" : "md-arrow-dropup"}
|
iconName={expanded ? "md-arrow-dropdown" : "md-arrow-dropup"}
|
||||||
/>
|
/>
|
||||||
</TouchableHighlight>
|
</TouchableHighlight>
|
||||||
|
@ -26,12 +26,13 @@ class ContainerHeaderView extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
title,
|
|
||||||
isBoldTitle,
|
|
||||||
color,
|
color,
|
||||||
hasSeperator,
|
defaultTitle,
|
||||||
fontSize,
|
fontSize,
|
||||||
|
hasSeperator,
|
||||||
iconName,
|
iconName,
|
||||||
|
isBoldTitle,
|
||||||
|
title,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -44,7 +45,7 @@ class ContainerHeaderView extends Component {
|
|||||||
fontSize && { fontSize: fontSize },
|
fontSize && { fontSize: fontSize },
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{title}
|
{title ? title : defaultTitle}
|
||||||
</Text>
|
</Text>
|
||||||
{iconName && <Ionicons style={styles.icon} name={iconName} />}
|
{iconName && <Ionicons style={styles.icon} name={iconName} />}
|
||||||
</View>
|
</View>
|
||||||
|
@ -3,7 +3,7 @@ import { View, Image, Text } from "react-native";
|
|||||||
import { DropdownButton } from "../../../components/dropdownButton";
|
import { DropdownButton } from "../../../components/dropdownButton";
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import TEMP_IMAGE from "../../../assets/drawer-cover.png";
|
import DEFAULT_IMAGE from "../../../assets/default_cover_image.png";
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { TextWithIcon } from "../../basicUIElements";
|
import { TextWithIcon } from "../../basicUIElements";
|
||||||
@ -59,7 +59,7 @@ class ProfileSummaryView extends Component {
|
|||||||
<Image
|
<Image
|
||||||
style={styles.longImage}
|
style={styles.longImage}
|
||||||
source={{ uri: coverImage }}
|
source={{ uri: coverImage }}
|
||||||
defaultSource={TEMP_IMAGE}
|
defaultSource={DEFAULT_IMAGE}
|
||||||
/>
|
/>
|
||||||
<PercentBar percent={percent} margin={24}>
|
<PercentBar percent={percent} margin={24}>
|
||||||
<View style={styles.percentTitleWrapper}>
|
<View style={styles.percentTitleWrapper}>
|
||||||
|
@ -8,13 +8,11 @@ import FastImage from "react-native-fast-image";
|
|||||||
// Components
|
// Components
|
||||||
import ScrollableTabView from "@esteemapp/react-native-scrollable-tab-view";
|
import ScrollableTabView from "@esteemapp/react-native-scrollable-tab-view";
|
||||||
import { TabBar } from "../../../components/tabBar";
|
import { TabBar } from "../../../components/tabBar";
|
||||||
import DiscoverPage from "../../discover/discover";
|
|
||||||
import { PostCard } from "../../../components/postCard";
|
import { PostCard } from "../../../components/postCard";
|
||||||
import { ProfileSummary } from "../../../components/profileSummary";
|
import { ProfileSummary } from "../../../components/profileSummary";
|
||||||
import Comment from "../../../components/comment/comment";
|
import Comment from "../../../components/comment/comment";
|
||||||
import { FilterBar } from "../../../components/filterBar";
|
import { FilterBar } from "../../../components/filterBar";
|
||||||
import { DropdownButton } from "../../../components/dropdownButton";
|
import { NoPost } from "../../../components/basicUIElements";
|
||||||
|
|
||||||
// Utilitites
|
// Utilitites
|
||||||
import { getUserData, getAuthStatus } from "../../../realm/realm";
|
import { getUserData, getAuthStatus } from "../../../realm/realm";
|
||||||
import {
|
import {
|
||||||
@ -176,36 +174,45 @@ class ProfileScreen extends React.Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_getPostRenderItem = () => {};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
user,
|
user,
|
||||||
follows,
|
follows,
|
||||||
about,
|
|
||||||
posts,
|
posts,
|
||||||
commments,
|
commments,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
about,
|
||||||
} = this.state;
|
} = 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.state);
|
||||||
console.log(this.props);
|
|
||||||
|
|
||||||
const votingPower = user.voting_power && user.voting_power / 100;
|
|
||||||
const fullIn = Math.ceil((100 - votingPower) * 0.833333);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<CollapsibleCard title={about.about} expanded={true}>
|
<CollapsibleCard
|
||||||
|
title={_about}
|
||||||
|
defaultTitle="Profile details"
|
||||||
|
expanded={true}
|
||||||
|
>
|
||||||
<ProfileSummary
|
<ProfileSummary
|
||||||
percent={votingPower}
|
percent={votingPower}
|
||||||
hours={fullIn}
|
hours={fullInHour}
|
||||||
location={about.location}
|
location={location}
|
||||||
link={about.website}
|
link={website}
|
||||||
date={getFormatedCreatedDate(user.created)}
|
date={getFormatedCreatedDate(user && user.created)}
|
||||||
followerCount={follows.follower_count}
|
followerCount={follows.follower_count}
|
||||||
followingCount={follows.following_count}
|
followingCount={follows.following_count}
|
||||||
coverImage={about.cover_image}
|
coverImage={cover_image}
|
||||||
/>
|
/>
|
||||||
</CollapsibleCard>
|
</CollapsibleCard>
|
||||||
|
|
||||||
@ -236,6 +243,7 @@ class ProfileScreen extends React.Component {
|
|||||||
onDropdownSelect={this._handleOnDropdownSelect}
|
onDropdownSelect={this._handleOnDropdownSelect}
|
||||||
rightIconName="md-apps"
|
rightIconName="md-apps"
|
||||||
/>
|
/>
|
||||||
|
{posts && posts.length > 0 ? (
|
||||||
<FlatList
|
<FlatList
|
||||||
data={posts}
|
data={posts}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
@ -258,8 +266,12 @@ class ProfileScreen extends React.Component {
|
|||||||
onEndThreshold={0}
|
onEndThreshold={0}
|
||||||
bounces={false}
|
bounces={false}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
<NoPost name={user.name} text="haven't posted anything yet" />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View tabLabel="Comments" style={styles.commentsTabBar}>
|
<View tabLabel="Comments" style={styles.commentsTabBar}>
|
||||||
|
{commments && commments.length > 0 ? (
|
||||||
<FlatList
|
<FlatList
|
||||||
data={commments}
|
data={commments}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
@ -270,6 +282,9 @@ class ProfileScreen extends React.Component {
|
|||||||
onEndThreshold={0}
|
onEndThreshold={0}
|
||||||
bounces={false}
|
bounces={false}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
<NoPost name={user.name} text="haven't commented anything yet" />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View tabLabel={"$" + user.balance}>
|
<View tabLabel={"$" + user.balance}>
|
||||||
<Card>
|
<Card>
|
||||||
|
Loading…
Reference in New Issue
Block a user