nafapp
TypeScript icon, indicating that this package has built-in type declarations

4.4.3 • Public • Published

NAF App Components

Library for using NAFs designcomponents in ReactNative and Expo built apps.

How to use

Install with npm

npm install nafapp --save

Install with yarn

yarn add nafapp --save

Fonts

To make the fonts work, you need to import these into the App. Below is an example of how you can do this if you use Expo.

Read more at Expo documentation

// ./helpers/loadFonts.js

import * as Font from 'expo-font';

// Mark! The path to node_modules needs to be updated according to the location of the Font.loadAsync file.
await Font.loadAsync({
  'questa-sans': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-Regular.ttf'),
  'questa-sans-regular': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-Regular.ttf'),
  'questa-sans-black': require('../.node_modules/nafapp/dist/media/fonts/QuestaSans-Black.ttf'),
  'questa-sans-bold': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-Bold.ttf'),
  'questa-sans-light': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-Light.ttf'),
  'questa-sans-medium': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-Medium.ttf'),
  'questa-sans-light-italic': require('../node_modules/nafapp/dist/media/fonts/QuestaSans-LightItalic.ttf'),
});

This will allow you to use the fonts in your app. Ex: questa-sans-regular or questa-sans-bold. See example under:

import { StyleSheet } from 'react-native';

const styles = StyleSheet.create({
  text: {
    fontFamily: 'questa-sans',
  },
});

Techincal overview

Please use the npm package manager while working on this repo. You can find the package on npmjs.com.

Versioning

The package is following the Semantic Versioning standard.

Version strategy

major version is incremented when the library supports a new version of either (or both) new version of React and React Native. minor version is incremented when there is a new feature in the package patch version is incremented when there is a bug fix in the package

Commit strategy

The library is following the Conventional Commits standard. The pipeline will automatically bump the vesion based on the commit type, (t.ex: fix and feature). It will also update the Changelog based on the commit type and message.

Husky

The huskey plugin will make sure that you follow the correct commit-rules, but as a reminder, the following are the commit-rules:

breaking change

git commit -m 'feat!(component): <description>'

Or without scope, for instance when we bump the React or React Native version: git commit -m 'feat!: bump react version to <version>'.

The key to bumping the major version is to add an exclamation mark (!) after the word feat in the commit message, feat!: some commit message.

feature:

git commit -m 'feature(<component>): <description>'

The feat keyword (leaving out the exclamation mark), bumps the minor version number of the current major.

bugfix:

git commit -m 'fix(<component>): <description>'

The fix keyword bumps the patch number of the current minor.

The scope could be removed if the commit is more global, ex: git commit -m 'fix: component a and component b is now renamed to component c'

While merging multiple commits in the pull request the pull request commit message could be written as: build: <description> to avoid the text be written to the changelog.

Version mapping to React and React Native

| nafapp | ReactNative | React | | ------ | -------------------------------------------- | --------------------------------- | --- | | ^1.0.0 | 0.64.3 | 17.0.1 |   |

Disclaimer

The package is still in development, so as long the major is on 1.x.x the package will be considered unstable. The package will be stable when it reaches the 2.x.x version.

Readme

Keywords

none

Package Sidebar

Install

npm i nafapp

Weekly Downloads

92

Version

4.4.3

License

none

Unpacked Size

1.54 MB

Total Files

245

Last publish

Collaborators

  • nafberre
  • nafappteam