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,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(
<View style={styles.container} key={i}>
<View style={styles.line}>
<Placeholder.Box color={color} width={90} height={40} animate="fade" />
<View style={styles.paragraphWrapper}>
<Placeholder.Box color={color} width={140} radius={25} height={50} animate="fade" />
</View>
<Placeholder.Box
style={styles.rightBox}
color={color}
width={20}
height={10}
animate="fade"
/>
</View>
</View>,
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container} key={i}>
<View style={styles.line}>
<Placeholder.Box color={color} width={90} height={40} animate="fade" />
<View style={styles.paragraphWrapper}>
<Placeholder.Box
color={color}
width={140}
radius={25}
height={50}
animate="fade"
/>
</View>
<Placeholder.Box
style={styles.rightBox}
color={color}
width={20}
height={10}
animate="fade"
/>
</View>
</View>
);
}}
</ThemeContainer>,
);
});
return <View style={styles.container}>{listElements}</View>;
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(BoostPlaceHolder);
export default BoostPlaceHolder;

View File

@ -1,34 +1,36 @@
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 (
<View style={styles.container}>
<Placeholder.Media size={30} hasRadius animate="fade" color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={2}
textSize={12}
lineSpacing={8}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container}>
<Placeholder.Media size={30} hasRadius animate="fade" color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={2}
textSize={12}
lineSpacing={8}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
);
}}
</ThemeContainer>
);
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ListItemPlaceHolderView);
export default ListItemPlaceHolderView;

View File

@ -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 <Fragment>{listElements}</Fragment>;
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ListPlaceHolderView);
export default ListPlaceHolderView;

View File

@ -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 (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Media size={35} hasRadius animate="fade" color={color} />
<Placeholder.Line width="30%" lastLineWidth="30%" animate="fade" color={color} />
</View>
<Placeholder.Box animate="fade" height={200} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
lineNumber={3}
color={color}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Media size={35} hasRadius animate="fade" color={color} />
<Placeholder.Line width="30%" lastLineWidth="30%" animate="fade" color={color} />
</View>
<Placeholder.Box animate="fade" height={200} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
lineNumber={3}
color={color}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
);
}}
</ThemeContainer>
);
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(PostCardPlaceHolder);
export default PostCardPlaceHolder;

View File

@ -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 (
<View>
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={2}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
<View style={styles.paragraphWrapper} />
<Placeholder.Box animate="fade" height={200} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={18}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View>
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={2}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
<View style={styles.paragraphWrapper} />
<Placeholder.Box animate="fade" height={200} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={18}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
);
}}
</ThemeContainer>
);
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(PostPlaceHolder);
export default PostPlaceHolder;

View File

@ -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 (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Paragraph lineNumber={1} color={color} />
</View>
<Placeholder.Box animate="fade" height={75} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={3}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Paragraph lineNumber={1} color={color} />
</View>
<Placeholder.Box animate="fade" height={75} width="100%" radius={5} color={color} />
<View style={styles.paragraphWrapper}>
<Placeholder.Paragraph
color={color}
lineNumber={3}
textSize={16}
lineSpacing={5}
width="100%"
lastLineWidth="70%"
firstLineWidth="50%"
animate="fade"
/>
</View>
</View>
);
}}
</ThemeContainer>
);
};
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(ProfileSummaryPlaceHolder);
export default ProfileSummaryPlaceHolder;

View File

