From e0277749c24779fdcbdb5338e1e4c7f601ccc75f Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 28 Oct 2019 22:53:03 +0300 Subject: [PATCH] Revert "created themeContainer fixed markdown placeholder issue" --- .../placeHolder/listItemPlaceHolderView.js | 52 +++++++++---------- .../view/placeHolder/listPlaceHolderView.js | 8 ++- .../markdownEditor/view/markdownEditorView.js | 38 ++++++-------- src/containers/index.js | 2 - src/containers/redeemContainer.js | 1 + src/containers/themeContainer.js | 18 ------- .../container/notificationContainer.js | 4 +- 7 files changed, 51 insertions(+), 72 deletions(-) delete mode 100644 src/containers/themeContainer.js diff --git a/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js index 15a198e66..807143c46 100644 --- a/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js @@ -1,38 +1,34 @@ import React from 'react'; +import { connect } from 'react-redux'; import { View } from 'react-native'; import Placeholder from 'rn-placeholder'; -import { ThemeContainer } from '../../../../containers'; - import styles from './listItemPlaceHolderStyles'; -const ListItemPlaceHolderView = () => { +const ListItemPlaceHolderView = ({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + return ( - - {({ isDarkTheme }) => ( - - - - - - - )} - + + + + + + ); }; -export default ListItemPlaceHolderView; +const mapStateToProps = state => ({ + isDarkTheme: state.application.isDarkTheme, +}); + +export default connect(mapStateToProps)(ListItemPlaceHolderView); diff --git a/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js index 66478b5d0..4aea8d528 100644 --- a/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js @@ -1,5 +1,6 @@ /* eslint-disable radix */ import React, { Fragment } from 'react'; +import { connect } from 'react-redux'; import { Dimensions } from 'react-native'; import times from 'lodash/times'; @@ -17,4 +18,9 @@ const ListPlaceHolderView = () => { return {listElements}; }; -export default ListPlaceHolderView; + +const mapStateToProps = state => ({ + isDarkTheme: state.application.isDarkTheme, +}); + +export default connect(mapStateToProps)(ListPlaceHolderView); diff --git a/src/components/markdownEditor/view/markdownEditorView.js b/src/components/markdownEditor/view/markdownEditorView.js index 02810b4e7..4ceea3c11 100644 --- a/src/components/markdownEditor/view/markdownEditorView.js +++ b/src/components/markdownEditor/view/markdownEditorView.js @@ -13,8 +13,6 @@ import { PostBody } from '../../postElements'; import { StickyBar } from '../../basicUIElements'; import { TextInput } from '../../textInput'; -import { ThemeContainer } from '../../../containers'; - // Styles import styles from './markdownEditorStyles'; @@ -203,26 +201,22 @@ export default class MarkdownEditorView extends Component { behavior={Platform.OS === 'ios' ? 'padding' : null} > {!isPreviewActive ? ( - - {({ isDarkTheme }) => ( - - )} - + ) : ( this._renderPreview() )} diff --git a/src/containers/index.js b/src/containers/index.js index d946950dd..3c40f946e 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -6,7 +6,6 @@ import ProfileEditContainer from './profileEditContainer'; import RedeemContainer from './redeemContainer'; import SpinGameContainer from './spinGameContainer'; import TransferContainer from './transferContainer'; -import ThemeContainer from './themeContainer'; export { DarkThemeContainer, @@ -17,5 +16,4 @@ export { RedeemContainer, SpinGameContainer, TransferContainer, - ThemeContainer, }; diff --git a/src/containers/redeemContainer.js b/src/containers/redeemContainer.js index 9e326c3ef..7a6383a6c 100644 --- a/src/containers/redeemContainer.js +++ b/src/containers/redeemContainer.js @@ -140,6 +140,7 @@ class RedeemContainer extends Component { const mapStateToProps = state => ({ username: state.account.currentAccount.name, + isDarkTheme: state.application.isDarkTheme, activeBottomTab: state.ui.activeBottomTab, isConnected: state.application.isConnected, accounts: state.account.otherAccounts, diff --git a/src/containers/themeContainer.js b/src/containers/themeContainer.js deleted file mode 100644 index 22a24adff..000000000 --- a/src/containers/themeContainer.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable no-unused-vars */ -import React from 'react'; -import { connect } from 'react-redux'; - -const ThemeContainer = ({ children, isDarkTheme }) => { - return ( - children && - children({ - isDarkTheme, - }) - ); -}; - -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(ThemeContainer); diff --git a/src/screens/notification/container/notificationContainer.js b/src/screens/notification/container/notificationContainer.js index 79136338b..7814506b0 100644 --- a/src/screens/notification/container/notificationContainer.js +++ b/src/screens/notification/container/notificationContainer.js @@ -151,12 +151,13 @@ class NotificationContainer extends Component { render() { const { isLoggedIn } = this.props; - const { notifications, isNotificationRefreshing } = this.state; + const { notifications, isNotificationRefreshing, isDarkTheme } = this.state; return ( ({ isLoggedIn: state.application.isLoggedIn, + isDarkTheme: state.application.isDarkTheme, isConnected: state.application.isConnected, username: state.account.currentAccount.name,