diff --git a/App.js b/App.js index 8d67624..7b1563a 100644 --- a/App.js +++ b/App.js @@ -1,6 +1,7 @@ // @flow import * as React from 'react'; +import {StatusBar, Platform } from 'react-native'; import {Root, StyleProvider} from 'native-base'; import {createAppContainerWithInitialRoute} from './navigation/AppNavigator'; import ThemeManager from './utils/ThemeManager'; @@ -45,9 +46,23 @@ export default class App extends React.Component { this.setState({ currentTheme: ThemeManager.getCurrentTheme() }); + this.setupStatusBar(); clearThemeCache(); } + setupStatusBar() { + if (Platform.OS === 'ios') { + console.log(ThemeManager.getNightMode()); + if (ThemeManager.getNightMode()) { + console.log('setting light mode'); + StatusBar.setBarStyle('light-content', true); + } else { + console.log('setting dark mode'); + StatusBar.setBarStyle('dark-content', true); + } + } + } + /** * Callback when user ends the intro. Save in preferences to avaoid showing back the introSlides */ @@ -70,7 +85,7 @@ export default class App extends React.Component { await AsyncStorageManager.getInstance().loadPreferences(); ThemeManager.getInstance().setUpdateThemeCallback(() => this.updateTheme()); await NotificationsManager.initExpoToken(); - console.log(AsyncStorageManager.getInstance().preferences.expoToken.current); + // console.log(AsyncStorageManager.getInstance().preferences.expoToken.current); } onLoadFinished() { @@ -83,6 +98,10 @@ export default class App extends React.Component { showUpdate: AsyncStorageManager.getInstance().preferences.showUpdate1.current === '1' // showIntro: true }); + // Status bar goes dark if set too fast + setTimeout(this.setupStatusBar, + 1000 + ) } /** diff --git a/components/BaseContainer.js b/components/BaseContainer.js index 65ad3c3..0480dda 100644 --- a/components/BaseContainer.js +++ b/components/BaseContainer.js @@ -14,7 +14,8 @@ type Props = { navigation: Object, headerTitle: string, headerRightButton: React.Node, - children: React.Node + children: React.Node, + hasTabs: boolean, } type State = { @@ -27,7 +28,8 @@ export default class BaseContainer extends React.Component { willBlurSubscription: function; static defaultProps = { - headerRightButton: + headerRightButton: , + hasTabs: false, }; @@ -72,20 +74,23 @@ export default class BaseContainer extends React.Component { width: '100%', height: '100%' }}> - this.updateMenuState(isOpen)}> + this.updateMenuState(isOpen)}> - this.toggle()}> - - - } - rightButton={this.props.headerRightButton}/> + this.toggle()}> + + + } + rightButton={this.props.headerRightButton} + hasTabs={this.props.hasTabs}/> {this.props.children} diff --git a/components/CustomHeader.js b/components/CustomHeader.js index ad9732e..eefc355 100644 --- a/components/CustomHeader.js +++ b/components/CustomHeader.js @@ -50,7 +50,8 @@ export default class CustomHeader extends React.Component { button = this.props.leftButton; return ( -
+
{button} @@ -60,13 +61,13 @@ export default class CustomHeader extends React.Component { {this.props.rightButton} {this.props.hasBackButton ? : - this.props.navigation.navigate('SettingsScreen')}> - - } + this.props.navigation.navigate('SettingsScreen')}> + + }
); } diff --git a/components/FetchedDataSectionList.js b/components/FetchedDataSectionList.js index 664fa76..b190e11 100644 --- a/components/FetchedDataSectionList.js +++ b/components/FetchedDataSectionList.js @@ -342,10 +342,16 @@ export default class FetchedDataSectionList extends React.Component + {this.hasTabs() ? - + {this.getTabbedView(dataset)} : diff --git a/native-base-theme/variables/platformDark.js b/native-base-theme/variables/platformDark.js index 0914bd2..c5744d7 100644 --- a/native-base-theme/variables/platformDark.js +++ b/native-base-theme/variables/platformDark.js @@ -158,7 +158,7 @@ export default { searchBarHeight: platform === "ios" ? 30 : 40, searchBarInputHeight: platform === "ios" ? 30 : 50, toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff", - toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f", + toolbarDefaultBorder: platform === "ios" ? "#3f3f3f" : "#ba1f0f", iosStatusbar: platform === "ios" ? "dark-content" : "light-content", get statusBarColor() { return color(this.toolbarDefaultBg) @@ -199,7 +199,7 @@ export default { // List listBg: "transparent", - listBorderColor: "#727272", + listBorderColor: "#3e3e3e", listDividerBg: "#f4f4f4", listBtnUnderlayColor: "#DDD", listItemPadding: platform === "ios" ? 10 : 12, @@ -231,10 +231,10 @@ export default { inverseSpinnerColor: "#1A191B", // Tab - tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#be1522", + tabDefaultBg: platform === "ios" ? "#333333" : "#be1522", topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff", - topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", + topTabBarBorderColor: platform === "ios" ? "#3f3f3f" : "#fff", topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff", // Tabs diff --git a/package-lock.json b/package-lock.json index b1403f9..d383a1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1042,6 +1042,11 @@ "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-2.0.10.tgz", "integrity": "sha512-NrIzyLe0eSbhgMnHl2QdSEhaA7yXh6p9jzMomfUa//hoTXE+xbObGDdiWWSQm2bnXnZJg8XCU3AB9qzvqcuLnA==" }, + "@react-native-community/status-bar": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@react-native-community/status-bar/-/status-bar-1.0.3.tgz", + "integrity": "sha512-5gwhG1gBTXqgSi/e9DbraBQBCtUtTCSrI9kuwEpwLOCa/pKLIyxQG/HM96ZjvytbZOTZXeaTiKtqLFvYNYSx3A==" + }, "@react-navigation/core": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-3.4.2.tgz", diff --git a/package.json b/package.json index 77371fe..2122e9e 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "@expo/vector-icons": "^10.0.2", + "@react-native-community/status-bar": "^1.0.3", "@shoutem/theme": "^0.11.3", "expo": "^33.0.7", "expo-font": "^5.0.1", diff --git a/screens/PlanningScreen.js b/screens/PlanningScreen.js index 5308338..ca62215 100644 --- a/screens/PlanningScreen.js +++ b/screens/PlanningScreen.js @@ -128,9 +128,13 @@ export default class PlanningScreen extends React.Component { // Surround description with div to allow text styling if the description is not html " + this.state.modalCurrentDisplayItem.description + ""} tagsStyles={{ - p: {color: ThemeManager.getCurrentThemeVariables().textColor}, + p: { + color: ThemeManager.getCurrentThemeVariables().textColor, + fontSize: ThemeManager.getCurrentThemeVariables().fontSizeBase + }, div: {color: ThemeManager.getCurrentThemeVariables().textColor} - }}/> + }} + onLinkPress={(event, link) => openWebLink(link)}/> : } diff --git a/screens/ProxiwashAboutScreen.js b/screens/ProxiwashAboutScreen.js index 0f771b9..f1c6cf3 100644 --- a/screens/ProxiwashAboutScreen.js +++ b/screens/ProxiwashAboutScreen.js @@ -29,8 +29,14 @@ export default class ProxiwashAboutScreen extends React.Component { const nav = this.props.navigation; return ( - - + +