-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
add headerBackTitleStyle screen option #1083
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good. I am not in favour of allowing custom headerBackTitleStyle
as the default implementation is specifically made for iOS and optimised to look native. Inheriting things like fontFamily from headerTitleStyle
makes sense.
src/views/Header.js
Outdated
headerTitleStyle, | ||
} = this.props.getScreenDetails(lastScene).options; | ||
|
||
if (headerBackTitle === null) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/views/Header.js
Outdated
return null; | ||
} | ||
const { | ||
headerBackTitleStyle, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/views/Header.js
Outdated
} | ||
const { headerTitleStyle } = this.props.getScreenDetails(lastScene).options; | ||
|
||
return [headerTitleStyle, headerBackTitleStyle]; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
since the title is customizable, the back title should too.
If there's no last scene, return the `headerBackTitleStyle` from the current scene. Otherwise return the `headerTitleStyle` from the last scene, and the `headerBackTitleStyle` from the current scene, with the latter having precedence.
also the title style of the last scene is no longer taken into account
@grabbou @satya164 I came to the conclusion that inheriting or merging the styles isn't that logical, since the title and the backbutton already have different styles by default. I overlooked that fact because in the application I'm working on I have the title and the button title styled the same. That being said, I've reverted it to taking |
* add headerBackTitleStyle screen option since the title is customizable, the back title should too. * add documentation for `headerBackTitleStyle` * make absence of headerBackTitle not affect return value * merge styles so current scene can override If there's no last scene, return the `headerBackTitleStyle` from the current scene. Otherwise return the `headerTitleStyle` from the last scene, and the `headerBackTitleStyle` from the current scene, with the latter having precedence. * take headerBackTitleStyle from current scene also the title style of the last scene is no longer taken into account
I'm currently migrating an existing iOS app to React Native, where I use customized titles and back buttons.
The titles currently can be styled using
headerTitleStyle
, but for the back button there was no such option.So this change adds a
headerBackTitleStyle
screen option, which makes it possible to set the style for the back button title, and when not set it inherits the.headerTitleStyle
TODO