forked from vergnet/application-amicale
Fixed side menu staying open when changing tab + fixed ios tab icon color
This commit is contained in:
parent
cecf4154f6
commit
dd4ba0a9fc
5 changed files with 31 additions and 6 deletions
|
@ -24,6 +24,8 @@ type State = {
|
|||
|
||||
export default class BaseContainer extends React.Component<Props, State> {
|
||||
|
||||
willBlurSubscription: function;
|
||||
|
||||
static defaultProps = {
|
||||
headerRightButton: <View/>
|
||||
};
|
||||
|
@ -43,6 +45,26 @@ export default class BaseContainer extends React.Component<Props, State> {
|
|||
this.setState({isOpen});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register for blur event to close side menu on screen change
|
||||
*/
|
||||
componentDidMount() {
|
||||
this.willBlurSubscription = this.props.navigation.addListener(
|
||||
'willBlur',
|
||||
payload => {
|
||||
this.setState({isOpen: false});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister from event when un-mounting components
|
||||
*/
|
||||
componentWillUnmount() {
|
||||
if (this.willBlurSubscription !== undefined)
|
||||
this.willBlurSubscription.remove();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{
|
||||
|
|
|
@ -314,8 +314,9 @@ export default class FetchedDataSectionList extends React.Component<Props, State
|
|||
tabbedView.push(
|
||||
<Tab heading={
|
||||
<TabHeading>
|
||||
<CustomMaterialIcon icon={dataset[i].icon}
|
||||
color={'#fff'}
|
||||
<CustomMaterialIcon
|
||||
icon={dataset[i].icon}
|
||||
color={ThemeManager.getCurrentThemeVariables().tabIconColor}
|
||||
fontSize={20}
|
||||
/>
|
||||
<Text>{dataset[i].title}</Text>
|
||||
|
|
|
@ -238,6 +238,7 @@ export default {
|
|||
|
||||
// Tabs
|
||||
tabBgColor: "#F8F8F8",
|
||||
tabIconColor: platform === "ios" ? "#5d5d5d" : "#fff",
|
||||
tabFontSize: 15,
|
||||
|
||||
// Text
|
||||
|
|
|
@ -239,6 +239,7 @@ export default {
|
|||
|
||||
// Tabs
|
||||
tabBgColor: "#2b2b2b",
|
||||
tabIconColor: "#fff",
|
||||
tabFontSize: 15,
|
||||
|
||||
// Text
|
||||
|
|
|
@ -36,7 +36,7 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
|
|||
<TabHeading>
|
||||
<CustomMaterialIcon
|
||||
icon={'information'}
|
||||
color={'#fff'}
|
||||
color={ThemeManager.getCurrentThemeVariables().tabIconColor}
|
||||
fontSize={20}
|
||||
/>
|
||||
<Text>{i18n.t('proxiwashScreen.informationTab')}</Text>
|
||||
|
@ -106,7 +106,7 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
|
|||
<TabHeading>
|
||||
<CustomMaterialIcon
|
||||
icon={'cash'}
|
||||
color={'#fff'}
|
||||
color={ThemeManager.getCurrentThemeVariables().tabIconColor}
|
||||
fontSize={20}
|
||||
/>
|
||||
<Text>{i18n.t('proxiwashScreen.paymentTab')}</Text>
|
||||
|
|
Loading…
Reference in a new issue