Merge branch 'bugfix/markdown-darktheme' of github.com:esteemapp/esteem-mobile into development

This commit is contained in:
Mustafa Buyukcelebi 2019-10-29 17:21:20 +03:00
commit 7592a3a5cc
25 changed files with 293 additions and 271 deletions

View File

@ -1,26 +1,36 @@
/* eslint-disable radix */ /* eslint-disable radix */
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { Dimensions, View } from 'react-native'; import { Dimensions, View } from 'react-native';
import times from 'lodash/times'; import times from 'lodash/times';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers';
import styles from './boostPlaceHolderStyles'; import styles from './boostPlaceHolderStyles';
const HEIGHT = Dimensions.get('window').height; const HEIGHT = Dimensions.get('window').height;
const BoostPlaceHolder = ({ isDarkTheme }) => { const BoostPlaceHolder = () => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
const ratio = (HEIGHT - 300) / 50 / 1.3; const ratio = (HEIGHT - 300) / 50 / 1.3;
const listElements = []; const listElements = [];
times(parseInt(ratio), i => { times(parseInt(ratio), i => {
listElements.push( listElements.push(
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container} key={i}> <View style={styles.container} key={i}>
<View style={styles.line}> <View style={styles.line}>
<Placeholder.Box color={color} width={90} height={40} animate="fade" /> <Placeholder.Box color={color} width={90} height={40} animate="fade" />
<View style={styles.paragraphWrapper}> <View style={styles.paragraphWrapper}>
<Placeholder.Box color={color} width={140} radius={25} height={50} animate="fade" /> <Placeholder.Box
color={color}
width={140}
radius={25}
height={50}
animate="fade"
/>
</View> </View>
<Placeholder.Box <Placeholder.Box
style={styles.rightBox} style={styles.rightBox}
@ -30,15 +40,14 @@ const BoostPlaceHolder = ({ isDarkTheme }) => {
animate="fade" animate="fade"
/> />
</View> </View>
</View>, </View>
);
}}
</ThemeContainer>,
); );
}); });
return <View style={styles.container}>{listElements}</View>; return <View style={styles.container}>{listElements}</View>;
}; };
const mapStateToProps = state => ({ export default BoostPlaceHolder;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(BoostPlaceHolder);

View File

@ -1,13 +1,16 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { View } from 'react-native'; import { View } from 'react-native';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers';
import styles from './listItemPlaceHolderStyles'; import styles from './listItemPlaceHolderStyles';
const ListItemPlaceHolderView = ({ isDarkTheme }) => { const ListItemPlaceHolderView = () => {
return (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Placeholder.Media size={30} hasRadius animate="fade" color={color} /> <Placeholder.Media size={30} hasRadius animate="fade" color={color} />
@ -25,10 +28,9 @@ const ListItemPlaceHolderView = ({ isDarkTheme }) => {
</View> </View>
</View> </View>
); );
}}
</ThemeContainer>
);
}; };
const mapStateToProps = state => ({ export default ListItemPlaceHolderView;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ListItemPlaceHolderView);

View File

@ -1,6 +1,5 @@
/* eslint-disable radix */ /* eslint-disable radix */
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { connect } from 'react-redux';
import { Dimensions } from 'react-native'; import { Dimensions } from 'react-native';
import times from 'lodash/times'; import times from 'lodash/times';
@ -18,9 +17,4 @@ const ListPlaceHolderView = () => {
return <Fragment>{listElements}</Fragment>; return <Fragment>{listElements}</Fragment>;
}; };
export default ListPlaceHolderView;
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ListPlaceHolderView);

View File

@ -1,13 +1,16 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { View } from 'react-native'; import { View } from 'react-native';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers';
import styles from './postCardPlaceHolderStyles'; import styles from './postCardPlaceHolderStyles';
// TODO: make container for place holder wrapper after alpha // TODO: make container for place holder wrapper after alpha
const PostCardPlaceHolder = ({ isDarkTheme }) => { const PostCardPlaceHolder = () => {
return (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.textWrapper}> <View style={styles.textWrapper}>
@ -29,10 +32,8 @@ const PostCardPlaceHolder = ({ isDarkTheme }) => {
</View> </View>
</View> </View>
); );
}}
</ThemeContainer>
);
}; };
export default PostCardPlaceHolder;
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(PostCardPlaceHolder);

View File

