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

Allow the fontweight for the title to be customized #706

Merged
merged 11 commits into from Dec 7, 2020

Conversation

dylancom
Copy link
Contributor

Description

Currently you can customize the fontFamily and fontSize but not the fontWeight (of the header title).
This PR let's you also change the fontWeight of the header title.

@WoLewicki
Copy link
Member

WoLewicki commented Nov 17, 2020

Thanks for your contribution!

  1. In the PR template, there are all the places where the change/addition of a property should be added. It looks like you've missed the READMEs of native-stack and createNativeStackNavigator.
  2. Can you add this change to Android too? It should be rather simple. You can check here: https://github.com/software-mansion/react-native-screens/blob/master/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java#L236 and extend the if to check for both weight and FontFamily, only FontFamily (current), only weight.
  3. If you would like, there is a TestsExample project on the newest master, if you rebase to it, you could add a Test706 file that shows a minimal application of the changes.

If you need any help, please comment here.

@dylancom
Copy link
Contributor Author

dylancom commented Dec 4, 2020

@WoLewicki I tried Android but it had no effect, see: facebook/react-native#26193.
Seems that if you want for e.g. a bold font, you need to specify a bold font family.
I updated the READMEs, improved the iOS code and added an example.

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Please apply the changes requested and this should be ready to merge then!

README.md Outdated Show resolved Hide resolved
TestsExample/App.js Outdated Show resolved Hide resolved
TestsExample/ios/Podfile.lock Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.h Show resolved Hide resolved
@dylancom
Copy link
Contributor Author

dylancom commented Dec 7, 2020

@WoLewicki I applied the requested changes.

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor tweaks.

ios/RNSScreenStackHeaderConfig.m Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.m Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.m Outdated Show resolved Hide resolved
ios/RNSScreenStackHeaderConfig.m Outdated Show resolved Hide resolved
src/index.d.ts Outdated Show resolved Hide resolved
src/native-stack/types.tsx Show resolved Hide resolved
src/native-stack/types.tsx Outdated Show resolved Hide resolved
@dylancom
Copy link
Contributor Author

dylancom commented Dec 7, 2020

@WoLewicki Tweaked it.

Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
@WoLewicki
Copy link
Member

Ok it looks like it is ready to be merged 🎉 Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

None yet

2 participants