react-native-simple-router icon indicating copy to clipboard operation
react-native-simple-router copied to clipboard

Using titleComponent and leftCorner isn´t compatible

Open BigPun86 opened this issue 9 years ago • 2 comments

Hey there!

I have a component where i use a custom titleComponent with an custom leftCorner component. I need the leftCorner to trigger my side menu. now i have figured out, when i only use the leftCorner everything is fine. i can trigger the sidemenu with the customAction callback in my Router. Now when i use both, leftCorner and titleComponent, then my leftCorner "button" won´t be triggered....

Anyone with similar issue or some hints?

this.props.toRoute({
    name: 'HOME',
    component: Routes.Dashboard,
    //titleComponent: Title,
    //titleProps: {...this.props},
    leftCorner: BurgerMenu,
    headerStyle: {backgroundColor: 'white'}
})

export class BurgerMenu extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <TouchableHighlight
                underlayColor={'transparent'}
                onPress={()=>this.props.customAction("BurgerMenu")}>
                <Image source={Theme.Images.ICONS_BURGER_MENU} style={styles.burgerMenu}/>
            </TouchableHighlight>
        )
    }
}

export class Title extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <Text style={[styles.navBarText, Theme.mix('textSemiBold|medium|regular')]}>{translate('camigos')}</Text>
        )
    }
}

BigPun86 avatar Mar 16 '16 11:03 BigPun86

Fixed it by giving my Title Component a fix width

BigPun86 avatar Mar 17 '16 08:03 BigPun86

Hmmm.. Strange behaviour.

It's sound like the title component overlaps other components.

Thank you for reporting.

charpeni avatar Mar 18 '16 13:03 charpeni