mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 01:52:56 +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 TextWithIcon from "./view/textWithIconView";
|
||||
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()}
|
||||
>
|
||||
<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>
|
||||
)}
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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}>
|
||||
|
@ -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,40 +243,48 @@ class ProfileScreen extends React.Component {
|
||||
onDropdownSelect={this._handleOnDropdownSelect}
|
||||
rightIconName="md-apps"
|
||||
/>
|
||||
<FlatList
|
||||
data={posts}
|
||||
showsVerticalScrollIndicator={false}
|
||||
renderItem={({ item }) => (
|
||||
<PostCard
|
||||
style={{
|
||||
shadowColor: "#f6f6f6",
|
||||
}}
|
||||
content={item}
|
||||
user={user}
|
||||
isLoggedIn={true}
|
||||
/>
|
||||
)}
|
||||
keyExtractor={(post, index) => index.toString()}
|
||||
onEndReached={info => {
|
||||
if (!isLoading) {
|
||||
this._getMore();
|
||||
}
|
||||
}}
|
||||
onEndThreshold={0}
|
||||
bounces={false}
|
||||
/>
|
||||
{posts && posts.length > 0 ? (
|
||||
<FlatList
|
||||
data={posts}
|
||||
showsVerticalScrollIndicator={false}
|
||||
renderItem={({ item }) => (
|
||||
<PostCard
|
||||
style={{
|
||||
shadowColor: "#f6f6f6",
|
||||
}}
|
||||
content={item}
|
||||
user={user}
|
||||
isLoggedIn={true}
|
||||
/>
|
||||
)}
|
||||
keyExtractor={(post, index) => index.toString()}
|
||||
onEndReached={info => {
|
||||
if (!isLoading) {
|
||||
this._getMore();
|
||||
}
|
||||
}}
|
||||
onEndThreshold={0}
|
||||
bounces={false}
|
||||
/>
|
||||
) : (
|
||||
<NoPost name={user.name} text="haven't posted anything yet" />
|
||||
)}
|
||||
</View>
|
||||
<View tabLabel="Comments" style={styles.commentsTabBar}>
|
||||
<FlatList
|
||||
data={commments}
|
||||
showsVerticalScrollIndicator={false}
|
||||
renderItem={({ item }) => (
|
||||
<Comment comment={item} isLoggedIn={true} user={user} />
|
||||
)}
|
||||
keyExtractor={(post, index) => index.toString()}
|
||||
onEndThreshold={0}
|
||||
bounces={false}
|
||||
/>
|
||||
{commments && commments.length > 0 ? (
|
||||
<FlatList
|
||||
data={commments}
|
||||
showsVerticalScrollIndicator={false}
|
||||
renderItem={({ item }) => (
|
||||
<Comment comment={item} isLoggedIn={true} user={user} />
|
||||
)}
|
||||
keyExtractor={(post, index) => index.toString()}
|
||||
onEndThreshold={0}
|
||||
bounces={false}
|
||||
/>
|
||||
) : (
|
||||
<NoPost name={user.name} text="haven't commented anything yet" />
|
||||
)}
|
||||
</View>
|
||||
<View tabLabel={"$" + user.balance}>
|
||||
<Card>
|
||||
|
Loading…
Reference in New Issue
Block a user