@ -1,11 +1,15 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { View } from 'react-native'; import { View } from 'react-native';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers';
import styles from './postCardPlaceHolderStyles'; import styles from './postCardPlaceHolderStyles';
// TODO: make container for place holder wrapper after alpha
const PostPlaceHolder = ({ isDarkTheme }) => { const PostPlaceHolder = () => {
return (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
@ -38,10 +42,9 @@ const PostPlaceHolder = ({ isDarkTheme }) => {
</View> </View>
</View> </View>
); );
}}
</ThemeContainer>
);
}; };
const mapStateToProps = state => ({ export default PostPlaceHolder;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(PostPlaceHolder);

View File

@ -1,11 +1,15 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { View } from 'react-native'; import { View } from 'react-native';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers';
import styles from './profileSummaryPlaceHolderStyles'; import styles from './profileSummaryPlaceHolderStyles';
// TODO: make container for place holder wrapper after alpha // TODO: make container for place holder wrapper after alpha
const ProfileSummaryPlaceHolder = ({ isDarkTheme }) => { const ProfileSummaryPlaceHolder = () => {
return (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
@ -28,10 +32,9 @@ const ProfileSummaryPlaceHolder = ({ isDarkTheme }) => {
</View> </View>
</View> </View>
); );
}}
</ThemeContainer>
);
}; };
const mapStateToProps = state => ({ export default ProfileSummaryPlaceHolder;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ProfileSummaryPlaceHolder);

View File

@ -1,10 +1,11 @@
/* eslint-disable radix */ /* eslint-disable radix */
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { connect } from 'react-redux';
import { View, Dimensions } from 'react-native'; import { View, Dimensions } from 'react-native';
import Placeholder from 'rn-placeholder'; import Placeholder from 'rn-placeholder';
import times from 'lodash/times'; import times from 'lodash/times';
import { ThemeContainer } from '../../../../containers';
import styles from './walletDetailsPlaceHolderStyles'; import styles from './walletDetailsPlaceHolderStyles';
const HEIGHT = Dimensions.get('window').height; const HEIGHT = Dimensions.get('window').height;
@ -24,7 +25,9 @@ const listPlaceHolderView = color => {
return <Fragment>{listElements}</Fragment>; return <Fragment>{listElements}</Fragment>;
}; };
const WalletDetailsPlaceHolder = ({ isDarkTheme }) => { const WalletDetailsPlaceHolder = () => (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
@ -35,10 +38,8 @@ const WalletDetailsPlaceHolder = ({ isDarkTheme }) => {
{listPlaceHolderView(color)} {listPlaceHolderView(color)}
</View> </View>
); );
}; }}
</ThemeContainer>
);
const mapStateToProps = state => ({ export default WalletDetailsPlaceHolder;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(WalletDetailsPlaceHolder);

View File

@ -10,7 +10,7 @@ import { updateActiveBottomTab } from '../../../redux/actions/uiAction';
import ROUTES from '../../../constants/routeNames'; import ROUTES from '../../../constants/routeNames';
// Container // Container
import { DarkThemeContainer } from '../../../containers'; import { ThemeContainer } from '../../../containers';
// Components // Components
import TabBar from './tabbar'; import TabBar from './tabbar';
@ -44,7 +44,7 @@ const BottomTabBarView = ({
}, [dispatch, index, routes]); }, [dispatch, index, routes]);
return ( return (
<DarkThemeContainer> <ThemeContainer>
{({ isDarkTheme }) => ( {({ isDarkTheme }) => (
<SafeAreaView style={styles.wrapper}> <SafeAreaView style={styles.wrapper}>
<TabBar <TabBar
@ -74,7 +74,7 @@ const BottomTabBarView = ({
</TabBar> </TabBar>
</SafeAreaView> </SafeAreaView>
)} )}
</DarkThemeContainer> </ThemeContainer>
); );
}; };

View File