@ -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 <Fragment>{listElements}</Fragment>;
};
const WalletDetailsPlaceHolder = ({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
const WalletDetailsPlaceHolder = () => (
<ThemeContainer>
{({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Paragraph lineNumber={1} color={color} />
</View>
{listPlaceHolderView(color)}
</View>
);
};
return (
<View style={styles.container}>
<View style={styles.textWrapper}>
<Placeholder.Paragraph lineNumber={1} color={color} />
</View>
{listPlaceHolderView(color)}
</View>
);
}}
</ThemeContainer>
);
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(WalletDetailsPlaceHolder);
export default WalletDetailsPlaceHolder;

View File

@ -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 (
<DarkThemeContainer>
<ThemeContainer>
{({ isDarkTheme }) => (
<SafeAreaView style={styles.wrapper}>
<TabBar
@ -74,7 +74,7 @@ const BottomTabBarView = ({
</TabBar>
</SafeAreaView>
)}
</DarkThemeContainer>
</ThemeContainer>
);
};

View File

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

View File

@ -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 ? (
<TextInput
multiline
onChangeText={this._changeText}
onSelectionChange={this._handleOnSelectionChange}
placeholder={intl.formatMessage({
id: isReply ? 'editor.reply_placeholder' : 'editor.default_placeholder',
})}
placeholderTextColor="#c1c5c7"
selection={selection}
selectionColor="#357ce6"
style={styles.textWrapper}
underlineColorAndroid="transparent"
value={text}
innerRef={this.inputRef}
editable={!isLoading}
/>
<ThemeContainer>
{({ isDarkTheme }) => (
<TextInput
multiline
onChangeText={this._changeText}
onSelectionChange={this._handleOnSelectionChange}
placeholder={intl.formatMessage({
id: isReply ? 'editor.reply_placeholder' : 'editor.default_placeholder',
})}
placeholderTextColor={isDarkTheme ? '#526d91' : '#c1c5c7'}
selection={selection}
selectionColor="#357ce6"
style={styles.textWrapper}
underlineColorAndroid="transparent"
value={text}
innerRef={this.inputRef}
editable={!isLoading}
/>
)}
</ThemeContainer>
) : (
this._renderPreview()
)}

View File

@ -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={<ListPlaceHolder />}
refreshControl={
<RefreshControl
refreshing={isNotificationRefreshing}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
<ThemeContainer>
{({ isDarkTheme }) => (
<RefreshControl
refreshing={isNotificationRefreshing}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
}
renderItem={({ item, index }) => (
<Fragment>

View File

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

View File

@ -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 (
<RefreshControl
refreshing={refreshing}
onRefresh={fetchUserActivity}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
<ThemeContainer>
{isDarkTheme => (
<RefreshControl
refreshing={refreshing}
onRefresh={fetchUserActivity}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
);
};

View File

@ -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,

View File

@ -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={
<RefreshControl
refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
<ThemeContainer>
{({ isDarkTheme }) => (
<RefreshControl
refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
}
ref={ref => {
this.flatList = ref;

View File

@ -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 }) => (
<TextInput
ref={innerRef}
keyboardAppearance={isDarkTheme ? 'dark' : 'light'}
{...props}
style={[styles.input, { minHeight: height }, style]}
/>
const TextInputView = ({ innerRef, height, style, ...props }) => (
<ThemeContainer>
{({ isDarkTheme }) => (
<TextInput
ref={innerRef}
keyboardAppearance={isDarkTheme ? 'dark' : 'light'}
{...props}
style={[styles.input, { minHeight: height }, style]}
/>
)}
</ThemeContainer>
);
const mapStateToProps = state => ({
isDarkTheme: state.application.isDarkTheme,
});
export default connect(mapStateToProps)(TextInputView);
export default TextInputView;

View File

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

View File

@ -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={
<RefreshControl
refreshing={isRefreshing}
onRefresh={handleOnWalletRefresh}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
<ThemeContainer>
{isDarkTheme => (
<RefreshControl
refreshing={isRefreshing}
onRefresh={handleOnWalletRefresh}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
}
>
{!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 PointsContainer from './pointsContainer';
import ProfileContainer from './profileContainer';
@ -6,9 +5,9 @@ import ProfileEditContainer from './profileEditContainer';
import RedeemContainer from './redeemContainer';
import SpinGameContainer from './spinGameContainer';
import TransferContainer from './transferContainer';
import ThemeContainer from './themeContainer';
export {
DarkThemeContainer,
InAppPurchaseContainer,
PointsContainer,
ProfileContainer,
@ -16,4 +15,5 @@ export {
RedeemContainer,
SpinGameContainer,
TransferContainer,
ThemeContainer,
};

View File

@ -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,

View File

@ -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,

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

View File

@ -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}