Fixed crash on nightmode toggle and proxiwash category selection + changed brand color

This commit is contained in:
keplyx 2019-08-07 11:33:45 +02:00
parent 1cb68a0d15
commit 3f8a33aced
8 changed files with 52 additions and 55 deletions

View file

@ -46,7 +46,6 @@ export default class BaseContainer extends React.Component<Props, State> {
} }
render() { render() {
console.log(this.state.isOpen);
return ( return (
<CustomSideMenu navigation={this.props.navigation} isOpen={this.state.isOpen} <CustomSideMenu navigation={this.props.navigation} isOpen={this.state.isOpen}
onChange={(isOpen) => this.updateMenuState(isOpen)}> onChange={(isOpen) => this.updateMenuState(isOpen)}>

View file

@ -14,7 +14,6 @@ type Props = {
export default class CustomSideMenu extends React.Component<Props> { export default class CustomSideMenu extends React.Component<Props> {
render() { render() {
console.log(this.props.isOpen);
return ( return (
<SideMenu menu={<SideBar navigation={this.props.navigation}/>} <SideMenu menu={<SideBar navigation={this.props.navigation}/>}
isOpen={this.props.isOpen} isOpen={this.props.isOpen}

View file

@ -101,12 +101,12 @@ export default {
CheckboxIconSize: platform === "ios" ? 21 : 16, CheckboxIconSize: platform === "ios" ? 21 : 16,
CheckboxIconMarginTop: platform === "ios" ? undefined : 1, CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17, CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17,
checkboxBgColor: "#E4202D", checkboxBgColor: "#be1522",
checkboxSize: 20, checkboxSize: 20,
checkboxTickColor: "#fff", checkboxTickColor: "#fff",
// Color // Color
brandPrimary: platform === "ios" ? "#e42612" : "#e42612", brandPrimary: platform === "ios" ? "#be1522" : "#be1522",
brandInfo: "#62B1F6", brandInfo: "#62B1F6",
brandSuccess: "#5cb85c", brandSuccess: "#5cb85c",
brandDanger: "#d9534f", brandDanger: "#d9534f",
@ -149,14 +149,14 @@ export default {
tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5",
// Header // Header
toolbarBtnColor: platform === "ios" ? "#e42612" : "#fff", toolbarBtnColor: platform === "ios" ? "#be1522" : "#fff",
toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522",
toolbarHeight: platform === "ios" ? 64 : 56, toolbarHeight: platform === "ios" ? 64 : 56,
toolbarSearchIconSize: platform === "ios" ? 20 : 23, toolbarSearchIconSize: platform === "ios" ? 20 : 23,
toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
searchBarHeight: platform === "ios" ? 30 : 40, searchBarHeight: platform === "ios" ? 30 : 40,
searchBarInputHeight: platform === "ios" ? 30 : 50, searchBarInputHeight: platform === "ios" ? 30 : 50,
toolbarBtnTextColor: platform === "ios" ? "#e42612" : "#fff", toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",
toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f", toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f",
iosStatusbar: platform === "ios" ? "dark-content" : "light-content", iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
get statusBarColor() { get statusBarColor() {
@ -194,7 +194,7 @@ export default {
lineHeightH2: 27, lineHeightH2: 27,
lineHeightH3: 22, lineHeightH3: 22,
lineHeight: platform === "ios" ? 20 : 24, lineHeight: platform === "ios" ? 20 : 24,
listItemSelected: platform === "ios" ? "#e42612" : "#e42612", listItemSelected: platform === "ios" ? "#be1522" : "#be1522",
// List // List
listBg: "transparent", listBg: "transparent",
@ -226,15 +226,15 @@ export default {
segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
// Spinner // Spinner
defaultSpinnerColor: "#e42612", defaultSpinnerColor: "#be1522",
inverseSpinnerColor: "#1A191B", inverseSpinnerColor: "#1A191B",
// Tab // Tab
tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522",
topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
topTabBarActiveTextColor: platform === "ios" ? "#e42612" : "#fff", topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff",
topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff",
topTabBarActiveBorderColor: platform === "ios" ? "#e42612" : "#fff", topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff",
// Tabs // Tabs
tabBgColor: "#F8F8F8", tabBgColor: "#F8F8F8",

View file

@ -106,7 +106,7 @@ export default {
checkboxTickColor: "#fff", checkboxTickColor: "#fff",
// Color // Color
brandPrimary: platform === "ios" ? "#e42612" : "#e42612", brandPrimary: platform === "ios" ? "#be1522" : "#be1522",
brandInfo: "#62B1F6", brandInfo: "#62B1F6",
brandSuccess: "#5cb85c", brandSuccess: "#5cb85c",
brandDanger: "#d9534f", brandDanger: "#d9534f",
@ -149,14 +149,14 @@ export default {
tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5",
// Header // Header
toolbarBtnColor: platform === "ios" ? "#e42612" : "#fff", toolbarBtnColor: platform === "ios" ? "#be1522" : "#fff",
toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522",
toolbarHeight: platform === "ios" ? 64 : 56, toolbarHeight: platform === "ios" ? 64 : 56,
toolbarSearchIconSize: platform === "ios" ? 20 : 23, toolbarSearchIconSize: platform === "ios" ? 20 : 23,
toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
searchBarHeight: platform === "ios" ? 30 : 40, searchBarHeight: platform === "ios" ? 30 : 40,
searchBarInputHeight: platform === "ios" ? 30 : 50, searchBarInputHeight: platform === "ios" ? 30 : 50,
toolbarBtnTextColor: platform === "ios" ? "#e42612" : "#fff", toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",
toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f", toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f",
iosStatusbar: platform === "ios" ? "dark-content" : "light-content", iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
get statusBarColor() { get statusBarColor() {
@ -194,7 +194,7 @@ export default {
lineHeightH2: 27, lineHeightH2: 27,
lineHeightH3: 22, lineHeightH3: 22,
lineHeight: platform === "ios" ? 20 : 24, lineHeight: platform === "ios" ? 20 : 24,
listItemSelected: platform === "ios" ? "#e42612" : "#e42612", listItemSelected: "#be1522",
// List // List
listBg: "transparent", listBg: "transparent",
@ -214,7 +214,7 @@ export default {
radioSelectedColorAndroid: "#E4202D", radioSelectedColorAndroid: "#E4202D",
radioBtnLineHeight: platform === "ios" ? 29 : 24, radioBtnLineHeight: platform === "ios" ? 29 : 24,
get radioColor() { get radioColor() {
return this.brandPrimary; return "#be1522";
}, },
// Segment // Segment
@ -226,15 +226,15 @@ export default {
segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
// Spinner // Spinner
defaultSpinnerColor: "#e42612", defaultSpinnerColor: "#be1522",
inverseSpinnerColor: "#1A191B", inverseSpinnerColor: "#1A191B",
// Tab // Tab
tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#e42612", tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#be1522",
topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
topTabBarActiveTextColor: platform === "ios" ? "#e42612" : "#fff", topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff",
topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff",
topTabBarActiveBorderColor: platform === "ios" ? "#e42612" : "#fff", topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff",
// Tabs // Tabs
tabBgColor: "#2b2b2b", tabBgColor: "#2b2b2b",

View file

@ -12,7 +12,7 @@ import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen';
*/ */
export default createAppContainer( export default createAppContainer(
createStackNavigator({ createStackNavigator({
Tabs: MainTabNavigator, Main: MainTabNavigator,
// Drawer: MainDrawerNavigator, // Drawer: MainDrawerNavigator,
ProximoListScreen: {screen: ProximoListScreen}, ProximoListScreen: {screen: ProximoListScreen},
SettingsScreen: {screen: SettingsScreen}, SettingsScreen: {screen: SettingsScreen},
@ -20,7 +20,7 @@ export default createAppContainer(
AboutDependenciesScreen: {screen: AboutDependenciesScreen}, AboutDependenciesScreen: {screen: AboutDependenciesScreen},
}, },
{ {
initialRouteName: "Tabs", initialRouteName: "Main",
mode: 'card', mode: 'card',
headerMode: "none" headerMode: "none"
}) })

View file

@ -7,6 +7,7 @@ import ProxiwashScreen from '../screens/ProxiwashScreen';
import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen'; import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
import PlanexScreen from '../screens/PlanexScreen'; import PlanexScreen from '../screens/PlanexScreen';
import CustomMaterialIcon from "../components/CustomMaterialIcon"; import CustomMaterialIcon from "../components/CustomMaterialIcon";
import ThemeManager from "../utils/ThemeManager";
const TAB_ICONS = { const TAB_ICONS = {
Home: 'coffee', Home: 'coffee',
@ -34,7 +35,7 @@ export default createMaterialBottomTabNavigator({
order: ['Proximo', 'Planning', 'Home', 'Proxiwash', 'Planex'], order: ['Proximo', 'Planning', 'Home', 'Proxiwash', 'Planex'],
initialRouteName: 'Home', initialRouteName: 'Home',
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#7f150a', inactiveColor: '#4e1108',
backBehavior: 'initialRoute', backBehavior: 'initialRoute',
barStyle: {backgroundColor: '#e42612'}, barStyle: {backgroundColor: ThemeManager.getCurrentThemeVariables().brandPrimary},
}); });

View file

@ -188,34 +188,32 @@ export default class ProximoListScreen extends React.Component<Props, State> {
return ( return (
<Container> <Container>
<CustomHeader hasBackButton={true} navigation={nav} title={navType} rightMenu={ <CustomHeader hasBackButton={true} navigation={nav} title={navType} rightButton={
<Right> <Menu
<Menu ref={this.setMenuRef}
ref={this.setMenuRef} button={
button={ <Touchable
<Touchable style={{padding: 6}}
style={{padding: 6}} onPress={() =>
onPress={() => this._menu.show()
this._menu.show() }>
}> <CustomMaterialIcon
<CustomMaterialIcon color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"} icon={'sort'}/>
icon={'sort'}/> </Touchable>
</Touchable> }
} >
> <MenuItem
<MenuItem onPress={() => this.sortModeSelected(sortMode.name)}>
onPress={() => this.sortModeSelected(sortMode.name)}> {this.state.sortNameIcon}
{this.state.sortNameIcon} {i18n.t('proximoScreen.sortName')}
{i18n.t('proximoScreen.sortName')} </MenuItem>
</MenuItem> <MenuItem
<MenuItem onPress={() => this.sortModeSelected(sortMode.price)}>
onPress={() => this.sortModeSelected(sortMode.price)}> {this.state.sortPriceIcon}
{this.state.sortPriceIcon} {i18n.t('proximoScreen.sortPrice')}
{i18n.t('proximoScreen.sortPrice')} </MenuItem>
</MenuItem> </Menu>
</Menu>
</Right>
}/> }/>
<Content> <Content>

View file

@ -101,7 +101,7 @@ export default class SettingsScreen extends React.Component<Props, State> {
actions: [NavigationActions.navigate({routeName: 'Main'})], actions: [NavigationActions.navigate({routeName: 'Main'})],
}); });
this.props.navigation.dispatch(resetAction); this.props.navigation.dispatch(resetAction);
this.props.navigation.navigate('Settings'); // this.props.navigation.navigate('SettingsScreen');
} }
/** /**