Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rightTitle / leftTitle #2019

Closed
cadudragon opened this issue Jul 12, 2017 · 24 comments
Closed

rightTitle / leftTitle #2019

cadudragon opened this issue Jul 12, 2017 · 24 comments

Comments

@cadudragon
Copy link

cadudragon commented Jul 12, 2017

rightTitle and leftTitle doesnt show in (Android Emulator)

I've tried in my project than in the repository example:

 <Scene key="loginModal" component={Login} title="Login" rightTitle="Right" onLeft={Actions.pop}/>
              <Scene
                key="loginModal2"
                component={Login2}
                title="Login2"
                panHandlers={null}
                duration={1}
              />
@aksonov
Copy link
Owner

aksonov commented Jul 12, 2017

Where is onRight? I don't see any leftTitle

@cadudragon
Copy link
Author

rightTitle only works with onRight?
I've changed my project and still don wokrs.

Let me show my cenario.
This is my Router Component:

        <Router>
            <Scene key="root" modal hideNavBar>
                <Scene
                    key="auth"
                    initial title="Please Login"
                    onRight={() => console.log('Right button')}
                    rightTitle="Right"
                >
                    <Scene key="login" component={LoginForm} />
                </Scene>
                <Scene key="main">
                    <Scene
                        renderRightButton={() => <Text onPress={() => { console.log('Add'); }}>Add</Text>}
                        key="employeeList"
                        component={EmployeeList}
                        title="Employeessss"
                        onRight={() => alert('Right button')}
                    />
                </Scene>
            </Scene>
        </Router>

I'm trying to use rightTitle in the key Scene and doesnt show:
image

Am I doing somenthing wrong?

For now I'm using renderRightButton instead of rightTitle.

@aksonov
Copy link
Owner

aksonov commented Jul 12, 2017

Could you try PR #2015 ?

@cadudragon
Copy link
Author

I'm still newbie with git and npm, but I think I've done right:

npm install aksonov/react-native-router-flux#pull/2015/head
My dependencies look like this:
image

After rerun the rightTitle still not appearing

@aksonov
Copy link
Owner

aksonov commented Jul 12, 2017

I can't reproduce. Please check Example from that PR, I've just committed rightTitle for Login Page and see it normally.

If you see it but don't see within your project, fork Example and try to reproduce it with Example.

@aksonov
Copy link
Owner

aksonov commented Jul 13, 2017

Should work with v4 beta.8

@aksonov aksonov closed this as completed Jul 13, 2017
@parachute-dev
Copy link

Still seem to have the same issue - no text appearing - tried rightTitle & leftTitle (using onLeft & onRight too). Currently using ^4.0.0-beta.11

This is with the android emulator on Windows.

"dependencies": {
"firebase": "^4.1.3",
"mobx": "^3.2.1",
"mobx-react": "^4.2.2",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.46.3",
"react-native-router-flux": "^4.0.0-beta.11",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.1.0",
"eslint-config-rallycoding": "^3.2.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}

@aksonov
Copy link
Owner

aksonov commented Jul 17, 2017 via email

@parachute-dev
Copy link

Hi there - yes of course, thanks for the response - as below.

console.log('left')} title="Please Login" /> console.log('right')} component={EmployeeList} title="Employees" /> ![desktop screenshot](https://user-images.githubusercontent.com/7774740/28259561-c9f7e838-6ace-11e7-8a1e-af8cca58ad0c.png)

@aksonov
Copy link
Owner

aksonov commented Jul 17, 2017

I mean Example project included into this github. Please clone and modify to reproduce the issue.

@parachute-dev
Copy link

Hey - sorry - have done so now. Still not seeing what I expect on tab1_1 It should show a right title?

renderRightButton does work however on tab2_1

desktop screenshot

@aksonov
Copy link
Owner

aksonov commented Jul 17, 2017

It should display 'Right'. Could you check iOS? Looks like different behaviour for iOS/Android again...

@aksonov aksonov reopened this Jul 17, 2017
@aksonov
Copy link
Owner

aksonov commented Jul 17, 2017

@diegocouto Do you have the same missed rightTitle on Android for Tab#1_1 ?

@diegocouto
Copy link
Contributor

@aksonov I do! On Tab#2_1 the right text is displayed, but not the Tab#1_1 button. It's the same issue with positioning that we faced with the back button. I'm already working on a PR.

diegocouto added a commit to diegocouto/react-native-router-flux that referenced this issue Jul 17, 2017
@parachute-dev
Copy link

@diegocouto Thanks - also noticed that the alignment isn't in the centre for the header - not sure if there's another flag to change this in the API?

@diegocouto
Copy link
Contributor

@parachute-dev The title is center aligned on iOS only, probably to comply to the material design guidelines.

When defining your scene, you can use titleStyle attribute to define new styles to the scene title. 😃

@parachute-dev
Copy link

parachute-dev commented Jul 17, 2017 via email

@cadudragon
Copy link
Author

v4 beta.8 also not showing the output of right/leftTitle.

@aksonov
Copy link
Owner

aksonov commented Jul 17, 2017

@cadudragon Please try latest master

@aksonov aksonov closed this as completed Jul 19, 2017
@OrianeInMoon
Copy link

on 4.0.0-beta.15:
leftTitle is only displayed when no onLeft function is provided.

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017

Have you checked 4.0.0-beta.14?

@OrianeInMoon
Copy link

The same occured using 4.0.0-beta.14.

In fact, it only works when using onLeft={Actions.pop}, not when using onLeft={Actions.mypage}

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017 via email

@OrianeInMoon
Copy link

OrianeInMoon commented Aug 1, 2017

So why I can see the wanted action using console.log(Actions) before the Router declaration !?

EDIT

it is due to hot reload..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants