fixed couple bugs && minimized all image & removed unused image

This commit is contained in:
u-e 2018-12-15 14:12:34 +03:00
parent 62b64a607c
commit a4e6b6162a
46 changed files with 83 additions and 50 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
src/assets/default_cover_image.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

BIN
src/assets/esteem@2x.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/esteem_transparent@2x.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/love_mascot.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

BIN
src/assets/no_image.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/assets/no_post.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
src/assets/steem_connect.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -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));

View File

@ -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>

View File

@ -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={[

View File

@ -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>

View File

@ -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;

View File

@ -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);

View File

@ -75,7 +75,7 @@ class SideMenuView extends Component {
if (item.route) {
navigateToRoute(item.route);
} else {
switchAccount(item.name);
switchAccount(item.username);
}
};

View File

@ -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;

View File

@ -19,7 +19,6 @@ const initialState = {
};
export default function (state = initialState, action) {
console.log(action);
switch (action.type) {
case FETCHING_ACCOUNT:
return {

View File

@ -98,19 +98,17 @@ class ApplicationContainer extends Component {
authStatus = res;
currentUsername = res.currentUsername;
console.log(res);
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) {

View File

@ -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}
/>
);
}
}

View File

@ -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>
);
}

View File

@ -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';