Merge pull request #122 from esteemapp/alpha/enhancment-bugfix

PART 3
This commit is contained in:
Feruz M 2018-11-27 11:17:58 +02:00 committed by GitHub
commit ddb217347e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 418 additions and 319 deletions

View File

@ -1,10 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="Sansation_Bold.ttf">
<string>Sansation-Bold</string>
</array>
<array key="Sansation_Regular.ttf">
<string>Sansation-Regular</string>
</array>
</customFonts>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
@ -12,31 +23,42 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="eSteem" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="FEV-wU-3FE">
<rect key="frame" x="187.66666666666666" y="157.33333333333337" width="104.99999999999997" height="165.66666666666663"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="esteem_logo" translatesAutoresizingMaskIntoConstraints="NO" id="kXG-62-crT">
<rect key="frame" x="0.0" y="0.0" width="105" height="105"/>
<constraints>
<constraint firstAttribute="width" constant="105" id="gOA-FQ-dNU"/>
<constraint firstAttribute="height" constant="105" id="kAL-Mu-NGe"/>
</constraints>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="eSteem" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="E9T-az-rxY">
<rect key="frame" x="0.0" y="104.99999999999997" width="105" height="33.666666666666657"/>
<fontDescription key="fontDescription" name="Sansation-Bold" family="Sansation" pointSize="30"/>
<color key="textColor" red="0.0" green="0.31764705879999999" blue="0.61176470589999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mobile" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="0.0" y="138.66666666666666" width="105" height="27"/>
<fontDescription key="fontDescription" name="Sansation-Regular" family="Sansation" pointSize="24"/>
<color key="textColor" red="0.0" green="0.31764705882352939" blue="0.61176470588235299" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
<constraint firstItem="FEV-wU-3FE" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="U1c-hs-Arn"/>
<constraint firstItem="FEV-wU-3FE" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="yTH-sp-aji"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
<point key="canvasLocation" x="86.956521739130437" y="1.6304347826086958"/>
</view>
</objects>
<resources>
<image name="esteem_logo" width="420" height="420"/>
</resources>
</document>

View File

