Merge pull request #1421 from esteemapp/bugfix/dark-theme

fixed dark theme issues
This commit is contained in:
Mustafa Buyukcelebi 2019-12-18 22:06:58 +03:00 committed by GitHub
commit fcea96cad5
6 changed files with 14 additions and 14 deletions

View File

@ -529,4 +529,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: d4edbb9c1c57c5484f4893520a7865260cb898d3
COCOAPODS: 1.8.4
COCOAPODS: 1.8.3

View File

@ -46,11 +46,9 @@ const PostsView = ({
const [startPermlink, setStartPermlink] = useState('');
const [refreshing, setRefreshing] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [isShowFilterBar, setIsShowFilterBar] = useState(true);
const [selectedFilterIndex, setSelectedFilterIndex] = useState(selectedOptionIndex || 0);
const [isNoPost, setIsNoPost] = useState(false);
const [promotedPosts, setPromotedPosts] = useState([]);
const [scrollOffsetY, setScrollOffsetY] = useState(0);
const [selectedFilterValue, setSelectedFilterValue] = useState(
filterOptionsValue && filterOptionsValue[selectedFilterIndex],
);
@ -333,22 +331,17 @@ const PostsView = ({
);
};
const _handleOnScroll = event => {
const currentOffset = event.nativeEvent.contentOffset.y;
const _handleOnScroll = () => {
if (handleOnScroll) {
handleOnScroll();
}
setScrollOffsetY(currentOffset);
setIsShowFilterBar(scrollOffsetY > currentOffset || scrollOffsetY <= 0);
};
return (
<ThemeContainer>
{({ isDarkTheme }) => (
<View style={styles.container}>
{filterOptions && isShowFilterBar && (
{filterOptions && (
<FilterBar
dropdownIconName="arrow-drop-down"
//options={filterOptions}

View File

@ -464,7 +464,7 @@ export const getSettings = async () => {
}
const settingData = {
language: '',
isDarkTheme: false,
isDarkTheme: null,
currency: '',
notification: true,
server: '',

View File

@ -462,7 +462,11 @@ class ApplicationContainer extends Component {
const settings = await getSettings();
if (settings) {
dispatch(isDarkTheme(nativeThemeInitialMode === 'dark' || settings.isDarkTheme));
dispatch(
isDarkTheme(
settings.isDarkTheme === null ? nativeThemeInitialMode === 'dark' : settings.isDarkTheme,
),
);
if (settings.isPinCodeOpen !== '') dispatch(isPinCodeOpen(settings.isPinCodeOpen));
if (settings.language !== '') dispatch(setLanguage(settings.language));
if (settings.server !== '') dispatch(setApi(settings.server));

View File

@ -30,6 +30,10 @@ const Application = () => {
isThemeReady,
isPinCodeRequire,
}) => {
if (showAnimation || !isReady || !isRenderRequire || !isThemeReady) {
return <Launch />;
}
return (
<Fragment>
<Modal
@ -47,7 +51,6 @@ const Application = () => {
isReady={isReady}
isDarkTheme={isDarkTheme}
/>
{(showAnimation || !isReady || !isRenderRequire || !isThemeReady) && <Launch />}
</Fragment>
);
}}

View File

@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import { createAppContainer } from 'react-navigation';
import AppNavitation from '../../../navigation/routes';
import { setTopLevelNavigator } from '../../../navigation/service';
import { setTopLevelNavigator, navigate } from '../../../navigation/service';
// Services
import { toastNotification as toastNotificationAction } from '../../../redux/actions/uiAction';