@ -34,7 +34,6 @@ class HeaderView extends Component {
render() { render() {
const { const {
avatarUrl,
displayName, displayName,
handleOnPressBackButton, handleOnPressBackButton,
handleOpenDrawer, handleOpenDrawer,

View File

@ -13,6 +13,8 @@ import { PostBody } from '../../postElements';
import { StickyBar } from '../../basicUIElements'; import { StickyBar } from '../../basicUIElements';
import { TextInput } from '../../textInput'; import { TextInput } from '../../textInput';
import { ThemeContainer } from '../../../containers';
// Styles // Styles
import styles from './markdownEditorStyles'; import styles from './markdownEditorStyles';
@ -201,6 +203,8 @@ export default class MarkdownEditorView extends Component {
behavior={Platform.OS === 'ios' ? 'padding' : null} behavior={Platform.OS === 'ios' ? 'padding' : null}
> >
{!isPreviewActive ? ( {!isPreviewActive ? (
<ThemeContainer>
{({ isDarkTheme }) => (
<TextInput <TextInput
multiline multiline
onChangeText={this._changeText} onChangeText={this._changeText}
@ -208,7 +212,7 @@ export default class MarkdownEditorView extends Component {
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: isReply ? 'editor.reply_placeholder' : 'editor.default_placeholder', id: isReply ? 'editor.reply_placeholder' : 'editor.default_placeholder',
})} })}
placeholderTextColor="#c1c5c7" placeholderTextColor={isDarkTheme ? '#526d91' : '#c1c5c7'}
selection={selection} selection={selection}
selectionColor="#357ce6" selectionColor="#357ce6"
style={styles.textWrapper} style={styles.textWrapper}
@ -217,6 +221,8 @@ export default class MarkdownEditorView extends Component {
innerRef={this.inputRef} innerRef={this.inputRef}
editable={!isLoading} editable={!isLoading}
/> />
)}
</ThemeContainer>
) : ( ) : (
this._renderPreview() this._renderPreview()
)} )}

View File

@ -10,6 +10,7 @@ import { ContainerHeader } from '../../containerHeader';
import { FilterBar } from '../../filterBar'; import { FilterBar } from '../../filterBar';
import { NotificationLine } from '../..'; import { NotificationLine } from '../..';
import { ListPlaceHolder } from '../../basicUIElements'; import { ListPlaceHolder } from '../../basicUIElements';
import { ThemeContainer } from '../../../containers';
// Utils // Utils
import { isToday, isYesterday, isThisWeek, isThisMonth } from '../../../utils/time'; import { isToday, isYesterday, isThisWeek, isThisMonth } from '../../../utils/time';
@ -149,12 +150,7 @@ class NotificationView extends PureComponent {
); );
render() { render() {
const { const { readAllNotification, getActivities, isNotificationRefreshing } = this.props;
readAllNotification,
getActivities,
isNotificationRefreshing,
isDarkTheme,
} = this.props;
const { filters, selectedFilter } = this.state; const { filters, selectedFilter } = this.state;
const _notifications = this._getNotificationsArrays(); const _notifications = this._getNotificationsArrays();
@ -178,6 +174,8 @@ class NotificationView extends PureComponent {
ListFooterComponent={this._renderFooterLoading} ListFooterComponent={this._renderFooterLoading}
ListEmptyComponent={<ListPlaceHolder />} ListEmptyComponent={<ListPlaceHolder />}
refreshControl={ refreshControl={
<ThemeContainer>
{({ isDarkTheme }) => (
<RefreshControl <RefreshControl
refreshing={isNotificationRefreshing} refreshing={isNotificationRefreshing}
progressBackgroundColor="#357CE6" progressBackgroundColor="#357CE6"
@ -185,6 +183,8 @@ class NotificationView extends PureComponent {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)}
</ThemeContainer>
} }
renderItem={({ item, index }) => ( renderItem={({ item, index }) => (
<Fragment> <Fragment>

View File

@ -119,7 +119,7 @@ export default EStyleSheet.create({
}, },
scrollContainer: { scrollContainer: {
flex: 1, flex: 1,
backgroundColor: '$pureWhite', backgroundColor: '$primaryBackgroundColor',
}, },
popoverDetails: { popoverDetails: {
flexDirection: 'row', flexDirection: 'row',

View File

@ -13,6 +13,7 @@ import { Icon } from '../../icon';
import { MainButton } from '../../mainButton'; import { MainButton } from '../../mainButton';
import { DropdownButton } from '../../dropdownButton'; import { DropdownButton } from '../../dropdownButton';
import { CollapsibleCard } from '../../collapsibleCard'; import { CollapsibleCard } from '../../collapsibleCard';
import { ThemeContainer } from '../../../containers';
// Utils // Utils
import { getTimeFromNow } from '../../../utils/time'; import { getTimeFromNow } from '../../../utils/time';
@ -40,9 +41,11 @@ class PointsView extends Component {
// Component Functions // Component Functions
refreshControl = () => { refreshControl = () => {
const { fetchUserActivity, refreshing, isDarkTheme } = this.props; const { fetchUserActivity, refreshing } = this.props;
return ( return (
<ThemeContainer>
{isDarkTheme => (
<RefreshControl <RefreshControl
refreshing={refreshing} refreshing={refreshing}
onRefresh={fetchUserActivity} onRefresh={fetchUserActivity}
@ -51,6 +54,8 @@ class PointsView extends Component {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)}
</ThemeContainer>
); );
}; };

View File

@ -55,7 +55,6 @@ class PostsContainer extends PureComponent {
tag, tag,
isLoginDone, isLoginDone,
isLoggedIn, isLoggedIn,
isDarkTheme,
nsfw, nsfw,
} = this.props; } = this.props;
const { promotedPosts } = this.state; const { promotedPosts } = this.state;
@ -80,7 +79,6 @@ class PostsContainer extends PureComponent {
tag={tag} tag={tag}
isLoginDone={isLoginDone} isLoginDone={isLoginDone}
isLoggedIn={isLoggedIn} isLoggedIn={isLoggedIn}
isDarkTheme={isDarkTheme}
nsfw={nsfw} nsfw={nsfw}
/> />
); );
@ -89,7 +87,6 @@ class PostsContainer extends PureComponent {
const mapStateToProps = state => ({ const mapStateToProps = state => ({
currentAccount: state.account.currentAccount, currentAccount: state.account.currentAccount,
isDarkTheme: state.application.isDarkTheme,
isLoggedIn: state.application.isLoggedIn, isLoggedIn: state.application.isLoggedIn,
isLoginDone: state.application.isLoginDone, isLoginDone: state.application.isLoginDone,
nsfw: state.application.nsfw, nsfw: state.application.nsfw,

View File

@ -14,6 +14,7 @@ import { PostCard } from '../../postCard';
import { FilterBar } from '../../filterBar'; import { FilterBar } from '../../filterBar';
import { PostCardPlaceHolder, NoPost } from '../../basicUIElements'; import { PostCardPlaceHolder, NoPost } from '../../basicUIElements';
import { POPULAR_FILTERS, PROFILE_FILTERS } from '../../../constants/options/filters'; import { POPULAR_FILTERS, PROFILE_FILTERS } from '../../../constants/options/filters';
import { ThemeContainer } from '../../../containers';
// Styles // Styles
import styles from './postsStyles'; import styles from './postsStyles';
@ -141,7 +142,6 @@ class PostsView extends Component {
? POPULAR_FILTERS[selectedFilterIndex].toLowerCase() ? POPULAR_FILTERS[selectedFilterIndex].toLowerCase()
: PROFILE_FILTERS[selectedFilterIndex].toLowerCase(); : PROFILE_FILTERS[selectedFilterIndex].toLowerCase();
let options; let options;
const newPosts = [];
const limit = 3; const limit = 3;
if (!isConnected) { if (!isConnected) {
@ -362,7 +362,6 @@ class PostsView extends Component {
const { const {
filterOptions, filterOptions,
selectedOptionIndex, selectedOptionIndex,
isDarkTheme,
isHideImage, isHideImage,
handleImagesHide, handleImagesHide,
} = this.props; } = this.props;
@ -401,6 +400,8 @@ class PostsView extends Component {
onScrollEndDrag={this._handleOnScroll} onScrollEndDrag={this._handleOnScroll}
ListEmptyComponent={this._renderEmptyContent} ListEmptyComponent={this._renderEmptyContent}
refreshControl={ refreshControl={
<ThemeContainer>
{({ isDarkTheme }) => (
<RefreshControl <RefreshControl
refreshing={refreshing} refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts} onRefresh={this._handleOnRefreshPosts}
@ -409,6 +410,8 @@ class PostsView extends Component {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)}
</ThemeContainer>
} }
ref={ref => { ref={ref => {
this.flatList = ref; this.flatList = ref;

View File

@ -1,21 +1,22 @@
import React from 'react'; import React from 'react';
import { TextInput } from 'react-native'; import { TextInput } from 'react-native';
import { connect } from 'react-redux';
import { ThemeContainer } from '../../../containers';
// Styles // Styles
import styles from './textInputStyles'; import styles from './textInputStyles';
const TextInputView = ({ isDarkTheme, innerRef, height, style, ...props }) => ( const TextInputView = ({ innerRef, height, style, ...props }) => (
<ThemeContainer>
{({ isDarkTheme }) => (
<TextInput <TextInput
ref={innerRef} ref={innerRef}
keyboardAppearance={isDarkTheme ? 'dark' : 'light'} keyboardAppearance={isDarkTheme ? 'dark' : 'light'}
{...props} {...props}
style={[styles.input, { minHeight: height }, style]} style={[styles.input, { minHeight: height }, style]}
/> />
)}
</ThemeContainer>
); );
const mapStateToProps = state => ({ export default TextInputView;
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(TextInputView);

View File

@ -137,7 +137,7 @@ class WalletContainer extends Component {
}; };
render() { render() {
const { currentAccount, selectedUser, isDarkTheme, handleOnScroll } = this.props; const { currentAccount, selectedUser, handleOnScroll } = this.props;
const { walletData, isClaiming, isRefreshing } = this.state; const { walletData, isClaiming, isRefreshing } = this.state;
return ( return (
@ -149,7 +149,6 @@ class WalletContainer extends Component {
isClaiming={isClaiming} isClaiming={isClaiming}
handleOnWalletRefresh={this._handleOnWalletRefresh} handleOnWalletRefresh={this._handleOnWalletRefresh}
isRefreshing={isRefreshing} isRefreshing={isRefreshing}
isDarkTheme={isDarkTheme}
handleOnScroll={handleOnScroll} handleOnScroll={handleOnScroll}
/> />
); );
@ -159,7 +158,6 @@ class WalletContainer extends Component {
const mapStateToProps = state => ({ const mapStateToProps = state => ({
currentAccount: state.account.currentAccount, currentAccount: state.account.currentAccount,
pinCode: state.application.pin, pinCode: state.application.pin,
isDarkTheme: state.application.isDarkTheme,
globalProps: state.account.globalProps, globalProps: state.account.globalProps,
}); });

View File

@ -10,6 +10,7 @@ import { CollapsibleCard } from '../../collapsibleCard';
import { WalletDetails } from '../../walletDetails'; import { WalletDetails } from '../../walletDetails';
import { Transaction } from '../../transaction'; import { Transaction } from '../../transaction';
import { WalletDetailsPlaceHolder } from '../../basicUIElements'; import { WalletDetailsPlaceHolder } from '../../basicUIElements';
import { ThemeContainer } from '../../../containers';
// Styles // Styles
import styles from './walletStyles'; import styles from './walletStyles';
@ -53,7 +54,6 @@ class WalletView extends PureComponent {
isRefreshing, isRefreshing,
selectedUsername, selectedUsername,
walletData, walletData,
isDarkTheme,
handleOnScroll, handleOnScroll,
} = this.props; } = this.props;
@ -62,6 +62,8 @@ class WalletView extends PureComponent {
onScroll={handleOnScroll && handleOnScroll} onScroll={handleOnScroll && handleOnScroll}
style={styles.scrollView} style={styles.scrollView}
refreshControl={ refreshControl={
<ThemeContainer>
{isDarkTheme => (
<RefreshControl <RefreshControl
refreshing={isRefreshing} refreshing={isRefreshing}
onRefresh={handleOnWalletRefresh} onRefresh={handleOnWalletRefresh}
@ -70,6 +72,8 @@ class WalletView extends PureComponent {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)}
</ThemeContainer>
} }
> >
{!walletData ? ( {!walletData ? (

View File

@ -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);

View File

@ -1,4 +1,3 @@
import DarkThemeContainer from './darkThemeContainer';
import InAppPurchaseContainer from './inAppPurchaseContainer'; import InAppPurchaseContainer from './inAppPurchaseContainer';
import PointsContainer from './pointsContainer'; import PointsContainer from './pointsContainer';
import ProfileContainer from './profileContainer'; import ProfileContainer from './profileContainer';
@ -6,9 +5,9 @@ import ProfileEditContainer from './profileEditContainer';
import RedeemContainer from './redeemContainer'; import RedeemContainer from './redeemContainer';
import SpinGameContainer from './spinGameContainer'; import SpinGameContainer from './spinGameContainer';
import TransferContainer from './transferContainer'; import TransferContainer from './transferContainer';
import ThemeContainer from './themeContainer';
export { export {
DarkThemeContainer,
InAppPurchaseContainer, InAppPurchaseContainer,
PointsContainer, PointsContainer,
ProfileContainer, ProfileContainer,
@ -16,4 +15,5 @@ export {
RedeemContainer, RedeemContainer,
SpinGameContainer, SpinGameContainer,
TransferContainer, TransferContainer,
ThemeContainer,
}; };

View File

@ -231,7 +231,6 @@ class PointsContainer extends Component {
const { const {
balance, balance,
isClaiming, isClaiming,
isDarkTheme,
isLoading, isLoading,
navigationParams, navigationParams,
refreshing, refreshing,
@ -257,7 +256,6 @@ class PointsContainer extends Component {
handleOnDropdownSelected: this._handleOnDropdownSelected, handleOnDropdownSelected: this._handleOnDropdownSelected,
handleOnPressTransfer: this._handleOnPressTransfer, handleOnPressTransfer: this._handleOnPressTransfer,
isClaiming, isClaiming,
isDarkTheme,
isLoading, isLoading,
navigationParams, navigationParams,
refreshing, refreshing,
@ -271,7 +269,6 @@ class PointsContainer extends Component {
const mapStateToProps = state => ({ const mapStateToProps = state => ({
username: state.account.currentAccount.name, username: state.account.currentAccount.name,
isDarkTheme: state.application.isDarkTheme,
activeBottomTab: state.ui.activeBottomTab, activeBottomTab: state.ui.activeBottomTab,
isConnected: state.application.isConnected, isConnected: state.application.isConnected,
accounts: state.account.otherAccounts, accounts: state.account.otherAccounts,

View File

@ -140,7 +140,6 @@ class RedeemContainer extends Component {
const mapStateToProps = state => ({ const mapStateToProps = state => ({
username: state.account.currentAccount.name, username: state.account.currentAccount.name,
isDarkTheme: state.application.isDarkTheme,
activeBottomTab: state.ui.activeBottomTab, activeBottomTab: state.ui.activeBottomTab,
isConnected: state.application.isConnected, isConnected: state.application.isConnected,
accounts: state.account.otherAccounts, accounts: state.account.otherAccounts,

View File

@ -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);

View File

@ -151,13 +151,12 @@ class NotificationContainer extends Component {
render() { render() {
const { isLoggedIn } = this.props; const { isLoggedIn } = this.props;
const { notifications, isNotificationRefreshing, isDarkTheme } = this.state; const { notifications, isNotificationRefreshing } = this.state;
return ( return (
<NotificationScreen <NotificationScreen
getActivities={this._getAvtivities} getActivities={this._getAvtivities}
notifications={notifications} notifications={notifications}
isDarkTheme={isDarkTheme}
navigateToNotificationRoute={this._navigateToNotificationRoute} navigateToNotificationRoute={this._navigateToNotificationRoute}
readAllNotification={this._readAllNotification} readAllNotification={this._readAllNotification}
handleLoginPress={this._handleOnPressLogin} handleLoginPress={this._handleOnPressLogin}
@ -171,7 +170,6 @@ class NotificationContainer extends Component {
const mapStateToProps = state => ({ const mapStateToProps = state => ({
isLoggedIn: state.application.isLoggedIn, isLoggedIn: state.application.isLoggedIn,
isDarkTheme: state.application.isDarkTheme,
isConnected: state.application.isConnected, isConnected: state.application.isConnected,
username: state.account.currentAccount.name, username: state.account.currentAccount.name,

View File

@ -25,7 +25,6 @@ const PointsScreen = ({ isLoggedIn, handleLoginPress }) => {
claimPoints, claimPoints,
fetchUserActivity, fetchUserActivity,
isClaiming, isClaiming,
isDarkTheme,
isLoading, isLoading,
refreshing, refreshing,
userActivities, userActivities,
@ -35,7 +34,6 @@ const PointsScreen = ({ isLoggedIn, handleLoginPress }) => {
claimPoints={claimPoints} claimPoints={claimPoints}
fetchUserActivity={fetchUserActivity} fetchUserActivity={fetchUserActivity}
isClaiming={isClaiming} isClaiming={isClaiming}
isDarkTheme={isDarkTheme}
isLoading={isLoading} isLoading={isLoading}
refreshing={refreshing} refreshing={refreshing}
userActivities={userActivities} userActivities={userActivities}