@ -3,4 +3,4 @@
"version" : 1,
"author" : "xcode"
}
}
}

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "esteem_logo.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "esteem_logo-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "esteem_logo-2.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -4,12 +4,13 @@ import {
} from 'react-native';
import FastImage from 'react-native-fast-image';
import LinearGradient from 'react-native-linear-gradient';
import { SearchModal } from '../../searchModal';
import { injectIntl } from 'react-intl';
// Utils
import { getReputation } from '../../../utils/user';
// Components
import { SearchModal } from '../../searchModal';
import { IconButton } from '../../iconButton';
// Styles
@ -57,7 +58,7 @@ class HeaderView extends Component {
_handleOnCloseSearch = () => {
this.setState({ isSearchModalOpen: false });
}
};
render() {
const {
@ -66,6 +67,7 @@ class HeaderView extends Component {
hideStatusBar,
isReverse,
currentAccount,
intl,
} = this.props;
const { isSearchModalOpen } = this.state;
const _name = this._getNameOfUser();
@ -74,7 +76,13 @@ class HeaderView extends Component {
return (
<SafeAreaView style={[styles.container, isReverse && styles.containerReverse]}>
<StatusBar hidden={hideStatusBar} translucent />
<SearchModal isOpen={isSearchModalOpen} handleOnClose={this._handleOnCloseSearch} />
<SearchModal
placeholder={intl.formatMessage({
id: 'header.search',
})}
isOpen={isSearchModalOpen}
handleOnClose={this._handleOnCloseSearch}
/>
<TouchableOpacity
style={styles.avatarWrapper}
onPress={() => !isReverse && handleOpenDrawer()}
@ -108,7 +116,11 @@ class HeaderView extends Component {
</View>
) : (
<View style={styles.titleWrapper}>
<Text style={styles.noAuthTitle}>Log in to customize your feed</Text>
<Text style={styles.noAuthTitle}>
{intl.formatMessage({
id: 'header.title',
})}
</Text>
</View>
)}
{isReverse && (
@ -144,4 +156,4 @@ class HeaderView extends Component {
}
}
export default HeaderView;
export default injectIntl(HeaderView);

View File

@ -1,8 +1,5 @@
import Logo from './logo/logo';
// import Comment from './comment/comment';
// import PostCard from "./postCard";
import Reply from './reply/reply';
// import Search from './search/search';
import { FormInput } from './formInput';
import { CircularButton, TextButton, IconButton } from './buttons';
import { NumericKeyboard } from './numericKeyboard';
@ -14,11 +11,8 @@ import UserListItem from './basicUIElements/view/userListItem/userListItem';
export {
Logo,
// Comment,
// PostCard,
UserListItem,
Reply,
// Search,
FormInput,
CircularButton,
TextButton,

View File

@ -32,7 +32,10 @@ class LoginHeaderView extends Component {
return (
<View styles={styles.container}>
<View style={styles.headerRow}>
<Image style={styles.logo} source={require('../../../assets/esteem_transparent.png')} />
<Image
style={styles.logo}
source={require('../../../assets/esteem_logo_transparent.png')}
/>
<View style={styles.headerButton}>
<TextButton onPress={onPress} text={rightButtonText} />
</View>

View File

@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
import { View, ScrollView, FlatList } from 'react-native';
import { injectIntl } from 'react-intl';
// Constants
@ -47,7 +48,7 @@ class NotificationView extends Component {
};
render() {
const { notifications } = this.props;
const { notifications, intl } = this.props;
const { filters } = this.state;
const today = [];
const yesterday = [];
@ -79,70 +80,90 @@ class NotificationView extends Component {
rightIconName="ios-checkmark"
/>
<ScrollView style={styles.scrollView}>
{
today.length > 0 && (
<Fragment>
<ContainerHeader hasSeperator isBoldTitle title="Recent" />
<FlatList
data={today}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)
}
{
yesterday.length > 0 && (
<Fragment>
<ContainerHeader hasSeperator isBoldTitle title="Yesterday" />
<FlatList
data={yesterday}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)
}
{
thisWeek.length > 0 && (
<Fragment>
<ContainerHeader hasSeperator isBoldTitle title="This Week" />
<FlatList
data={thisWeek}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)
}
{
thisMonth.length > 0 && (
<Fragment>
<ContainerHeader hasSeperator isBoldTitle title="This Month" />
<FlatList
data={thisMonth}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)
}
{
olderThenMonth.length > 0 && (
<Fragment>
<ContainerHeader hasSeperator isBoldTitle title="Older Then A Month" />
<FlatList
data={olderThenMonth}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)
}
{today.length > 0 && (
<Fragment>
<ContainerHeader
hasSeperator
isBoldTitle
title={intl.formatMessage({
id: 'notification.recent',
})}
/>
<FlatList
data={today}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)}
{yesterday.length > 0 && (
<Fragment>
<ContainerHeader
hasSeperator
isBoldTitle
title={intl.formatMessage({
id: 'notification.yesterday',
})}
/>
<FlatList
data={yesterday}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)}
{thisWeek.length > 0 && (
<Fragment>
<ContainerHeader
hasSeperator
isBoldTitle
title={intl.formatMessage({
id: 'notification.this_week',
})}
/>
<FlatList
data={thisWeek}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)}
{thisMonth.length > 0 && (
<Fragment>
<ContainerHeader
hasSeperator
isBoldTitle
title={intl.formatMessage({
id: 'notification.this_month',
})}
/>
<FlatList
data={thisMonth}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)}
{olderThenMonth.length > 0 && (
<Fragment>
<ContainerHeader
hasSeperator
isBoldTitle
title={intl.formatMessage({
id: 'notification.older_then',
})}
/>
<FlatList
data={olderThenMonth}
renderItem={({ item }) => <NotificationLine notification={item} />}
keyExtractor={item => item.id}
/>
</Fragment>
)}
</ScrollView>
</View>
);
}
}
export default NotificationView;
export default injectIntl(NotificationView);

View File

@ -37,26 +37,27 @@ class ProfileSummaryView extends Component {
render() {
const { isShowPercentText } = this.state;
const {
percentRC,
percentVP,
hoursVP,
hoursRC,
location,
link,
date,
followingCount,
followerCount,
coverImage,
isLoggedIn,
isFollowing,
isFavorite,
isMuted,
isOwnProfile,
isProfileLoading,
date,
followerCount,
followingCount,
handleFollowUnfollowUser,
handleMuteUnmuteUser,
handleOnFollowsPress,
hoursRC,
hoursVP,
intl,
isDarkTheme,
isFavorite,
isFollowing,
isLoggedIn,
isMuted,
isOwnProfile,
isProfileLoading,
link,
location,
percentRC,
percentVP,
} = this.props;
const votingPowerHoursText = hoursVP && `• Full in ${hoursVP} hours`;
const votingPowerText = `Voting power: ${percentVP}% ${votingPowerHoursText || ''}`;
@ -114,13 +115,19 @@ class ProfileSummaryView extends Component {
<TouchableOpacity onPress={() => handleOnFollowsPress(false)}>
<View style={styles.followCountWrapper}>
<Text style={styles.followCount}>{followerCount}</Text>
<Text style={styles.followText}>followers</Text>
<Text style={styles.followText}> {intl.formatMessage({
id: 'profile.follower',
})}</Text>
</View>
</TouchableOpacity>
<TouchableOpacity onPress={() => handleOnFollowsPress(true)}>
<View style={styles.followCountWrapper}>
<Text style={styles.followCount}>{followingCount}</Text>
<Text style={styles.followText}>following</Text>
<Text style={styles.followText}>
{intl.formatMessage({
id: 'profile.following',
})}
</Text>
</View>
</TouchableOpacity>
</Fragment>

View File

@ -79,7 +79,7 @@ class SearchModalContainer extends Component {
render() {
const { searchResults } = this.state;
const { handleOnClose, isOpen } = this.props;
const { handleOnClose, isOpen, placeholder } = this.props;
return (
<SearchModalView
searchResults={searchResults}
@ -88,6 +88,7 @@ class SearchModalContainer extends Component {
handleOnPressListItem={this._handleOnPressListItem}
isOpen={isOpen}
handleOnClose={handleOnClose}
placeholder={placeholder}
/>
);
}

View File

@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import {
View, Text, TextInput, FlatList, TouchableHighlight, Image,
View, Text, TextInput, FlatList, TouchableHighlight,
} from 'react-native';
import FastImage from 'react-native-fast-image';
@ -32,11 +32,12 @@ class SearchModalView extends Component {
render() {
const {
isOpen,
handleOnClose,
searchResults,
handleOnPressListItem,
handleOnChangeSearchInput,
handleOnClose,
handleOnPressListItem,
isOpen,
placeholder,
searchResults,
} = this.props;
return (
@ -48,7 +49,7 @@ class SearchModalView extends Component {
<TextInput
style={styles.input}
onChangeText={text => handleOnChangeSearchInput(text)}
placeholder="Search..."
placeholder={placeholder}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
/>

View File

@ -17,7 +17,33 @@
"follow": "followed you",
"unfollow": "unfollowed you",
"ignore": "ignored you",
"reblog": "reblogged your post"
"reblog": "reblogged your post",
"comingsoon": "Leaderboard feature is coming soon!",
"notification": "Notification",
"leaderboard": "Leaderboard",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
},
"messages": {
"comingsoon": "Messages feature is coming soon!"
},
"profile": {
"following": "Following",
"follower": "Follower",
"post": "Post",
"details": "Profile Details",
"comments": "Comments",
"wallet": "Wallet",
"wallet_details": "Wallet Details",
"unclaimed_rewards": "Unclaimed Rewards",
"full_in": "Full in",
"hours": "hours",
"voting_power": "Voting power",
"login_to_see": "Login to see!",
"havent_commented": "haven't commented anything yet"
},
"settings": {
"settings": "Settings",
@ -56,5 +82,9 @@
"gallery": "Gallery",
"settings": "Settings",
"add_account": "Add Account"
},
"header": {
"title": "Login to customize your feed",
"search": "Search..."
}
}

View File

@ -10,14 +10,40 @@
"fill_order": "Fill Order"
},
"notification": {
"vote": "voted to your post",
"unvote": "unvoted to your post",
"reply": "replied to your post",
"mention": "mentioned to you",
"follow": "followed to you",
"unfollow": "unfollowed to you",
"ignore": "ignored to you",
"reblog": "reblog to your post"
"vote": "gönderini oyladı",
"unvote": "gonderini yukarı yönde oyladı",
"reply": "gönderine cevap verdi",
"mention": "seni etiketledi",
"follow": "seni takip etti",
"unfollow": "seni takipetmeyi bıraktı",
"ignore": "seni engelledi",
"reblog": "senin postunu paylaştı",
"comingsoon": "Liderler tablosu yakında burada!",
"notification": "Bildirim",
"leaderboard": "Liderler Tablosu",
"recent": "Geçen",
"yesterday": "Dün",
"this_week": "Bu Hafta",
"this_month": "Bu Ay",
"older_then": "Bir Aydan Daha Önce"
},
"messages": {
"comingsoon": "Mesajlar yakinda burada!"
},
"profile": {
"following": "Takip edilen",
"follower": "Takipçi",
"post": "Gönderi",
"details": "Profil Detayları",
"comments": "Yorumlar",
"wallet": "Cüzdan",
"wallet_details": "Cüzdan Detayları",
"unclaimed_rewards": "Sahipsiz Ödül",
"login_to_see": "Giriş yap ve gör!",
"havent_commented": "henüz yorum yapmadı",
"full_in": "Full in",
"hours": "saat",
"voting_power": "Oylama güçü"
},
"settings": {
"settings": "Ayarlar",
@ -56,5 +82,9 @@
"gallery": "Galeri",
"settings": "Ayarlar",
"add_account": "Hesap Ekle"
},
"header": {
"title": "Giriş yap ve akışını özelleştir.",
"search": "Ara..."
}
}

View File

@ -16,7 +16,6 @@ import {
Profile,
RootComponent,
Settings,
Splash,
SteemConnect,
Voters,
} from '../screens';
@ -81,10 +80,9 @@ const stackNavigatior = createStackNavigator(
},
},
{
cardStyle: {
backgroundColor: 'white',
//1e2835
},
// cardStyle: {
// backgroundColor: 'white',
// },
},
);
@ -92,6 +90,5 @@ export default createSwitchNavigator({
stackNavigatior,
[ROUTES.SCREENS.LOGIN]: { screen: RootComponent()(Login) },
[ROUTES.SCREENS.PINCODE]: { screen: RootComponent()(PinCode) },
[ROUTES.SCREENS.SPLASH]: { screen: Splash },
[ROUTES.SCREENS.STEEM_CONNECT]: { screen: RootComponent()(SteemConnect) },
});

View File

@ -1,9 +1,27 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import 'intl';
import { addLocaleData } from 'react-intl';
// Constants
import en from 'react-intl/locale-data/en';
import tr from 'react-intl/locale-data/tr';
import { getUserData, getAuthStatus, getSettings } from '../../../realm/realm';
import { getUser } from '../../../providers/steem/dsteem';
// Actions
import { addOtherAccount, updateCurrentAccount } from '../../../redux/actions/accountAction';
import {
activeApplication,
login,
openPinCodeModal,
setLanguage,
isNotificationOpen,
setCurrency,
setApi,
isDarkTheme,
} from '../../../redux/actions/applicationActions';
// Container
import { ApplicationScreen } from '..';
addLocaleData([...en, ...tr]);
@ -24,6 +42,11 @@ class ApplicationContainer extends Component {
};
}
componentDidMount = () => {
this._getUserData();
this._getSettings();
};
componentWillReceiveProps(nextProps) {
const { isDarkTheme, selectedLanguage } = this.props;
@ -32,6 +55,54 @@ class ApplicationContainer extends Component {
}
}
_getUserData = () => {
const { dispatch } = this.props;
getAuthStatus().then((res) => {
if (res.isLoggedIn) {
getUserData().then((response) => {
if (response.length > 0) {
response.forEach((accountData) => {
dispatch(
addOtherAccount({ username: accountData.username, avatar: accountData.avatar }),
);
});
getUser(response[response.length - 1].username)
.then((accountData) => {
const realmObject = response[response.length - 1];
accountData.realm_object = realmObject;
dispatch(updateCurrentAccount(accountData));
dispatch(activeApplication());
dispatch(login());
if (__DEV__ === false) {
dispatch(openPinCodeModal());
}
})
.catch((err) => {
alert(err);
});
}
});
} else {
dispatch(activeApplication());
}
});
};
_getSettings = () => {
const { dispatch } = this.props;
getSettings().then((response) => {
if (response) {
response.isDarkTheme && dispatch(isDarkTheme(response.isDarkTheme));
response.language && dispatch(setLanguage(response.language));
response.currency && dispatch(setCurrency(response.currency));
response.notification && dispatch(isNotificationOpen(response.currency));
response.server && dispatch(setApi(response.currency));
}
});
};
render() {
const { selectedLanguage } = this.props;
const { isRenderRequire } = this.state;

View File

@ -1,6 +1,5 @@
import PinCode from './pinCode';
import RootComponent from './root';
import Splash from './splash';
import SteemConnect from './steem-connect/steemConnect';
import { Application } from './application';
import { Editor } from './editor';
@ -27,7 +26,6 @@ export {
Profile,
RootComponent,
Settings,
Splash,
SteemConnect,
Voters,
};

View File

@ -1,4 +1,5 @@
import React, { Component, Fragment } from 'react';
import { injectIntl } from 'react-intl';
// Constants
@ -26,6 +27,8 @@ class MessagesScreen extends Component {
// Component Functions
render() {
const { intl } = this.props;
return (
<Fragment>
<Header />
@ -33,11 +36,13 @@ class MessagesScreen extends Component {
style={styles.container}
imageStyle={styles.image}
source={MESSAGES_IMAGE}
defaultText="Messages feature is coming soon!"
defaultText={intl.formatMessage({
id: 'messages.comingsoon',
})}
/>
</Fragment>
);
}
}
export default MessagesScreen;
export default injectIntl(MessagesScreen);

View File

@ -1,12 +1,14 @@
import React, { Fragment, PureComponent } from 'react';
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
import { TabBar } from '../../../components/tabBar';
import { Notification } from '../../../components/notification';
import { Header } from '../../../components/header';
import { injectIntl } from 'react-intl';
// Styles
import styles from './notificationStyles';
// Components
import { TabBar } from '../../../components/tabBar';
import { Notification } from '../../../components/notification';
import { Header } from '../../../components/header';
import { NoPost } from '../../../components/basicUIElements';
// Styles
@ -20,7 +22,7 @@ class NotificationScreen extends PureComponent {
}
render() {
const { notifications, getActivities } = this.props;
const { notifications, getActivities, intl } = this.props;
return (
<View style={globalStyles.container}>
<Header />
@ -30,10 +32,20 @@ class NotificationScreen extends PureComponent {
<TabBar style={styles.tabbar} tabUnderlineDefaultWidth={100} tabUnderlineScaleX={2} />
)}
>
<View tabLabel="Notification" style={styles.notificationTab}>
<View
tabLabel={intl.formatMessage({
id: 'notification.notification',
})}
style={styles.notificationTab}
>
<Notification getActivities={getActivities} notifications={notifications} />
</View>
<View tabLabel="Leaderboard" style={styles.leaderboardTab}>
<View
tabLabel={intl.formatMessage({
id: 'notification.leaderboard',
})}
style={styles.leaderboardTab}
>
<NoPost
style={{ marginTop: 118 }}
imageStyle={{
@ -41,7 +53,9 @@ class NotificationScreen extends PureComponent {
height: 189,
}}
source={MESSAGES_IMAGE}
defaultText="Leaderboard feature is coming soon!"
defaultText={intl.formatMessage({
id: 'notification.comingsoon',
})}
/>
</View>
</ScrollableTabView>
@ -49,4 +63,4 @@ class NotificationScreen extends PureComponent {
);
}
}
export default NotificationScreen;
export default injectIntl(NotificationScreen);

View File

@ -1,6 +1,7 @@
/* eslint-disable no-unused-vars */
import React, { Component, Fragment } from 'react';
import { View, ScrollView } from 'react-native';
import { injectIntl } from 'react-intl';
// Components
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
@ -33,18 +34,19 @@ class ProfileScreen extends Component {
comments,
follows,
handleFollowUnfollowUser,
handleMuteUnmuteUser,
handleOnFollowsPress,
intl,
isDarkTheme,
isFollowing,
isLoading,
isLoggedIn,
isMuted,
isProfileLoading,
isReady,
isReverseHeader,
user,
isReady,
username,
isMuted,
isFollowing,
handleMuteUnmuteUser,
isProfileLoading,
handleOnFollowsPress,
isDarkTheme,
} = this.props;
let _about;
let avatar;
@ -82,12 +84,15 @@ class ProfileScreen extends Component {
<CollapsibleCard
title={_about}
isTitleCenter
defaultTitle="Profile details"
defaultTitle={intl.formatMessage({
id: 'profile.details',
})}
expanded
// expanded={isLoggedIn}
// locked={!isLoggedIn}
>
<ProfileSummary
intl={intl}
coverImage={coverImage}
date={getFormatedCreatedDate(user && user.created)}
followerCount={follows.follower_count}
@ -117,7 +122,12 @@ class ProfileScreen extends Component {
<TabBar style={styles.tabbar} tabUnderlineDefaultWidth={80} tabUnderlineScaleX={2} />
)}
>
<View tabLabel="Post" style={styles.postTabBar}>
<View
tabLabel={intl.formatMessage({
id: 'profile.post',
})}
style={styles.postTabBar}
>
{user && (
<Posts
filterOptions={[
@ -136,7 +146,12 @@ class ProfileScreen extends Component {
/>
)}
</View>
<View tabLabel="Comments" style={styles.commentsTabBar}>
<View
tabLabel={intl.formatMessage({
id: 'profile.comments',
})}
style={styles.commentsTabBar}
>
{comments && comments.length > 0 ? (
<ScrollView>
<Comments isProfilePreview comments={comments} />
@ -144,12 +159,20 @@ class ProfileScreen extends Component {
) : (
<NoPost
name={username}
text="haven't commented anything yet"
defaultText="Login to see!"
text={intl.formatMessage({
id: 'profile.havent_commented',
})}
defaultText={intl.formatMessage({
id: 'profile.login_to_see',
})}
/>
)}
</View>
<View tabLabel="Wallet">
<View
tabLabel={intl.formatMessage({
id: 'profile.wallet',
})}
>
<Wallet user={user} />
</View>
</ScrollableTabView>
@ -159,4 +182,4 @@ class ProfileScreen extends Component {
}
}
export default ProfileScreen;
export default injectIntl(ProfileScreen);

View File

@ -1,89 +0,0 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { getUserData, getAuthStatus, getSettings } from '../../../realm/realm';
import { getUser } from '../../../providers/steem/dsteem';
// Actions
import { addOtherAccount, updateCurrentAccount } from '../../../redux/actions/accountAction';
import {
activeApplication,
login,
openPinCodeModal,
setLanguage,
isNotificationOpen,
setCurrency,
setApi,
isDarkTheme,
} from '../../../redux/actions/applicationActions';
// Constants
import { default as ROUTES } from '../../../constants/routeNames';
import SplashScreen from '../screen/splashScreen';
class SplashContainer extends Component {
componentDidMount = () => {
this._getUserData();
this._getSettings();
};
_getUserData = () => {
const { navigation, dispatch } = this.props;
getAuthStatus().then((res) => {
if (res.isLoggedIn) {
getUserData().then((response) => {
if (response.length > 0) {
response.forEach((accountData) => {
dispatch(
addOtherAccount({ username: accountData.username, avatar: accountData.avatar }),
);
});
getUser(response[response.length - 1].username)
.then((accountData) => {
const realmObject = response[response.length - 1];
accountData.realm_object = realmObject;
dispatch(updateCurrentAccount(accountData));
dispatch(activeApplication());
dispatch(login());
if (__DEV__ === false) {
dispatch(openPinCodeModal());
}
navigation.navigate(ROUTES.DRAWER.MAIN);
})
.catch((err) => {
alert(err);
});
}
});
} else {
dispatch(activeApplication());
navigation.navigate(ROUTES.DRAWER.MAIN);
}
});
};
_getSettings = () => {
const { dispatch } = this.props;
getSettings().then((response) => {
console.log(response.isDarkTheme);
if (response) {
response.isDarkTheme && dispatch(isDarkTheme(response.isDarkTheme));
response.language && dispatch(setLanguage(response.language));
response.currency && dispatch(setCurrency(response.currency));
response.notification && dispatch(isNotificationOpen(response.currency));
response.server && dispatch(setApi(response.currency));
}
});
};
render() {
return <SplashScreen />;
}
}
export default connect()(SplashContainer);

View File

@ -1,3 +0,0 @@
import Splash from './container/splashContainer';
export default Splash;

View File

@ -1,37 +0,0 @@
import React, { Component } from 'react';
import { Text, Animated } from 'react-native';
// Components
import { Logo } from '../../../components';
import styles from './splashStyles';
class SplashScreen extends Component {
constructor(props) {
super(props);
this.state = {
fadeAnim: new Animated.Value(0),
};
}
componentDidMount = () => {
const { fadeAnim } = this.state;
Animated.timing(fadeAnim, {
toValue: 1,
duration: 6000,
}).start();
};
render() {
const { fadeAnim } = this.state;
return (
<Animated.View style={[styles.container, { opacity: fadeAnim }]}>
<Logo style={styles.logo} />
<Text style={styles.title}>eSteem</Text>
<Text style={styles.subTitle}>mobile</Text>
</Animated.View>
);
}
}
export default SplashScreen;

View File

@ -1,24 +0,0 @@
import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
title: {
// fontFamily: 'Sansation_Bold',
color: '$primaryDarkBlue',
fontSize: 30,
paddingBottom: 0,
},
subTitle: {
// fontFamily: 'Sansation_Regular',
color: '#00519c',
fontSize: 24,
},
logo: {
width: '$deviceWidth / 4',
height: '$deviceWidth / 4',
},
});