Merge pull request #249 from esteemapp/feature/logout
Fixed couple bugs && Minimized all image && removed unused
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 7.8 KiB |
BIN
src/assets/default_cover_image.png
Normal file → Executable file
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 72 KiB |
BIN
src/assets/esteem@2x.png
Normal file → Executable file
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
src/assets/esteem_transparent@2x.png
Normal file → Executable file
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 23 KiB |
BIN
src/assets/love_mascot.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 286 KiB |
Before Width: | Height: | Size: 972 B |
Before Width: | Height: | Size: 972 B |
BIN
src/assets/no_image.png
Normal file → Executable file
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
src/assets/no_post.png
Normal file → Executable file
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 7.8 KiB |
BIN
src/assets/steem_connect.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { withNavigation } from 'react-navigation';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { getComments } from '../../../providers/steem/dsteem';
|
||||
|
||||
@ -59,15 +60,20 @@ class CommentsContainer extends Component {
|
||||
|
||||
render() {
|
||||
const { comments } = this.state;
|
||||
|
||||
const { isLoggedIn } = this.props;
|
||||
return (
|
||||
<CommentsView
|
||||
handleOnReplyPress={this._handleOnReplyPress}
|
||||
comments={comments}
|
||||
isLoggedIn={isLoggedIn}
|
||||
{...this.props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withNavigation(CommentsContainer);
|
||||
const mapStateToProps = state => ({
|
||||
isLoggedIn: state.application.isLoggedIn,
|
||||
});
|
||||
|
||||
export default withNavigation(connect(mapStateToProps)(CommentsContainer));
|
||||
|
@ -39,6 +39,7 @@ class CommentsView extends Component {
|
||||
commentNumber,
|
||||
handleOnReplyPress,
|
||||
isProfilePreview,
|
||||
isLoggedIn,
|
||||
} = this.props;
|
||||
// commentNumber === 8 && alert('sekkiz:');
|
||||
return (
|
||||
@ -73,6 +74,7 @@ class CommentsView extends Component {
|
||||
name="reply"
|
||||
onPress={() => handleOnReplyPress && handleOnReplyPress(item)}
|
||||
iconType="FontAwesome"
|
||||
disabled={!isLoggedIn}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -5,9 +5,9 @@ import { Icon } from '../../icon';
|
||||
import styles from './iconButtonStyles';
|
||||
|
||||
/* Props
|
||||
* ------------------------------------------------
|
||||
* @prop { type } name - Description....
|
||||
*/
|
||||
* ------------------------------------------------
|
||||
* @prop { type } name - Description....
|
||||
*/
|
||||
|
||||
const IconButton = ({
|
||||
name,
|
||||
@ -18,12 +18,14 @@ const IconButton = ({
|
||||
style,
|
||||
iconStyle,
|
||||
iconType,
|
||||
disabled,
|
||||
}) => (
|
||||
<Fragment>
|
||||
<TouchableHighlight
|
||||
style={[styles.iconButton, style]}
|
||||
onPress={() => onPress && onPress()}
|
||||
underlayColor={backgroundColor || 'white'}
|
||||
disabled={disabled}
|
||||
>
|
||||
<Icon
|
||||
style={[
|
||||
|
@ -54,32 +54,34 @@ class PostDropdownContainer extends Component {
|
||||
}
|
||||
};
|
||||
|
||||
_reblog = async () => {
|
||||
const { currentAccount, content } = this.props;
|
||||
|
||||
reblog(currentAccount, content.author, content.permlink)
|
||||
.then((result) => {
|
||||
Alert.alert('Success', 'Rebloged!');
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.jse_shortmsg && String(error.jse_shortmsg).indexOf('has already reblogged')) {
|
||||
Alert.alert('You already reblogged!');
|
||||
} else {
|
||||
Alert.alert('Failed!');
|
||||
}
|
||||
});
|
||||
_reblog = () => {
|
||||
const { currentAccount, content, isLoggedIn } = this.props;
|
||||
if (isLoggedIn) {
|
||||
reblog(currentAccount, content.author, content.permlink)
|
||||
.then((result) => {
|
||||
Alert.alert('Success', 'Rebloged!');
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.jse_shortmsg && String(error.jse_shortmsg).indexOf('has already reblogged')) {
|
||||
Alert.alert('You already reblogged!');
|
||||
} else {
|
||||
Alert.alert('Failed!');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_replyNavigation = () => {
|
||||
const { navigation, content } = this.props;
|
||||
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
isReply: true,
|
||||
post: content,
|
||||
},
|
||||
});
|
||||
const { navigation, content, isLoggedIn } = this.props;
|
||||
if (isLoggedIn) {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
isReply: true,
|
||||
post: content,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -95,6 +97,7 @@ class PostDropdownContainer extends Component {
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
selectedApi: state.application.api,
|
||||
isLoggedIn: state.application.isLoggedIn,
|
||||
currentAccount: state.account.currentAccount,
|
||||
});
|
||||
export default withNavigation(connect(mapStateToProps)(PostDropdownContainer));
|
||||
|
@ -57,6 +57,7 @@ class PostDisplayView extends Component {
|
||||
handleOnEditPress,
|
||||
handleOnReplyPress,
|
||||
handleOnVotersPress,
|
||||
isLoggedIn,
|
||||
post,
|
||||
} = this.props;
|
||||
|
||||
@ -97,6 +98,7 @@ class PostDisplayView extends Component {
|
||||
name="reply"
|
||||
onPress={() => handleOnReplyPress && handleOnReplyPress()}
|
||||
iconType="FontAwesome"
|
||||
disabled={!isLoggedIn}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -35,6 +35,17 @@ class PostsView extends Component {
|
||||
this._loadPosts();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { currentAccountUsername } = this.props;
|
||||
|
||||
if (
|
||||
currentAccountUsername !== nextProps.currentAccountUsername
|
||||
&& nextProps.currentAccountUsername
|
||||
) {
|
||||
this._loadPosts();
|
||||
}
|
||||
}
|
||||
|
||||
_loadPosts = (filter = null) => {
|
||||
const { getFor, tag, currentAccountUsername } = this.props;
|
||||
let options;
|
||||
|
@ -29,27 +29,37 @@ class SideMenuContainer extends Component {
|
||||
}
|
||||
|
||||
// Component Life Cycle Functions
|
||||
|
||||
componentWillMount() {
|
||||
const accounts = [];
|
||||
const { otherAccounts } = this.props;
|
||||
|
||||
getUserData().then((userData) => {
|
||||
userData.forEach((element) => {
|
||||
accounts.push({
|
||||
name: `@${element.username}`,
|
||||
username: element.username,
|
||||
});
|
||||
});
|
||||
accounts.push({
|
||||
name: 'Add Account',
|
||||
route: ROUTES.SCREENS.LOGIN,
|
||||
icon: 'add',
|
||||
id: 'add_account',
|
||||
});
|
||||
this.setState({ accounts });
|
||||
});
|
||||
this._createUserList(otherAccounts);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { otherAccounts, isLoggedIn } = this.props;
|
||||
|
||||
if (isLoggedIn && otherAccounts !== nextProps.otherAccounts) {
|
||||
this._createUserList(nextProps.otherAccounts);
|
||||
}
|
||||
}
|
||||
|
||||
_createUserList = (otherAccounts) => {
|
||||
const accounts = [];
|
||||
otherAccounts.forEach((element) => {
|
||||
accounts.push({
|
||||
name: `@${element.username}`,
|
||||
username: element.username,
|
||||
});
|
||||
});
|
||||
accounts.push({
|
||||
name: 'Add Account',
|
||||
route: ROUTES.SCREENS.LOGIN,
|
||||
icon: 'add',
|
||||
id: 'add_account',
|
||||
});
|
||||
this.setState({ accounts });
|
||||
};
|
||||
|
||||
// Component Functions
|
||||
|
||||
_navigateToRoute = (route = null) => {
|
||||
@ -61,11 +71,10 @@ class SideMenuContainer extends Component {
|
||||
|
||||
_switchAccount = (anchor = null) => {
|
||||
const { dispatch, currentAccount, navigation } = this.props;
|
||||
const username = anchor.slice(1);
|
||||
|
||||
if (username !== currentAccount.name) {
|
||||
switchAccount(username).then((accountData) => {
|
||||
const realmData = getUserDataWithUsername(username);
|
||||
if (anchor !== currentAccount.name) {
|
||||
switchAccount(anchor).then((accountData) => {
|
||||
const realmData = getUserDataWithUsername(anchor);
|
||||
const _currentAccount = accountData;
|
||||
|
||||
_currentAccount.username = _currentAccount.name;
|
||||
@ -103,7 +112,8 @@ class SideMenuContainer extends Component {
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
isLoggedIn: state.application.isLoggedIn,
|
||||
currentAccount: state.account.currentAccount || {},
|
||||
currentAccount: state.account.currentAccount,
|
||||
otherAccounts: state.account.otherAccounts,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(SideMenuContainer);
|
||||
|
@ -75,7 +75,7 @@ class SideMenuView extends Component {
|
||||
if (item.route) {
|
||||
navigateToRoute(item.route);
|
||||
} else {
|
||||
switchAccount(item.name);
|
||||
switchAccount(item.username);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@ const DEFAULT_IMAGE = require('../../../assets/avatar_default.png');
|
||||
*/
|
||||
|
||||
const UserAvatarView = ({ username, size, style }) => {
|
||||
const imageSize = size === 'xl' ? 'large' : 'medium';
|
||||
const imageSize = size === 'xl' ? 'large' : 'small';
|
||||
const _avatar = username
|
||||
? { uri: `https://steemitimages.com/u/${username}/avatar/${imageSize}` }
|
||||
: DEFAULT_IMAGE;
|
||||
|
@ -97,19 +97,17 @@ class ApplicationContainer extends Component {
|
||||
await getAuthStatus().then((res) => {
|
||||
authStatus = res;
|
||||
currentUsername = res.currentUsername;
|
||||
if (authStatus.isLoggedIn) {
|
||||
getUserData().then((userData) => {
|
||||
if (userData.length > 0) {
|
||||
realmData = userData;
|
||||
getUserData().then((userData) => {
|
||||
if (userData.length > 0) {
|
||||
realmData = userData;
|
||||
|
||||
userData.forEach((accountData) => {
|
||||
dispatch(
|
||||
addOtherAccount({ username: accountData.username }),
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
userData.forEach((accountData) => {
|
||||
dispatch(
|
||||
addOtherAccount({ username: accountData.username }),
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (realmData) {
|
||||
|
@ -47,10 +47,17 @@ class PostContainer extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { currentAccount } = this.props;
|
||||
const { currentAccount, isLoggedIn } = this.props;
|
||||
const { post, error } = this.state;
|
||||
|
||||
return <PostScreen currentAccount={currentAccount} post={post} error={error} />;
|
||||
return (
|
||||
<PostScreen
|
||||
currentAccount={currentAccount}
|
||||
error={error}
|
||||
isLoggedIn={isLoggedIn}
|
||||
post={post}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class PostScreen extends Component {
|
||||
// Component Functions
|
||||
|
||||
render() {
|
||||
const { post, currentAccount } = this.props;
|
||||
const { post, currentAccount, isLoggedIn } = this.props;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
@ -33,7 +33,7 @@ class PostScreen extends Component {
|
||||
content={post}
|
||||
dropdownComponent={<PostDropdown content={post} />}
|
||||
/>
|
||||
<PostDisplay post={post} currentAccount={currentAccount} />
|
||||
<PostDisplay post={post} currentAccount={currentAccount} isLoggedIn={isLoggedIn} />
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
@ -14,11 +14,7 @@ import {
|
||||
getUser,
|
||||
getIsFollowing,
|
||||
getIsMuted,
|
||||
getFollowers,
|
||||
getFollowing,
|
||||
} from '../../../providers/steem/dsteem';
|
||||
import { decryptKey } from '../../../utils/crypto';
|
||||
import { getDigitPinCode } from '../../../providers/steem/auth';
|
||||
|
||||
// Constants
|
||||
import { default as ROUTES } from '../../../constants/routeNames';
|
||||
|