-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added monospace code font #4
Conversation
According to GeekyAnts/nativebase-templates#19, From iOS 15 onward, we need "Courier New" instead of "Courier". I also think making it bold with "Courier New" is better. |
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.
Thanks for finding the cool font!!
components/Code/Code.tsx
Outdated
Hack: require("../../assets/fonts/Hack-Regular.ttf"), | ||
}); | ||
|
||
const courierFont = Platform.Version >= 15 ? 'Courier New' : 'Courier'; |
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.
I just tested on iOS. It seems like Platform.Version returns a string on Android and a number on iOS, which typescript complains about. And we can get the major version number from Platform.Version:
const courierFont = (Platform.OS === "ios" && parseInt(Platform.Version, 10)>=15) ? 'Courier New' : 'Courier';
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.
Awesome!
Please test on ios