From dfa0d963bcf1eeff6b5b162db08780364157bb46 Mon Sep 17 00:00:00 2001 From: u-e Date: Mon, 11 Feb 2019 14:15:01 +0300 Subject: [PATCH 01/11] removed wrong style --- src/components/modal/view/modalStyles.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/modal/view/modalStyles.js b/src/components/modal/view/modalStyles.js index cc310a71a..84c920208 100644 --- a/src/components/modal/view/modalStyles.js +++ b/src/components/modal/view/modalStyles.js @@ -38,6 +38,5 @@ export default EStyleSheet.create({ }, safeArea: { backgroundColor: '$primaryBackgroundColor', - flex: 1, }, }); From d5f94d2a5af8d833128119ac3227963442486e81 Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 26 Feb 2019 00:25:42 +0300 Subject: [PATCH 02/11] fixed editor publish issue --- .../markdownEditor/view/markdownEditorView.js | 21 +++++++- .../container/applicationContainer.js | 38 +++++++------- .../editor/container/editorContainer.js | 52 ++++++++++--------- src/screens/editor/screen/editorScreen.js | 16 ++++-- 4 files changed, 76 insertions(+), 51 deletions(-) diff --git a/src/components/markdownEditor/view/markdownEditorView.js b/src/components/markdownEditor/view/markdownEditorView.js index 0b0714898..38e57a5d1 100644 --- a/src/components/markdownEditor/view/markdownEditorView.js +++ b/src/components/markdownEditor/view/markdownEditorView.js @@ -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 _changeText = (input) => { const { @@ -147,7 +164,7 @@ export default class MarkdownEditorView extends Component { iconType="FontAwesome" name="image" /> - {/* + this.ClearActionSheet.show()} size={20} @@ -155,7 +172,7 @@ export default class MarkdownEditorView extends Component { iconType="FontAwesome" name="trash" /> - */} + {/* TODO: After alpha */} {/* { - let isConnected; + // let isConnected; - await NetInfo.isConnected.fetch().then((_isConnected) => { - isConnected = _isConnected; - }); + // await NetInfo.isConnected.fetch().then((_isConnected) => { + // isConnected = _isConnected; + // }); - NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); - BackHandler.addEventListener('hardwareBackPress', this._onBackPress); + // NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); + // BackHandler.addEventListener('hardwareBackPress', this._onBackPress); - if (isConnected) { - this._fetchApp(); - } else { - Alert.alert('No internet connection'); - } - - this.globalInterval = setInterval(this._refreshGlobalProps, 60000); + // if (isConnected) { + // } else { + // Alert.alert('No internet connection'); + // } + + // this.globalInterval = setInterval(this._refreshGlobalProps, 60000); + this._fetchApp(); }; componentWillReceiveProps(nextProps) { @@ -116,9 +116,9 @@ class ApplicationContainer extends Component { } componentWillUnmount() { - BackHandler.removeEventListener('hardwareBackPress', this.onBackPress); - NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); - clearInterval(this.globalInterval); + // BackHandler.removeEventListener('hardwareBackPress', this.onBackPress); + // NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); + // clearInterval(this.globalInterval); } _fetchApp = async () => { @@ -135,8 +135,8 @@ class ApplicationContainer extends Component { } // TODO: solve this work arround - NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); - NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); + // NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); + // NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); }; _onBackPress = () => { @@ -145,7 +145,7 @@ class ApplicationContainer extends Component { if (nav && nav[0].index !== 0) { dispatch(NavigationActions.back()); } else { - BackHandler.exitApp(); + //BackHandler.exitApp(); } return true; }; diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index 9d75d9126..b219c0008 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -118,7 +118,7 @@ class EditorContainer extends Component { }); } else { await getDraftPost(username) - .then(result => { + .then((result) => { this.setState({ draftPost: { body: result.body, title: result.title, tags: result.tags.split(',') }, }); @@ -131,7 +131,7 @@ class EditorContainer extends Component { _getPurePost = (author, permlink) => { getPurePost(author, permlink) - .then(result => { + .then((result) => { if (result) { this.setState(prevState => ({ draftPost: { @@ -144,7 +144,7 @@ class EditorContainer extends Component { .catch(() => {}); }; - _handleRoutingAction = routingAction => { + _handleRoutingAction = (routingAction) => { this.setState({ isCameraOrPickerOpen: true }); if (routingAction === 'camera') { @@ -160,10 +160,10 @@ class EditorContainer extends Component { ImagePicker.openPicker({ includeBase64: true, }) - .then(image => { + .then((image) => { this._handleMediaOnSelected(image); }) - .catch(e => { + .catch((e) => { this._handleMediaOnSelectFailure(e); }); }; @@ -172,15 +172,15 @@ class EditorContainer extends Component { ImagePicker.openCamera({ includeBase64: true, }) - .then(image => { + .then((image) => { this._handleMediaOnSelected(image); }) - .catch(e => { + .catch((e) => { this._handleMediaOnSelectFailure(e); }); }; - _handleMediaOnSelected = media => { + _handleMediaOnSelected = (media) => { this.setState({ isCameraOrPickerOpen: false, isUploading: true }, () => { this._uploadImage(media); }); @@ -192,7 +192,7 @@ class EditorContainer extends Component { // const data = new Buffer(media.data, 'base64'); }; - _uploadImage = media => { + _uploadImage = (media) => { const { intl } = this.props; const file = { @@ -203,12 +203,12 @@ class EditorContainer extends Component { }; uploadImage(file) - .then(res => { + .then((res) => { if (res.data && res.data.url) { this.setState({ uploadedImage: res.data, isUploading: false }); } }) - .catch(error => { + .catch((error) => { Alert.alert( intl.formatMessage({ id: 'alert.fail', @@ -219,7 +219,7 @@ class EditorContainer extends Component { }); }; - _handleMediaOnSelectFailure = error => { + _handleMediaOnSelectFailure = (error) => { const { intl } = this.props; this.setState({ isCameraOrPickerOpen: false }); @@ -237,7 +237,7 @@ class EditorContainer extends Component { // Media select functions <- END -> - _saveDraftToDB = fields => { + _saveDraftToDB = (fields) => { const { isDraftSaved, draftId } = this.state; if (!isDraftSaved) { const { currentAccount } = this.props; @@ -257,7 +257,7 @@ class EditorContainer extends Component { }); }); } else { - addDraft(draftField).then(response => { + addDraft(draftField).then((response) => { this.setState({ isDraftSaved: true, draftId: response._id, @@ -271,7 +271,7 @@ class EditorContainer extends Component { } }; - _saveCurrentDraft = async fields => { + _saveCurrentDraft = async (fields) => { const { draftId, isReply } = this.state; if (!draftId) { @@ -291,8 +291,10 @@ class EditorContainer extends Component { } }; - _submitPost = async fields => { - const { navigation, currentAccount, pinCode, intl } = this.props; + _submitPost = async (fields) => { + const { + navigation, currentAccount, pinCode, intl, + } = this.props; if (currentAccount) { this.setState({ isPostSending: true }); @@ -351,13 +353,13 @@ class EditorContainer extends Component { setDraftPost({ title: '', body: '', tags: [] }, currentAccount.name); }) - .catch(error => { + .catch((error) => { this._handleSubmitFailure(error); }); } }; - _submitReply = async fields => { + _submitReply = async (fields) => { const { currentAccount, pinCode } = this.props; if (currentAccount) { @@ -386,15 +388,15 @@ class EditorContainer extends Component { ) .then(() => { this._handleSubmitSuccess(); - AsyncStorage.setItem('temp-reply', ""); + AsyncStorage.setItem('temp-reply', ''); }) - .catch(error => { + .catch((error) => { this._handleSubmitFailure(error); }); } }; - _submitEdit = async fields => { + _submitEdit = async (fields) => { const { currentAccount, pinCode } = this.props; const { post } = this.state; if (currentAccount) { @@ -432,13 +434,13 @@ class EditorContainer extends Component { .then(() => { this._handleSubmitSuccess(); }) - .catch(error => { + .catch((error) => { this._handleSubmitFailure(error); }); } }; - _handleSubmitFailure = error => { + _handleSubmitFailure = (error) => { const { intl } = this.props; Alert.alert( @@ -466,7 +468,7 @@ class EditorContainer extends Component { } }; - _handleSubmit = form => { + _handleSubmit = (form) => { const { isReply, isEdit } = this.state; if (isReply && !isEdit) { diff --git a/src/screens/editor/screen/editorScreen.js b/src/screens/editor/screen/editorScreen.js index fdffb7f40..e29d39404 100644 --- a/src/screens/editor/screen/editorScreen.js +++ b/src/screens/editor/screen/editorScreen.js @@ -39,7 +39,7 @@ class EditorScreen extends Component { // Component Life Cycles componentWillReceiveProps = (nextProps) => { - const { draftPost } = this.props; + const { draftPost, isUploading } = this.props; if (nextProps.draftPost && draftPost !== nextProps.draftPost) { this.setState({ @@ -48,6 +48,10 @@ class EditorScreen extends Component { }, }); } + + if (isUploading !== nextProps) { + this._handleFormUpdate(); + } }; // Component Functions @@ -107,7 +111,7 @@ class EditorScreen extends Component { } }; - _handleIsFormValid = () => { + _handleIsFormValid = (bodyText) => { const { fields } = this.state; const { isReply } = this.props; let _isFormValid; @@ -118,9 +122,8 @@ class EditorScreen extends Component { _isFormValid = fields && fields.title && fields.title.length > 0 - && fields.body - && fields.body.length > 0 - && fields.tags.length > 0; + && ((fields.body && fields.body.length > 0 && fields.tags.length > 0) + || (bodyText && bodyText.length > 0)); } this.setState({ isFormValid: _isFormValid }); @@ -215,6 +218,9 @@ class EditorScreen extends Component { componentID="body" draftBody={fields && fields.body} handleOnTextChange={this._setWordsCount} + handleFormUpdate={this._handleFormUpdate} + handleIsFormValid={this._handleIsFormValid} + isFormValid={isFormValid} handleOpenImagePicker={handleOnImagePicker} intl={intl} uploadedImage={uploadedImage} From ba110fcebae552de14ce4bcf63756fb5019aff5c Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 26 Feb 2019 00:28:42 +0300 Subject: [PATCH 03/11] removed missing changes --- .../container/applicationContainer.js | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index b9497c268..5c7706fe2 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -75,26 +75,28 @@ class ApplicationContainer extends Component { this.state = { isRenderRequire: true, isReady: false, + isIos: Platform.OS !== 'android', }; } componentDidMount = async () => { - // let isConnected; + const { isIos } = this.state; + let isConnected; - // await NetInfo.isConnected.fetch().then((_isConnected) => { - // isConnected = _isConnected; - // }); + await NetInfo.isConnected.fetch().then((_isConnected) => { + isConnected = _isConnected; + }); - // NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); - // BackHandler.addEventListener('hardwareBackPress', this._onBackPress); + NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); + if (!isIos) BackHandler.addEventListener('hardwareBackPress', this._onBackPress); - // if (isConnected) { - // } else { - // Alert.alert('No internet connection'); - // } - - // this.globalInterval = setInterval(this._refreshGlobalProps, 60000); - this._fetchApp(); + if (isConnected) { + this._fetchApp(); + } else { + Alert.alert('No internet connection'); + } + + this.globalInterval = setInterval(this._refreshGlobalProps, 60000); }; componentWillReceiveProps(nextProps) { @@ -116,9 +118,12 @@ class ApplicationContainer extends Component { } componentWillUnmount() { - // BackHandler.removeEventListener('hardwareBackPress', this.onBackPress); - // NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); - // clearInterval(this.globalInterval); + const { isIos } = this.state; + + if (!isIos) BackHandler.removeEventListener('hardwareBackPress', this._onBackPress); + + NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); + clearInterval(this.globalInterval); } _fetchApp = async () => { @@ -135,8 +140,8 @@ class ApplicationContainer extends Component { } // TODO: solve this work arround - // NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); - // NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); + NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); + NetInfo.isConnected.addEventListener('connectionChange', this._handleConntectionChange); }; _onBackPress = () => { @@ -145,7 +150,7 @@ class ApplicationContainer extends Component { if (nav && nav[0].index !== 0) { dispatch(NavigationActions.back()); } else { - //BackHandler.exitApp(); + BackHandler.exitApp(); } return true; }; From e0e9195e0164621d6557987ee05319695b76c7d6 Mon Sep 17 00:00:00 2001 From: Feruz M Date: Tue, 26 Feb 2019 07:34:49 +0200 Subject: [PATCH 04/11] New translations en-US.json (Persian) --- src/config/locales/fa-IR.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/locales/fa-IR.json b/src/config/locales/fa-IR.json index 0a92d775d..7f6e37c6b 100644 --- a/src/config/locales/fa-IR.json +++ b/src/config/locales/fa-IR.json @@ -201,9 +201,9 @@ "no_existing_post": "پستی موجود نیست" }, "comment_filter": { - "trending": "trending", - "reputation": "reputation", - "votes": "votes", - "age": "age" + "trending": "پرطرفدار", + "reputation": "شهرت", + "votes": "رأی‌ ها", + "age": "سن" } } From eab8fe46223f620f92a8a3c0e95416dbd684a3f4 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Tue, 26 Feb 2019 12:37:14 +0300 Subject: [PATCH 05/11] Fixed search current user issue --- src/screens/profile/container/profileContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/profile/container/profileContainer.js b/src/screens/profile/container/profileContainer.js index 7fe4ee9ec..8df955291 100644 --- a/src/screens/profile/container/profileContainer.js +++ b/src/screens/profile/container/profileContainer.js @@ -56,7 +56,7 @@ class ProfileContainer extends Component { return; } - if (selectedUser && selectedUser.username) { + if (selectedUser && selectedUser.username && selectedUser.username !== currentAccount.name) { this._loadProfile(selectedUser.username); if (selectedUser.username) { From b668f64ea13ed61f891b41f356eceefbb1d05f4e Mon Sep 17 00:00:00 2001 From: Feruz M Date: Tue, 26 Feb 2019 21:15:17 +0200 Subject: [PATCH 06/11] New translations en-US.json (Indonesian) --- src/config/locales/id-ID.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/locales/id-ID.json b/src/config/locales/id-ID.json index 9c4474872..29323d822 100644 --- a/src/config/locales/id-ID.json +++ b/src/config/locales/id-ID.json @@ -201,9 +201,9 @@ "no_existing_post": "Tidak ada post yang ada" }, "comment_filter": { - "trending": "trending", - "reputation": "reputation", - "votes": "votes", - "age": "age" + "trending": "Trending", + "reputation": "reputasi", + "votes": "berikan suara", + "age": "usia" } } From 7f26c2c1cf094f48f734cacc792c83a61da71249 Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 26 Feb 2019 22:16:29 +0300 Subject: [PATCH 07/11] fixed user avatar issue --- src/screens/bookmarks/screen/bookmarksScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/bookmarks/screen/bookmarksScreen.js b/src/screens/bookmarks/screen/bookmarksScreen.js index a087d5809..e73fc77c5 100644 --- a/src/screens/bookmarks/screen/bookmarksScreen.js +++ b/src/screens/bookmarks/screen/bookmarksScreen.js @@ -50,7 +50,7 @@ class BookmarksScreen extends Component { index={index} isClickable text={text} - username={item.author} + username={isFavorites ? item.account : item.author} /> ); } From 51a780bbde3dda2389839cde45775ab83b36545b Mon Sep 17 00:00:00 2001 From: Feruz M Date: Tue, 26 Feb 2019 21:25:26 +0200 Subject: [PATCH 08/11] New translations en-US.json (Indonesian) --- src/config/locales/id-ID.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/locales/id-ID.json b/src/config/locales/id-ID.json index 29323d822..53e9a1267 100644 --- a/src/config/locales/id-ID.json +++ b/src/config/locales/id-ID.json @@ -79,7 +79,7 @@ "cancel": "batal", "login": "MASUK", "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": { "feed": "Umpan", From d81e60d1a1c3c8abace95635890b3c0dd5e7f904 Mon Sep 17 00:00:00 2001 From: Feruz M Date: Tue, 26 Feb 2019 21:25:27 +0200 Subject: [PATCH 09/11] New translations en-US.json (Turkish) --- src/config/locales/tr-TR.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/config/locales/tr-TR.json b/src/config/locales/tr-TR.json index ad931b02c..51f5f21f9 100644 --- a/src/config/locales/tr-TR.json +++ b/src/config/locales/tr-TR.json @@ -79,7 +79,7 @@ "cancel": "geç", "login": "GİRİŞ", "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": { "feed": "Akış", @@ -115,8 +115,8 @@ "reply_placeholder": "Yukarıdaki yazi hakkinda nasil bir cevap yazmak istersin?", "publish": "Yayınla", "reply": "Cevapla", - "open_galery": "Open Galery", - "capture_photo": "Capture a photo" + "open_galery": "Gariyi Aç", + "capture_photo": "Bir fotoğraf yakala" }, "pincode": { "enter_text": "Açmak için pin kodunu giriniz", @@ -137,8 +137,8 @@ "warning": "Uyarı", "invalid_pincode": "Geçersiz pin gözden geçirip yeniden deneyin.", "remove_alert": "Kaldırmak istediğine emin misin ?", - "clear_alert": "Are you sure you want to clear?", - "clear": "Clear", + "clear_alert": "Silmek istediğinizden emin misiniz?", + "clear": "Temizle", "cancel": "Vazgeç", "delete": "Temizle", "copied": "Kopyalandı", @@ -166,7 +166,7 @@ "empty_list": "Burada hiçbir şey yok", "deleted": "Yer işareti kaldırıldı", "search": "Yer imlerinde ara", - "added": "Added to bookmarks", + "added": "Yer imlerine eklendi", "add": "Yerimlerine ekle" }, "favorites": { @@ -198,12 +198,12 @@ }, "deep_link": { "no_existing_user": "Kullanici Bulunamadi", - "no_existing_post": "Boyle bir icerik yok" + "no_existing_post": "Kullanici Bulunamadi" }, "comment_filter": { - "trending": "trending", - "reputation": "reputation", - "votes": "votes", - "age": "age" + "trending": "öne çıkanlar", + "reputation": "itibar", + "votes": "oylar", + "age": "yaş" } } From 8323db475818760142a7ddcdb672a3d15dffc42f Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 26 Feb 2019 22:31:29 +0300 Subject: [PATCH 10/11] added porteguese lithuanian and korean --- src/config/locales/index.js | 6 +++++ src/constants/options/language.js | 24 +++++++++++++++++-- .../container/applicationContainer.js | 8 +++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/config/locales/index.js b/src/config/locales/index.js index 62ec76350..ba1dadee1 100644 --- a/src/config/locales/index.js +++ b/src/config/locales/index.js @@ -6,6 +6,9 @@ export default { 'it-IT': require('./it-IT.json'), 'ru-RU': require('./ru-RU.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 = [ @@ -16,4 +19,7 @@ export const locales = [ { id: 'iT-IT', name: 'Italian' }, { id: 'ru-RU', name: 'Русский' }, { id: 'tr-TR', name: 'Türkçe' }, + { id: 'ko-KR', name: 'Korean' }, + { id: 'lt-LT', name: 'Lithuanian' }, + { id: 'pt-PT', name: 'Porteguese' }, ]; diff --git a/src/constants/options/language.js b/src/constants/options/language.js index c0327a432..1fe1d87c3 100644 --- a/src/constants/options/language.js +++ b/src/constants/options/language.js @@ -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', +]; diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 5c7706fe2..71f9242a5 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -10,7 +10,7 @@ import { NavigationActions } from 'react-navigation'; import { bindActionCreators } from 'redux'; import Push from 'appcenter-push'; -// Constants +// Languages import en from 'react-intl/locale-data/en'; import id from 'react-intl/locale-data/id'; 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 hu from 'react-intl/locale-data/hu'; 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'; // Services @@ -67,7 +71,7 @@ import { import ApplicationScreen from '../screen/applicationScreen'; 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 { constructor() { From 98b7eb885a59fd5bd178f6c7cdf30a12da34ec51 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Wed, 27 Feb 2019 23:47:10 +0300 Subject: [PATCH 11/11] Fixed pr comment requirements --- src/components/posts/view/postsView.js | 9 +-- .../searchInput/view/searchInputStyles.js | 4 +- .../searchInput/view/searchInputView.js | 43 +++++++------- .../searchModal/view/searchModalStyles.js | 6 ++ .../searchModal/view/searchModalView.js | 4 +- .../searchResult/screen/searchResultScreen.js | 58 +++++++++---------- 6 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/components/posts/view/postsView.js b/src/components/posts/view/postsView.js index 52d4ba2af..fd856a5ae 100644 --- a/src/components/posts/view/postsView.js +++ b/src/components/posts/view/postsView.js @@ -93,17 +93,12 @@ class PostsView extends Component { let newPosts = []; this.setState({ isLoading: true }); - if ((!filter && tag) || filter === 'feed' || filter === 'blog' || getFor === 'blog') { + if (tag || filter === 'feed' || filter === 'blog' || getFor === 'blog') { options = { tag, limit: 3, }; - } else if (filter == 'reblogs') { - options = { - tag, - limit: 3, - }; - } else if (tag) { + } else if (filter === 'reblogs') { options = { tag, limit: 3, diff --git a/src/components/searchInput/view/searchInputStyles.js b/src/components/searchInput/view/searchInputStyles.js index 5b465ac8e..d18e9ef6e 100644 --- a/src/components/searchInput/view/searchInputStyles.js +++ b/src/components/searchInput/view/searchInputStyles.js @@ -2,6 +2,7 @@ import EStyleSheet from 'react-native-extended-stylesheet'; export default EStyleSheet.create({ inputWrapper: { + marginTop: 20, backgroundColor: '$primaryLightBackground', flexDirection: 'row', height: 44, @@ -10,9 +11,6 @@ export default EStyleSheet.create({ justifyContent: 'center', marginHorizontal: 16, }, - safeArea: { - marginTop: 20, - }, icon: { alignSelf: 'center', color: '$iconColor', diff --git a/src/components/searchInput/view/searchInputView.js b/src/components/searchInput/view/searchInputView.js index 41a448cfb..291196e3b 100644 --- a/src/components/searchInput/view/searchInputView.js +++ b/src/components/searchInput/view/searchInputView.js @@ -11,31 +11,32 @@ import styles from './searchInputStyles'; /* 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 = ({ onChangeText, handleOnModalClose, placeholder, editable = true, }) => ( - - - - onChangeText(text)} - placeholder={placeholder} - placeholderTextColor="#c1c5c7" - autoCapitalize="none" - autoFocus - editable={editable} - /> - handleOnModalClose()} - /> - + + + onChangeText(text)} + placeholder={placeholder} + placeholderTextColor="#c1c5c7" + autoCapitalize="none" + autoFocus + editable={editable} + /> + handleOnModalClose()} + /> ); diff --git a/src/components/searchModal/view/searchModalStyles.js b/src/components/searchModal/view/searchModalStyles.js index 21fd03675..94485094d 100644 --- a/src/components/searchModal/view/searchModalStyles.js +++ b/src/components/searchModal/view/searchModalStyles.js @@ -53,6 +53,12 @@ export default EStyleSheet.create({ flexDirection: 'row', alignItems: 'center', }, + searchItemImageWrapper: { + flex: 1, + }, + searchItemTextWrapper: { + flex: 7, + }, searchItemImage: { width: 40, height: 40, diff --git a/src/components/searchModal/view/searchModalView.js b/src/components/searchModal/view/searchModalView.js index e819a86b4..1a4772a5d 100644 --- a/src/components/searchModal/view/searchModalView.js +++ b/src/components/searchModal/view/searchModalView.js @@ -59,7 +59,7 @@ class SearchModalView extends PureComponent { renderItem={({ item }) => ( handleOnPressListItem(searchResults.type, item)}> - + {item.image && ( )} - + {item.text && {item.text}} diff --git a/src/screens/searchResult/screen/searchResultScreen.js b/src/screens/searchResult/screen/searchResultScreen.js index 61c4a1e7e..ada66d14e 100644 --- a/src/screens/searchResult/screen/searchResultScreen.js +++ b/src/screens/searchResult/screen/searchResultScreen.js @@ -22,34 +22,33 @@ class SearchResultScreen extends PureComponent { const { intl, tag, navigationGoBack } = this.props; return ( - - - console.log('text :', text)} - handleOnModalClose={navigationGoBack} - placeholder={tag} - editable={false} - /> - ( - - )} + + {}} + handleOnModalClose={navigationGoBack} + placeholder={tag} + editable={false} + /> + ( + + )} + > + - - - - {/* + + {/* */} - - - + + ); } }