From bdc14e20bd18523bec326716145a2029ed9d2a82 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 28 Oct 2019 23:14:36 +0300 Subject: [PATCH 1/3] Revert "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, 72 insertions(+), 51 deletions(-) create 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 807143c46..15a198e66 100644 --- a/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js @@ -1,34 +1,38 @@ 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 = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; - +const ListItemPlaceHolderView = () => { return ( - - - - - - + + {({ isDarkTheme }) => ( + + + + + + + )} + ); }; -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(ListItemPlaceHolderView); +export default ListItemPlaceHolderView; diff --git a/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js index 4aea8d528..66478b5d0 100644 --- a/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/listPlaceHolderView.js @@ -1,6 +1,5 @@ /* eslint-disable radix */ import React, { Fragment } from 'react'; -import { connect } from 'react-redux'; import { Dimensions } from 'react-native'; import times from 'lodash/times'; @@ -18,9 +17,4 @@ const ListPlaceHolderView = () => { return {listElements}; }; - -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(ListPlaceHolderView); +export default ListPlaceHolderView; diff --git a/src/components/markdownEditor/view/markdownEditorView.js b/src/components/markdownEditor/view/markdownEditorView.js index 4ceea3c11..02810b4e7 100644 --- a/src/components/markdownEditor/view/markdownEditorView.js +++ b/src/components/markdownEditor/view/markdownEditorView.js @@ -13,6 +13,8 @@ import { PostBody } from '../../postElements'; import { StickyBar } from '../../basicUIElements'; import { TextInput } from '../../textInput'; +import { ThemeContainer } from '../../../containers'; + // Styles import styles from './markdownEditorStyles'; @@ -201,22 +203,26 @@ 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 3c40f946e..d946950dd 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -6,6 +6,7 @@ import ProfileEditContainer from './profileEditContainer'; import RedeemContainer from './redeemContainer'; import SpinGameContainer from './spinGameContainer'; import TransferContainer from './transferContainer'; +import ThemeContainer from './themeContainer'; export { DarkThemeContainer, @@ -16,4 +17,5 @@ export { RedeemContainer, SpinGameContainer, TransferContainer, + ThemeContainer, }; diff --git a/src/containers/redeemContainer.js b/src/containers/redeemContainer.js index 7a6383a6c..9e326c3ef 100644 --- a/src/containers/redeemContainer.js +++ b/src/containers/redeemContainer.js @@ -140,7 +140,6 @@ 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 new file mode 100644 index 000000000..22a24adff --- /dev/null +++ b/src/containers/themeContainer.js @@ -0,0 +1,18 @@ +/* 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 7814506b0..79136338b 100644 --- a/src/screens/notification/container/notificationContainer.js +++ b/src/screens/notification/container/notificationContainer.js @@ -151,13 +151,12 @@ class NotificationContainer extends Component { render() { const { isLoggedIn } = this.props; - const { notifications, isNotificationRefreshing, isDarkTheme } = this.state; + const { notifications, isNotificationRefreshing } = this.state; return ( ({ isLoggedIn: state.application.isLoggedIn, - isDarkTheme: state.application.isDarkTheme, isConnected: state.application.isConnected, username: state.account.currentAccount.name, From 2375c0333f06f3aac06ffad604074c6a3811c63f Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 28 Oct 2019 23:28:11 +0300 Subject: [PATCH 2/3] Removed darkThemeContainer --- .../bottomTabBar/view/bottomTabBarView.js | 6 +++--- src/containers/darkThemeContainer.js | 14 -------------- src/containers/index.js | 2 -- 3 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 src/containers/darkThemeContainer.js diff --git a/src/components/bottomTabBar/view/bottomTabBarView.js b/src/components/bottomTabBar/view/bottomTabBarView.js index 93749f4f1..007e516cc 100644 --- a/src/components/bottomTabBar/view/bottomTabBarView.js +++ b/src/components/bottomTabBar/view/bottomTabBarView.js @@ -10,7 +10,7 @@ import { updateActiveBottomTab } from '../../../redux/actions/uiAction'; import ROUTES from '../../../constants/routeNames'; // Container -import { DarkThemeContainer } from '../../../containers'; +import { ThemeContainer } from '../../../containers'; // Components import TabBar from './tabbar'; @@ -44,7 +44,7 @@ const BottomTabBarView = ({ }, [dispatch, index, routes]); return ( - + {({ isDarkTheme }) => ( )} - + ); }; diff --git a/src/containers/darkThemeContainer.js b/src/containers/darkThemeContainer.js deleted file mode 100644 index 17a52101a..000000000 --- a/src/containers/darkThemeContainer.js +++ /dev/null @@ -1,14 +0,0 @@ -import { React } from 'react'; -import { connect } from 'react-redux'; - -const DarkThemeContainer = ({ children, isDarkTheme }) => - children && - children({ - isDarkTheme, - }); - -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(DarkThemeContainer); diff --git a/src/containers/index.js b/src/containers/index.js index d946950dd..2b9d0390a 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -1,4 +1,3 @@ -import DarkThemeContainer from './darkThemeContainer'; import InAppPurchaseContainer from './inAppPurchaseContainer'; import PointsContainer from './pointsContainer'; import ProfileContainer from './profileContainer'; @@ -9,7 +8,6 @@ import TransferContainer from './transferContainer'; import ThemeContainer from './themeContainer'; export { - DarkThemeContainer, InAppPurchaseContainer, PointsContainer, ProfileContainer, From e70936d970793e3094926080cd624b600691b6d0 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Tue, 29 Oct 2019 00:13:40 +0300 Subject: [PATCH 3/3] Implemented ThemeContainer instead of isDarkTheme state --- .../view/placeHolder/boostPlaceHolderView.js | 55 +++++++------ .../placeHolder/listItemPlaceHolderView.js | 40 +++++----- .../placeHolder/postCardPlaceHolderView.js | 59 +++++++------- .../view/placeHolder/postPlaceHolderView.js | 79 ++++++++++--------- .../placeHolder/profileSummaryPlaceHolder.js | 57 ++++++------- .../placeHolder/walletDetailsPlaceHolder.js | 35 ++++---- src/components/header/view/headerView.js | 1 - .../notification/view/notificationView.js | 26 +++--- src/components/points/view/pointsStyles.js | 2 +- src/components/points/view/pointsView.js | 23 +++--- .../posts/container/postsContainer.js | 3 - src/components/posts/view/postsView.js | 23 +++--- .../textInput/view/textInputView.js | 27 ++++--- .../wallet/container/walletContainer.js | 4 +- src/components/wallet/view/walletView.js | 22 +++--- src/containers/pointsContainer.js | 3 - src/screens/points/screen/pointsScreen.js | 2 - 17 files changed, 239 insertions(+), 222 deletions(-) diff --git a/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js index 44811e494..b9f7a0ba3 100644 --- a/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js @@ -1,44 +1,53 @@ /* eslint-disable radix */ import React from 'react'; -import { connect } from 'react-redux'; import { Dimensions, View } from 'react-native'; import times from 'lodash/times'; import Placeholder from 'rn-placeholder'; +import { ThemeContainer } from '../../../../containers'; + import styles from './boostPlaceHolderStyles'; const HEIGHT = Dimensions.get('window').height; -const BoostPlaceHolder = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; +const BoostPlaceHolder = () => { const ratio = (HEIGHT - 300) / 50 / 1.3; const listElements = []; times(parseInt(ratio), i => { listElements.push( - - - - - - - - - , + + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + return ( + + + + + + + + + + ); + }} + , ); }); return {listElements}; }; -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(BoostPlaceHolder); +export default BoostPlaceHolder; diff --git a/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js index 15a198e66..ab1d945f0 100644 --- a/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/listItemPlaceHolderView.js @@ -9,28 +9,26 @@ import styles from './listItemPlaceHolderStyles'; const ListItemPlaceHolderView = () => { return ( - {({ isDarkTheme }) => ( - - - - + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + return ( + + + + + - - )} + ); + }} ); }; diff --git a/src/components/basicUIElements/view/placeHolder/postCardPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/postCardPlaceHolderView.js index e1f7ad636..af555be81 100644 --- a/src/components/basicUIElements/view/placeHolder/postCardPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/postCardPlaceHolderView.js @@ -1,38 +1,39 @@ 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 './postCardPlaceHolderStyles'; // TODO: make container for place holder wrapper after alpha -const PostCardPlaceHolder = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; - +const PostCardPlaceHolder = () => { return ( - - - - - - - - - - + + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + return ( + + + + + + + + + + + ); + }} + ); }; - -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(PostCardPlaceHolder); +export default PostCardPlaceHolder; diff --git a/src/components/basicUIElements/view/placeHolder/postPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/postPlaceHolderView.js index ff3df4831..1324dbcf9 100644 --- a/src/components/basicUIElements/view/placeHolder/postPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/postPlaceHolderView.js @@ -1,47 +1,50 @@ import React from 'react'; -import { connect } from 'react-redux'; import { View } from 'react-native'; import Placeholder from 'rn-placeholder'; -import styles from './postCardPlaceHolderStyles'; -// TODO: make container for place holder wrapper after alpha -const PostPlaceHolder = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; +import { ThemeContainer } from '../../../../containers'; +import styles from './postCardPlaceHolderStyles'; + +const PostPlaceHolder = () => { return ( - - - - - - - - - - + + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + + return ( + + + + + + + + + + + ); + }} + ); }; -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(PostPlaceHolder); +export default PostPlaceHolder; diff --git a/src/components/basicUIElements/view/placeHolder/profileSummaryPlaceHolder.js b/src/components/basicUIElements/view/placeHolder/profileSummaryPlaceHolder.js index 958fbc51a..013f1a522 100644 --- a/src/components/basicUIElements/view/placeHolder/profileSummaryPlaceHolder.js +++ b/src/components/basicUIElements/view/placeHolder/profileSummaryPlaceHolder.js @@ -1,37 +1,40 @@ 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 './profileSummaryPlaceHolderStyles'; // TODO: make container for place holder wrapper after alpha -const ProfileSummaryPlaceHolder = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; - +const ProfileSummaryPlaceHolder = () => { return ( - - - - - - - - - + + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; + + return ( + + + + + + + + + + ); + }} + ); }; -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(ProfileSummaryPlaceHolder); +export default ProfileSummaryPlaceHolder; diff --git a/src/components/basicUIElements/view/placeHolder/walletDetailsPlaceHolder.js b/src/components/basicUIElements/view/placeHolder/walletDetailsPlaceHolder.js index 8bd8e2da6..7f8c6d69c 100644 --- a/src/components/basicUIElements/view/placeHolder/walletDetailsPlaceHolder.js +++ b/src/components/basicUIElements/view/placeHolder/walletDetailsPlaceHolder.js @@ -1,10 +1,11 @@ /* eslint-disable radix */ import React, { Fragment } from 'react'; -import { connect } from 'react-redux'; import { View, Dimensions } from 'react-native'; import Placeholder from 'rn-placeholder'; import times from 'lodash/times'; +import { ThemeContainer } from '../../../../containers'; + import styles from './walletDetailsPlaceHolderStyles'; const HEIGHT = Dimensions.get('window').height; @@ -24,21 +25,21 @@ const listPlaceHolderView = color => { return {listElements}; }; -const WalletDetailsPlaceHolder = ({ isDarkTheme }) => { - const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; +const WalletDetailsPlaceHolder = () => ( + + {({ isDarkTheme }) => { + const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; - return ( - - - - - {listPlaceHolderView(color)} - - ); -}; + return ( + + + + + {listPlaceHolderView(color)} + + ); + }} + +); -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(WalletDetailsPlaceHolder); +export default WalletDetailsPlaceHolder; diff --git a/src/components/header/view/headerView.js b/src/components/header/view/headerView.js index a2e41ac80..a6b50aef4 100644 --- a/src/components/header/view/headerView.js +++ b/src/components/header/view/headerView.js @@ -34,7 +34,6 @@ class HeaderView extends Component { render() { const { - avatarUrl, displayName, handleOnPressBackButton, handleOpenDrawer, diff --git a/src/components/notification/view/notificationView.js b/src/components/notification/view/notificationView.js index c663c211f..178f49816 100644 --- a/src/components/notification/view/notificationView.js +++ b/src/components/notification/view/notificationView.js @@ -10,6 +10,7 @@ import { ContainerHeader } from '../../containerHeader'; import { FilterBar } from '../../filterBar'; import { NotificationLine } from '../..'; import { ListPlaceHolder } from '../../basicUIElements'; +import { ThemeContainer } from '../../../containers'; // Utils import { isToday, isYesterday, isThisWeek, isThisMonth } from '../../../utils/time'; @@ -149,12 +150,7 @@ class NotificationView extends PureComponent { ); render() { - const { - readAllNotification, - getActivities, - isNotificationRefreshing, - isDarkTheme, - } = this.props; + const { readAllNotification, getActivities, isNotificationRefreshing } = this.props; const { filters, selectedFilter } = this.state; const _notifications = this._getNotificationsArrays(); @@ -178,13 +174,17 @@ class NotificationView extends PureComponent { ListFooterComponent={this._renderFooterLoading} ListEmptyComponent={} refreshControl={ - + + {({ isDarkTheme }) => ( + + )} + } renderItem={({ item, index }) => ( diff --git a/src/components/points/view/pointsStyles.js b/src/components/points/view/pointsStyles.js index ecef21241..bb0d07464 100644 --- a/src/components/points/view/pointsStyles.js +++ b/src/components/points/view/pointsStyles.js @@ -119,7 +119,7 @@ export default EStyleSheet.create({ }, scrollContainer: { flex: 1, - backgroundColor: '$pureWhite', + backgroundColor: '$primaryBackgroundColor', }, popoverDetails: { flexDirection: 'row', diff --git a/src/components/points/view/pointsView.js b/src/components/points/view/pointsView.js index 2ac8b78d9..47e525494 100644 --- a/src/components/points/view/pointsView.js +++ b/src/components/points/view/pointsView.js @@ -13,6 +13,7 @@ import { Icon } from '../../icon'; import { MainButton } from '../../mainButton'; import { DropdownButton } from '../../dropdownButton'; import { CollapsibleCard } from '../../collapsibleCard'; +import { ThemeContainer } from '../../../containers'; // Utils import { getTimeFromNow } from '../../../utils/time'; @@ -40,17 +41,21 @@ class PointsView extends Component { // Component Functions refreshControl = () => { - const { fetchUserActivity, refreshing, isDarkTheme } = this.props; + const { fetchUserActivity, refreshing } = this.props; return ( - + + {isDarkTheme => ( + + )} + ); }; diff --git a/src/components/posts/container/postsContainer.js b/src/components/posts/container/postsContainer.js index 92c1bd7ee..4e5e4d89a 100644 --- a/src/components/posts/container/postsContainer.js +++ b/src/components/posts/container/postsContainer.js @@ -55,7 +55,6 @@ class PostsContainer extends PureComponent { tag, isLoginDone, isLoggedIn, - isDarkTheme, nsfw, } = this.props; const { promotedPosts } = this.state; @@ -80,7 +79,6 @@ class PostsContainer extends PureComponent { tag={tag} isLoginDone={isLoginDone} isLoggedIn={isLoggedIn} - isDarkTheme={isDarkTheme} nsfw={nsfw} /> ); @@ -89,7 +87,6 @@ class PostsContainer extends PureComponent { const mapStateToProps = state => ({ currentAccount: state.account.currentAccount, - isDarkTheme: state.application.isDarkTheme, isLoggedIn: state.application.isLoggedIn, isLoginDone: state.application.isLoginDone, nsfw: state.application.nsfw, diff --git a/src/components/posts/view/postsView.js b/src/components/posts/view/postsView.js index 45c0cfe93..28d7985fc 100644 --- a/src/components/posts/view/postsView.js +++ b/src/components/posts/view/postsView.js @@ -14,6 +14,7 @@ import { PostCard } from '../../postCard'; import { FilterBar } from '../../filterBar'; import { PostCardPlaceHolder, NoPost } from '../../basicUIElements'; import { POPULAR_FILTERS, PROFILE_FILTERS } from '../../../constants/options/filters'; +import { ThemeContainer } from '../../../containers'; // Styles import styles from './postsStyles'; @@ -141,7 +142,6 @@ class PostsView extends Component { ? POPULAR_FILTERS[selectedFilterIndex].toLowerCase() : PROFILE_FILTERS[selectedFilterIndex].toLowerCase(); let options; - const newPosts = []; const limit = 3; if (!isConnected) { @@ -362,7 +362,6 @@ class PostsView extends Component { const { filterOptions, selectedOptionIndex, - isDarkTheme, isHideImage, handleImagesHide, } = this.props; @@ -401,14 +400,18 @@ class PostsView extends Component { onScrollEndDrag={this._handleOnScroll} ListEmptyComponent={this._renderEmptyContent} refreshControl={ - + + {({ isDarkTheme }) => ( + + )} + } ref={ref => { this.flatList = ref; diff --git a/src/components/textInput/view/textInputView.js b/src/components/textInput/view/textInputView.js index cfaa5c246..1c699e329 100644 --- a/src/components/textInput/view/textInputView.js +++ b/src/components/textInput/view/textInputView.js @@ -1,21 +1,22 @@ import React from 'react'; import { TextInput } from 'react-native'; -import { connect } from 'react-redux'; + +import { ThemeContainer } from '../../../containers'; // Styles import styles from './textInputStyles'; -const TextInputView = ({ isDarkTheme, innerRef, height, style, ...props }) => ( - +const TextInputView = ({ innerRef, height, style, ...props }) => ( + + {({ isDarkTheme }) => ( + + )} + ); -const mapStateToProps = state => ({ - isDarkTheme: state.application.isDarkTheme, -}); - -export default connect(mapStateToProps)(TextInputView); +export default TextInputView; diff --git a/src/components/wallet/container/walletContainer.js b/src/components/wallet/container/walletContainer.js index fcf00fd4f..37e6e6996 100644 --- a/src/components/wallet/container/walletContainer.js +++ b/src/components/wallet/container/walletContainer.js @@ -137,7 +137,7 @@ class WalletContainer extends Component { }; render() { - const { currentAccount, selectedUser, isDarkTheme, handleOnScroll } = this.props; + const { currentAccount, selectedUser, handleOnScroll } = this.props; const { walletData, isClaiming, isRefreshing } = this.state; return ( @@ -149,7 +149,6 @@ class WalletContainer extends Component { isClaiming={isClaiming} handleOnWalletRefresh={this._handleOnWalletRefresh} isRefreshing={isRefreshing} - isDarkTheme={isDarkTheme} handleOnScroll={handleOnScroll} /> ); @@ -159,7 +158,6 @@ class WalletContainer extends Component { const mapStateToProps = state => ({ currentAccount: state.account.currentAccount, pinCode: state.application.pin, - isDarkTheme: state.application.isDarkTheme, globalProps: state.account.globalProps, }); diff --git a/src/components/wallet/view/walletView.js b/src/components/wallet/view/walletView.js index d29087d35..5c9d64f22 100644 --- a/src/components/wallet/view/walletView.js +++ b/src/components/wallet/view/walletView.js @@ -10,6 +10,7 @@ import { CollapsibleCard } from '../../collapsibleCard'; import { WalletDetails } from '../../walletDetails'; import { Transaction } from '../../transaction'; import { WalletDetailsPlaceHolder } from '../../basicUIElements'; +import { ThemeContainer } from '../../../containers'; // Styles import styles from './walletStyles'; @@ -53,7 +54,6 @@ class WalletView extends PureComponent { isRefreshing, selectedUsername, walletData, - isDarkTheme, handleOnScroll, } = this.props; @@ -62,14 +62,18 @@ class WalletView extends PureComponent { onScroll={handleOnScroll && handleOnScroll} style={styles.scrollView} refreshControl={ - + + {isDarkTheme => ( + + )} + } > {!walletData ? ( diff --git a/src/containers/pointsContainer.js b/src/containers/pointsContainer.js index 67e063e7a..d0be600de 100644 --- a/src/containers/pointsContainer.js +++ b/src/containers/pointsContainer.js @@ -231,7 +231,6 @@ class PointsContainer extends Component { const { balance, isClaiming, - isDarkTheme, isLoading, navigationParams, refreshing, @@ -257,7 +256,6 @@ class PointsContainer extends Component { handleOnDropdownSelected: this._handleOnDropdownSelected, handleOnPressTransfer: this._handleOnPressTransfer, isClaiming, - isDarkTheme, isLoading, navigationParams, refreshing, @@ -271,7 +269,6 @@ class PointsContainer 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/screens/points/screen/pointsScreen.js b/src/screens/points/screen/pointsScreen.js index 1118d0d3f..8017c1b39 100644 --- a/src/screens/points/screen/pointsScreen.js +++ b/src/screens/points/screen/pointsScreen.js @@ -25,7 +25,6 @@ const PointsScreen = ({ isLoggedIn, handleLoginPress }) => { claimPoints, fetchUserActivity, isClaiming, - isDarkTheme, isLoading, refreshing, userActivities, @@ -35,7 +34,6 @@ const PointsScreen = ({ isLoggedIn, handleLoginPress }) => { claimPoints={claimPoints} fetchUserActivity={fetchUserActivity} isClaiming={isClaiming} - isDarkTheme={isDarkTheme} isLoading={isLoading} refreshing={refreshing} userActivities={userActivities}