forked from vergnet/application-amicale
		
	Fixed crash on nightmode toggle and proxiwash category selection + changed brand color
This commit is contained in:
		
							parent
							
								
									1cb68a0d15
								
							
						
					
					
						commit
						3f8a33aced
					
				
					 8 changed files with 52 additions and 55 deletions
				
			
		|  | @ -46,7 +46,6 @@ export default class BaseContainer extends React.Component<Props, State> { | |||
|     } | ||||
| 
 | ||||
|     render() { | ||||
|         console.log(this.state.isOpen); | ||||
|         return ( | ||||
|             <CustomSideMenu navigation={this.props.navigation} isOpen={this.state.isOpen} | ||||
|                             onChange={(isOpen) => this.updateMenuState(isOpen)}> | ||||
|  |  | |||
|  | @ -14,7 +14,6 @@ type Props = { | |||
| 
 | ||||
| export default class CustomSideMenu extends React.Component<Props> { | ||||
|     render() { | ||||
|         console.log(this.props.isOpen); | ||||
|         return ( | ||||
|             <SideMenu menu={<SideBar navigation={this.props.navigation}/>} | ||||
|                       isOpen={this.props.isOpen} | ||||
|  |  | |||
|  | @ -101,12 +101,12 @@ export default { | |||
|     CheckboxIconSize: platform === "ios" ? 21 : 16, | ||||
|     CheckboxIconMarginTop: platform === "ios" ? undefined : 1, | ||||
|     CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17, | ||||
|     checkboxBgColor: "#E4202D", | ||||
|     checkboxBgColor: "#be1522", | ||||
|     checkboxSize: 20, | ||||
|     checkboxTickColor: "#fff", | ||||
| 
 | ||||
|     // Color
 | ||||
|     brandPrimary: platform === "ios" ? "#e42612" : "#e42612", | ||||
|     brandPrimary: platform === "ios" ? "#be1522" : "#be1522", | ||||
|     brandInfo: "#62B1F6", | ||||
|     brandSuccess: "#5cb85c", | ||||
|     brandDanger: "#d9534f", | ||||
|  | @ -149,14 +149,14 @@ export default { | |||
|     tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", | ||||
| 
 | ||||
|     // Header
 | ||||
|     toolbarBtnColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", | ||||
|     toolbarBtnColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522", | ||||
|     toolbarHeight: platform === "ios" ? 64 : 56, | ||||
|     toolbarSearchIconSize: platform === "ios" ? 20 : 23, | ||||
|     toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", | ||||
|     searchBarHeight: platform === "ios" ? 30 : 40, | ||||
|     searchBarInputHeight: platform === "ios" ? 30 : 50, | ||||
|     toolbarBtnTextColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f", | ||||
|     iosStatusbar: platform === "ios" ? "dark-content" : "light-content", | ||||
|     get statusBarColor() { | ||||
|  | @ -194,7 +194,7 @@ export default { | |||
|     lineHeightH2: 27, | ||||
|     lineHeightH3: 22, | ||||
|     lineHeight: platform === "ios" ? 20 : 24, | ||||
|     listItemSelected: platform === "ios" ? "#e42612" : "#e42612", | ||||
|     listItemSelected: platform === "ios" ? "#be1522" : "#be1522", | ||||
| 
 | ||||
|     // List
 | ||||
|     listBg: "transparent", | ||||
|  | @ -226,15 +226,15 @@ export default { | |||
|     segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", | ||||
| 
 | ||||
|     // Spinner
 | ||||
|     defaultSpinnerColor: "#e42612", | ||||
|     defaultSpinnerColor: "#be1522", | ||||
|     inverseSpinnerColor: "#1A191B", | ||||
| 
 | ||||
|     // Tab
 | ||||
|     tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", | ||||
|     tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522", | ||||
|     topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", | ||||
|     topTabBarActiveTextColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", | ||||
|     topTabBarActiveBorderColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff", | ||||
| 
 | ||||
|     // Tabs
 | ||||
|     tabBgColor: "#F8F8F8", | ||||
|  |  | |||
|  | @ -106,7 +106,7 @@ export default { | |||
|     checkboxTickColor: "#fff", | ||||
| 
 | ||||
|     // Color
 | ||||
|     brandPrimary: platform === "ios" ? "#e42612" : "#e42612", | ||||
|     brandPrimary: platform === "ios" ? "#be1522" : "#be1522", | ||||
|     brandInfo: "#62B1F6", | ||||
|     brandSuccess: "#5cb85c", | ||||
|     brandDanger: "#d9534f", | ||||
|  | @ -149,14 +149,14 @@ export default { | |||
|     tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", | ||||
| 
 | ||||
|     // Header
 | ||||
|     toolbarBtnColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#e42612", | ||||
|     toolbarBtnColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#be1522", | ||||
|     toolbarHeight: platform === "ios" ? 64 : 56, | ||||
|     toolbarSearchIconSize: platform === "ios" ? 20 : 23, | ||||
|     toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", | ||||
|     searchBarHeight: platform === "ios" ? 30 : 40, | ||||
|     searchBarInputHeight: platform === "ios" ? 30 : 50, | ||||
|     toolbarBtnTextColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#ba1f0f", | ||||
|     iosStatusbar: platform === "ios" ? "dark-content" : "light-content", | ||||
|     get statusBarColor() { | ||||
|  | @ -194,7 +194,7 @@ export default { | |||
|     lineHeightH2: 27, | ||||
|     lineHeightH3: 22, | ||||
|     lineHeight: platform === "ios" ? 20 : 24, | ||||
|     listItemSelected: platform === "ios" ? "#e42612" : "#e42612", | ||||
|     listItemSelected: "#be1522", | ||||
| 
 | ||||
|     // List
 | ||||
|     listBg: "transparent", | ||||
|  | @ -214,7 +214,7 @@ export default { | |||
|     radioSelectedColorAndroid: "#E4202D", | ||||
|     radioBtnLineHeight: platform === "ios" ? 29 : 24, | ||||
|     get radioColor() { | ||||
|         return this.brandPrimary; | ||||
|         return "#be1522"; | ||||
|     }, | ||||
| 
 | ||||
|     // Segment
 | ||||
|  | @ -226,15 +226,15 @@ export default { | |||
|     segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", | ||||
| 
 | ||||
|     // Spinner
 | ||||
|     defaultSpinnerColor: "#e42612", | ||||
|     defaultSpinnerColor: "#be1522", | ||||
|     inverseSpinnerColor: "#1A191B", | ||||
| 
 | ||||
|     // Tab
 | ||||
|     tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#e42612", | ||||
|     tabDefaultBg: platform === "ios" ? "#2b2b2b" : "#be1522", | ||||
|     topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", | ||||
|     topTabBarActiveTextColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     topTabBarActiveTextColor: platform === "ios" ? "#be1522" : "#fff", | ||||
|     topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", | ||||
|     topTabBarActiveBorderColor: platform === "ios" ? "#e42612" : "#fff", | ||||
|     topTabBarActiveBorderColor: platform === "ios" ? "#be1522" : "#fff", | ||||
| 
 | ||||
|     // Tabs
 | ||||
|     tabBgColor: "#2b2b2b", | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen'; | |||
|  */ | ||||
| export default createAppContainer( | ||||
|     createStackNavigator({ | ||||
|             Tabs: MainTabNavigator, | ||||
|             Main: MainTabNavigator, | ||||
|             // Drawer: MainDrawerNavigator,
 | ||||
|             ProximoListScreen: {screen: ProximoListScreen}, | ||||
|             SettingsScreen: {screen: SettingsScreen}, | ||||
|  | @ -20,7 +20,7 @@ export default createAppContainer( | |||
|             AboutDependenciesScreen: {screen: AboutDependenciesScreen}, | ||||
|         }, | ||||
|         { | ||||
|             initialRouteName: "Tabs", | ||||
|             initialRouteName: "Main", | ||||
|             mode: 'card', | ||||
|             headerMode: "none" | ||||
|         }) | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ import ProxiwashScreen from '../screens/ProxiwashScreen'; | |||
| import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen'; | ||||
| import PlanexScreen from '../screens/PlanexScreen'; | ||||
| import CustomMaterialIcon from "../components/CustomMaterialIcon"; | ||||
| import ThemeManager from "../utils/ThemeManager"; | ||||
| 
 | ||||
| const TAB_ICONS = { | ||||
|     Home: 'coffee', | ||||
|  | @ -34,7 +35,7 @@ export default createMaterialBottomTabNavigator({ | |||
|     order: ['Proximo', 'Planning', 'Home', 'Proxiwash', 'Planex'], | ||||
|     initialRouteName: 'Home', | ||||
|     activeColor: '#f0edf6', | ||||
|     inactiveColor: '#7f150a', | ||||
|     inactiveColor: '#4e1108', | ||||
|     backBehavior: 'initialRoute', | ||||
|     barStyle: {backgroundColor: '#e42612'}, | ||||
|     barStyle: {backgroundColor: ThemeManager.getCurrentThemeVariables().brandPrimary}, | ||||
| }); | ||||
|  |  | |||
|  | @ -188,34 +188,32 @@ export default class ProximoListScreen extends React.Component<Props, State> { | |||
| 
 | ||||
|         return ( | ||||
|             <Container> | ||||
|                 <CustomHeader hasBackButton={true} navigation={nav} title={navType} rightMenu={ | ||||
|                     <Right> | ||||
|                         <Menu | ||||
|                             ref={this.setMenuRef} | ||||
|                             button={ | ||||
|                                 <Touchable | ||||
|                                     style={{padding: 6}} | ||||
|                                     onPress={() => | ||||
|                                         this._menu.show() | ||||
|                                     }> | ||||
|                                     <CustomMaterialIcon | ||||
|                                         color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"} | ||||
|                                         icon={'sort'}/> | ||||
|                                 </Touchable> | ||||
|                             } | ||||
|                         > | ||||
|                             <MenuItem | ||||
|                                 onPress={() => this.sortModeSelected(sortMode.name)}> | ||||
|                                 {this.state.sortNameIcon} | ||||
|                                 {i18n.t('proximoScreen.sortName')} | ||||
|                             </MenuItem> | ||||
|                             <MenuItem | ||||
|                                 onPress={() => this.sortModeSelected(sortMode.price)}> | ||||
|                                 {this.state.sortPriceIcon} | ||||
|                                 {i18n.t('proximoScreen.sortPrice')} | ||||
|                             </MenuItem> | ||||
|                         </Menu> | ||||
|                     </Right> | ||||
|                 <CustomHeader hasBackButton={true} navigation={nav} title={navType} rightButton={ | ||||
|                     <Menu | ||||
|                         ref={this.setMenuRef} | ||||
|                         button={ | ||||
|                             <Touchable | ||||
|                                 style={{padding: 6}} | ||||
|                                 onPress={() => | ||||
|                                     this._menu.show() | ||||
|                                 }> | ||||
|                                 <CustomMaterialIcon | ||||
|                                     color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"} | ||||
|                                     icon={'sort'}/> | ||||
|                             </Touchable> | ||||
|                         } | ||||
|                     > | ||||
|                         <MenuItem | ||||
|                             onPress={() => this.sortModeSelected(sortMode.name)}> | ||||
|                             {this.state.sortNameIcon} | ||||
|                             {i18n.t('proximoScreen.sortName')} | ||||
|                         </MenuItem> | ||||
|                         <MenuItem | ||||
|                             onPress={() => this.sortModeSelected(sortMode.price)}> | ||||
|                             {this.state.sortPriceIcon} | ||||
|                             {i18n.t('proximoScreen.sortPrice')} | ||||
|                         </MenuItem> | ||||
|                     </Menu> | ||||
|                 }/> | ||||
| 
 | ||||
|                 <Content> | ||||
|  |  | |||
|  | @ -101,7 +101,7 @@ export default class SettingsScreen extends React.Component<Props, State> { | |||
|             actions: [NavigationActions.navigate({routeName: 'Main'})], | ||||
|         }); | ||||
|         this.props.navigation.dispatch(resetAction); | ||||
|         this.props.navigation.navigate('Settings'); | ||||
|         // this.props.navigation.navigate('SettingsScreen');
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue