Merged with master

This commit is contained in:
Mustafa Buyukcelebi 2019-02-27 23:55:19 +03:00
commit 36e54fb2bd
17 changed files with 154 additions and 101 deletions

View File

@ -58,6 +58,23 @@ export default class MarkdownEditorView extends Component {
} }
} }
componentDidUpdate(prevProps, prevState) {
const { text } = this.state;
const { isFormValid, handleIsFormValid } = this.props;
if (prevState.text !== text && !isFormValid) {
const nextText = text.replace(prevState.text, '');
if (nextText && nextText.length > 0) {
this._changeText(text);
if (handleIsFormValid) {
handleIsFormValid(text);
}
}
}
}
// Component functions // Component functions
_changeText = (input) => { _changeText = (input) => {
const { const {
@ -147,7 +164,7 @@ export default class MarkdownEditorView extends Component {
iconType="FontAwesome" iconType="FontAwesome"
name="image" name="image"
/> />
{/* <View style={styles.clearButtonWrapper}> <View style={styles.clearButtonWrapper}>
<IconButton <IconButton
onPress={() => this.ClearActionSheet.show()} onPress={() => this.ClearActionSheet.show()}
size={20} size={20}
@ -155,7 +172,7 @@ export default class MarkdownEditorView extends Component {
iconType="FontAwesome" iconType="FontAwesome"
name="trash" name="trash"
/> />
</View> */} </View>
{/* TODO: After alpha */} {/* TODO: After alpha */}
{/* <DropdownButton {/* <DropdownButton
style={styles.dropdownStyle} style={styles.dropdownStyle}

View File

@ -38,6 +38,5 @@ export default EStyleSheet.create({
}, },
safeArea: { safeArea: {
backgroundColor: '$primaryBackgroundColor', backgroundColor: '$primaryBackgroundColor',
flex: 1,
}, },
}); });

View File

@ -93,17 +93,12 @@ class PostsView extends Component {
let newPosts = []; let newPosts = [];
this.setState({ isLoading: true }); this.setState({ isLoading: true });
if ((!filter && tag) || filter === 'feed' || filter === 'blog' || getFor === 'blog') { if (tag || filter === 'feed' || filter === 'blog' || getFor === 'blog') {
options = { options = {
tag, tag,
limit: 3, limit: 3,
}; };
} else if (filter == 'reblogs') { } else if (filter === 'reblogs') {
options = {
tag,
limit: 3,
};
} else if (tag) {
options = { options = {
tag, tag,
limit: 3, limit: 3,

View File

@ -2,6 +2,7 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({ export default EStyleSheet.create({
inputWrapper: { inputWrapper: {
marginTop: 20,
backgroundColor: '$primaryLightBackground', backgroundColor: '$primaryLightBackground',
flexDirection: 'row', flexDirection: 'row',
height: 44, height: 44,
@ -10,9 +11,6 @@ export default EStyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
marginHorizontal: 16, marginHorizontal: 16,
}, },
safeArea: {
marginTop: 20,
},
icon: { icon: {
alignSelf: 'center', alignSelf: 'center',
color: '$iconColor', color: '$iconColor',

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { View, SafeAreaView } from 'react-native'; import { SafeAreaView } from 'react-native';
// Components // Components
import { Icon } from '../../icon'; import { Icon } from '../../icon';
@ -11,31 +11,36 @@ import styles from './searchInputStyles';
/* Props /* Props
* ------------------------------------------------ * ------------------------------------------------
* @prop { type } name - Description.... * @prop { func } onChangeText - The function will trigger when input on change
* @prop { func } handleOnModalClose - Handle on click method for close button
* @prop { string } placeholder - Placeholder for input
* @prop { bool } editable - Editable value for input. Default value is true.
*/ */
const SearchInputView = ({ const SearchInputView = ({
onChangeText, handleOnModalClose, placeholder, editable = true, autoFocus = true, onChangeText,
handleOnModalClose,
placeholder,
editable = true,
autoFocus = true,
}) => ( }) => (
<SafeAreaView style={styles.safeArea}> <SafeAreaView style={styles.inputWrapper}>
<View style={styles.inputWrapper}> <Icon style={styles.icon} iconType="FontAwesome" name="search" size={15} />
<Icon style={styles.icon} iconType="FontAwesome" name="search" size={15} /> <TextInput
<TextInput style={styles.input}
style={styles.input} onChangeText={text => onChangeText(text)}
onChangeText={text => onChangeText(text)} placeholder={placeholder}
placeholder={placeholder} placeholderTextColor="#c1c5c7"
placeholderTextColor="#c1c5c7" autoCapitalize="none"
autoCapitalize="none" autoFocus={autoFocus}
autoFocus={autoFocus} editable={editable}
editable={editable} />
/> <IconButton
<IconButton iconStyle={styles.closeIcon}
iconStyle={styles.closeIcon} iconType="Ionicons"
iconType="Ionicons" style={styles.closeIconButton}
style={styles.closeIconButton} name="ios-close-circle-outline"
name="ios-close-circle-outline" onPress={() => handleOnModalClose()}
onPress={() => handleOnModalClose()} />
/>
</View>
</SafeAreaView> </SafeAreaView>
); );

View File

@ -53,6 +53,12 @@ export default EStyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
}, },
searchItemImageWrapper: {
flex: 1,
},
searchItemTextWrapper: {
flex: 7,
},
searchItemImage: { searchItemImage: {
width: 40, width: 40,
height: 40, height: 40,

View File

@ -59,7 +59,7 @@ class SearchModalView extends PureComponent {
renderItem={({ item }) => ( renderItem={({ item }) => (
<TouchableHighlight onPress={() => handleOnPressListItem(searchResults.type, item)}> <TouchableHighlight onPress={() => handleOnPressListItem(searchResults.type, item)}>
<View style={styles.searhItems}> <View style={styles.searhItems}>
<View style={{ flex: 1 }}> <View style={styles.searchItemImageWrapper}>
{item.image && ( {item.image && (
<FastImage <FastImage
source={{ source={{
@ -69,7 +69,7 @@ class SearchModalView extends PureComponent {
/> />
)} )}
</View> </View>
<View style={{ flex: 7 }}> <View style={styles.searchItemTextWrapper}>
{item.text && <Text style={styles.searchItemText}>{item.text}</Text>} {item.text && <Text style={styles.searchItemText}>{item.text}</Text>}
</View> </View>
</View> </View>

View File

@ -201,9 +201,9 @@
"no_existing_post": "پستی موجود نیست" "no_existing_post": "پستی موجود نیست"
}, },
"comment_filter": { "comment_filter": {
"trending": "trending", "trending": "پرطرفدار",
"reputation": "reputation", "reputation": "شهرت",
"votes": "votes", "votes": "رأی‌ ها",
"age": "age" "age": "سن"
} }
} }

View File

@ -79,7 +79,7 @@
"cancel": "batal", "cancel": "batal",
"login": "MASUK", "login": "MASUK",
"steemconnect_description": "Jika Anda tidak ingin menyimpan sandi Anda dienkripsi dan disimpan pada perangkat Anda, Anda dapat menggunakan Steemconnect.", "steemconnect_description": "Jika Anda tidak ingin menyimpan sandi Anda dienkripsi dan disimpan pada perangkat Anda, Anda dapat menggunakan Steemconnect.",
"steemconnect_fee_description": "Steemconnect may charge some fees from your reward transactions" "steemconnect_fee_description": "Steemconnect dapat membebankan beberapa biaya dari transaksi hadiah Anda"
}, },
"home": { "home": {
"feed": "Umpan", "feed": "Umpan",
@ -201,9 +201,9 @@
"no_existing_post": "Tidak ada post yang ada" "no_existing_post": "Tidak ada post yang ada"
}, },
"comment_filter": { "comment_filter": {
"trending": "trending", "trending": "Trending",
"reputation": "reputation", "reputation": "reputasi",
"votes": "votes", "votes": "berikan suara",
"age": "age" "age": "usia"
} }
} }

View File

@ -6,6 +6,9 @@ export default {
'it-IT': require('./it-IT.json'), 'it-IT': require('./it-IT.json'),
'ru-RU': require('./ru-RU.json'), 'ru-RU': require('./ru-RU.json'),
'tr-TR': require('./tr-TR.json'), 'tr-TR': require('./tr-TR.json'),
'ko-KR': require('./ko-KR.json'),
'lt-LT': require('./lt-LT.json'),
'pt-PT': require('./pt-PT.json'),
}; };
export const locales = [ export const locales = [
@ -16,4 +19,7 @@ export const locales = [
{ id: 'iT-IT', name: 'Italian' }, { id: 'iT-IT', name: 'Italian' },
{ id: 'ru-RU', name: 'Русский' }, { id: 'ru-RU', name: 'Русский' },
{ id: 'tr-TR', name: 'Türkçe' }, { id: 'tr-TR', name: 'Türkçe' },
{ id: 'ko-KR', name: 'Korean' },
{ id: 'lt-LT', name: 'Lithuanian' },
{ id: 'pt-PT', name: 'Porteguese' },
]; ];

View File

@ -79,7 +79,7 @@
"cancel": "geç", "cancel": "geç",
"login": "GİRİŞ", "login": "GİRİŞ",
"steemconnect_description": "Eğer kullanıçı bilgilerini şifreli olarak tutulmasını istemiyorsanız Steemconnect ilede giriş yapabilirsiniz.", "steemconnect_description": "Eğer kullanıçı bilgilerini şifreli olarak tutulmasını istemiyorsanız Steemconnect ilede giriş yapabilirsiniz.",
"steemconnect_fee_description": "Steemconnect may charge some fees from your reward transactions" "steemconnect_fee_description": "Not: Steemconnect ödül işlemlerinde bazı ücretler alabilir"
}, },
"home": { "home": {
"feed": "Akış", "feed": "Akış",
@ -115,8 +115,8 @@
"reply_placeholder": "Yukarıdaki yazi hakkinda nasil bir cevap yazmak istersin?", "reply_placeholder": "Yukarıdaki yazi hakkinda nasil bir cevap yazmak istersin?",
"publish": "Yayınla", "publish": "Yayınla",
"reply": "Cevapla", "reply": "Cevapla",
"open_galery": "Open Galery", "open_galery": "Gariyi Aç",
"capture_photo": "Capture a photo" "capture_photo": "Bir fotoğraf yakala"
}, },
"pincode": { "pincode": {
"enter_text": "Açmak için pin kodunu giriniz", "enter_text": "Açmak için pin kodunu giriniz",
@ -137,8 +137,8 @@
"warning": "Uyarı", "warning": "Uyarı",
"invalid_pincode": "Geçersiz pin gözden geçirip yeniden deneyin.", "invalid_pincode": "Geçersiz pin gözden geçirip yeniden deneyin.",
"remove_alert": "Kaldırmak istediğine emin misin ?", "remove_alert": "Kaldırmak istediğine emin misin ?",
"clear_alert": "Are you sure you want to clear?", "clear_alert": "Silmek istediğinizden emin misiniz?",
"clear": "Clear", "clear": "Temizle",
"cancel": "Vazgeç", "cancel": "Vazgeç",
"delete": "Temizle", "delete": "Temizle",
"copied": "Kopyalandı", "copied": "Kopyalandı",
@ -166,7 +166,7 @@
"empty_list": "Burada hiçbir şey yok", "empty_list": "Burada hiçbir şey yok",
"deleted": "Yer işareti kaldırıldı", "deleted": "Yer işareti kaldırıldı",
"search": "Yer imlerinde ara", "search": "Yer imlerinde ara",
"added": "Added to bookmarks", "added": "Yer imlerine eklendi",
"add": "Yerimlerine ekle" "add": "Yerimlerine ekle"
}, },
"favorites": { "favorites": {
@ -198,12 +198,12 @@
}, },
"deep_link": { "deep_link": {
"no_existing_user": "Kullanici Bulunamadi", "no_existing_user": "Kullanici Bulunamadi",
"no_existing_post": "Boyle bir icerik yok" "no_existing_post": "Kullanici Bulunamadi"
}, },
"comment_filter": { "comment_filter": {
"trending": "trending", "trending": "öne çıkanlar",
"reputation": "reputation", "reputation": "itibar",
"votes": "votes", "votes": "oylar",
"age": "age" "age": "yaş"
} }
} }

View File

@ -1,3 +1,23 @@
export default ['Deutsche', 'English', 'Hungarian', 'Indonesian', 'Russian', 'Turkish']; export default [
'Deutsche',
'English',
'Hungarian',
'Indonesian',
'Korean',
'Lithuanian',
'Porteguese',
'Russian',
'Turkish',
];
export const VALUE = ['de-DE', 'en-US', 'hu-HU', 'id-ID', 'ru-RU', 'tr-TR']; export const VALUE = [
'de-DE',
'en-US',
'hu-HU',
'id-ID',
'ko-KR',
'lt-LT',
'pt-PT',
'ru-RU',
'tr-TR',
];

View File

@ -10,7 +10,7 @@ import { NavigationActions } from 'react-navigation';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import Push from 'appcenter-push'; import Push from 'appcenter-push';
// Constants // Languages
import en from 'react-intl/locale-data/en'; import en from 'react-intl/locale-data/en';
import id from 'react-intl/locale-data/id'; import id from 'react-intl/locale-data/id';
import ru from 'react-intl/locale-data/ru'; import ru from 'react-intl/locale-data/ru';
@ -18,7 +18,11 @@ import de from 'react-intl/locale-data/de';
import it from 'react-intl/locale-data/it'; import it from 'react-intl/locale-data/it';
import hu from 'react-intl/locale-data/hu'; import hu from 'react-intl/locale-data/hu';
import tr from 'react-intl/locale-data/tr'; import tr from 'react-intl/locale-data/tr';
import ko from 'react-intl/locale-data/ko';
import lt from 'react-intl/locale-data/lt';
import pt from 'react-intl/locale-data/pt';
// Constants
import AUTH_TYPE from '../../../constants/authType'; import AUTH_TYPE from '../../../constants/authType';
// Services // Services
@ -67,7 +71,7 @@ import {
import ApplicationScreen from '../screen/applicationScreen'; import ApplicationScreen from '../screen/applicationScreen';
import { Launch } from '../..'; import { Launch } from '../..';
addLocaleData([...en, ...ru, ...de, ...id, ...it, ...hu, ...tr]); addLocaleData([...en, ...ru, ...de, ...id, ...it, ...hu, ...tr, ...ko, ...pt, ...lt]);
class ApplicationContainer extends Component { class ApplicationContainer extends Component {
constructor() { constructor() {

View File

@ -50,7 +50,7 @@ class BookmarksScreen extends Component {
index={index} index={index}
isClickable isClickable
text={text} text={text}
username={item.author} username={isFavorites ? item.account : item.author}
/> />
); );
} }

View File

@ -39,7 +39,7 @@ class EditorScreen extends Component {
// Component Life Cycles // Component Life Cycles
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
const { draftPost } = this.props; const { draftPost, isUploading } = this.props;
if (nextProps.draftPost && draftPost !== nextProps.draftPost) { if (nextProps.draftPost && draftPost !== nextProps.draftPost) {
this.setState({ this.setState({
@ -48,6 +48,10 @@ class EditorScreen extends Component {
}, },
}); });
} }
if (isUploading !== nextProps) {
this._handleFormUpdate();
}
}; };
// Component Functions // Component Functions
@ -107,7 +111,7 @@ class EditorScreen extends Component {
} }
}; };
_handleIsFormValid = () => { _handleIsFormValid = (bodyText) => {
const { fields } = this.state; const { fields } = this.state;
const { isReply } = this.props; const { isReply } = this.props;
let _isFormValid; let _isFormValid;
@ -118,9 +122,8 @@ class EditorScreen extends Component {
_isFormValid = fields _isFormValid = fields
&& fields.title && fields.title
&& fields.title.length > 0 && fields.title.length > 0
&& fields.body && ((fields.body && fields.body.length > 0 && fields.tags.length > 0)
&& fields.body.length > 0 || (bodyText && bodyText.length > 0));
&& fields.tags.length > 0;
} }
this.setState({ isFormValid: _isFormValid }); this.setState({ isFormValid: _isFormValid });
@ -215,6 +218,9 @@ class EditorScreen extends Component {
componentID="body" componentID="body"
draftBody={fields && fields.body} draftBody={fields && fields.body}
handleOnTextChange={this._setWordsCount} handleOnTextChange={this._setWordsCount}
handleFormUpdate={this._handleFormUpdate}
handleIsFormValid={this._handleIsFormValid}
isFormValid={isFormValid}
handleOpenImagePicker={handleOnImagePicker} handleOpenImagePicker={handleOnImagePicker}
intl={intl} intl={intl}
uploadedImage={uploadedImage} uploadedImage={uploadedImage}

View File

@ -56,7 +56,7 @@ class ProfileContainer extends Component {
return; return;
} }
if (selectedUser && selectedUser.username) { if (selectedUser && selectedUser.username && selectedUser.username !== currentAccount.name) {
this._loadProfile(selectedUser.username); this._loadProfile(selectedUser.username);
if (selectedUser.username) { if (selectedUser.username) {

View File

@ -1,4 +1,4 @@
import React, { PureComponent, Fragment } from 'react'; import React, { PureComponent } from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view'; import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
import { injectIntl } from 'react-intl'; import { injectIntl } from 'react-intl';
@ -22,35 +22,33 @@ class SearchResultScreen extends PureComponent {
const { intl, tag, navigationGoBack } = this.props; const { intl, tag, navigationGoBack } = this.props;
return ( return (
<Fragment> <View style={styles.container}>
<View style={styles.container}> <SearchInput
<SearchInput onChangeText={() => {}}
onChangeText={text => console.log('text :', text)} handleOnModalClose={navigationGoBack}
handleOnModalClose={navigationGoBack} placeholder={`#${tag}`}
placeholder={`#${tag}`} editable={false}
editable={false} />
autoFocus={false} <ScrollableTabView
/> style={globalStyles.tabView}
<ScrollableTabView renderTabBar={() => (
style={globalStyles.tabView} <TabBar
renderTabBar={() => ( style={styles.tabbar}
<TabBar tabUnderlineDefaultWidth={80}
style={styles.tabbar} tabUnderlineScaleX={2}
tabUnderlineDefaultWidth={80} tabBarPosition="overlayTop"
tabUnderlineScaleX={2} />
tabBarPosition="overlayTop" )}
/> >
)} <View
tabLabel={intl.formatMessage({
id: 'search.posts',
})}
style={styles.tabbarItem}
> >
<View <Posts pageType="posts" tag={tag} />
tabLabel={intl.formatMessage({ </View>
id: 'search.posts', {/* <View
})}
style={styles.tabbarItem}
>
<Posts pageType="posts" tag={tag} />
</View>
{/* <View
tabLabel={intl.formatMessage({ tabLabel={intl.formatMessage({
id: 'search.comments', id: 'search.comments',
})} })}
@ -63,9 +61,8 @@ class SearchResultScreen extends PureComponent {
pageType="posts" pageType="posts"
/> />
</Fragment> */} </Fragment> */}
</ScrollableTabView> </ScrollableTabView>
</View> </View>
</Fragment>
); );
} }
} }