3.0.27 • Published 10 days ago

servisofts-component v3.0.27

Weekly downloads
-
License
ISC
Repository
github
Last release
10 days ago
by servisofts.com

servisofts-component

Servisofts Component is a library for Android, IOS & web for easing app development in react-native-web.

Table of contents

Getting started

Install the required dependences using npm:

npm install --save-dev
    @babel/core
    @babel/runtime
    metro-react-native-babel-preset
    react-scripts
npm install --save 
    @react-native-community/masked-view 
    react
    react-dom
    react-native
    react-native-web
    react-native-svg
    react-native-svg-transformer
    react-native-gesture-handler
    react-native-reanimated
    react-native-safe-area-context
    react-native-screens
    @react-navigation/native
    @react-navigation/stack
    servisofts-socket 
    react-redux 
    redux 
    redux-thunk

Install the library using npm:

npm install --save servisofts-component

Using React Native >= 0.60

Linking the package manually is not required anymore with Autolinking.

iOS Platform:

$ cd ios && pod install && cd .. # CocoaPods on iOS needs this extra step

Android Platform:

Modify your android/build.gradle configuration to match minSdkVersion = 21:

buildscript {
  ext {
    ...
    minSdkVersion = 21
    ...
  }

Using React Native < 0.60

--not supported--

Configure 'react-native-web' proyect

Proyect Files

APPNAME
  ├── android/  
  ├── ios/
  ├── public/
  ├── src/
  │   ├── Components/
  │   │   └── ...      // All components
  │   │ 
  │   ├── Pages/
  │   │   └── ...      // All pages
  │   │ 
  │   ├── App.js     
  │   ├── index.css
  │   └── index.js     // Index app web
  │   
  ├── .eslintrc.js
  ├── .flowconfig
  ├── .gitignore
  ├── .watchmanconfig
  ├── app.json        // App name
  ├── babel.config.js
  ├── index.js        // Index app mobile
  ├── metro.config.js
  └── package.json    

Configure 'metro.config.js'

You will need a metro.config.js file in order to use a ( svg , mp3, otf ) extencion. Inside a module.exports object, create a key called resolver with another object called assetExts. The value of assetExts should be an array of the resource file extensions you want to support.

If you want to support .pem files (plus all the already supported files), your metro.config.js would like like this:

const { getDefaultConfig } = require("metro-config");

module.exports = (async () => { 
	const {  
		resolver: { 
			sourceExts, 
			assetExts 
		}  
	} = await getDefaultConfig(); 
    assetExts.push("pem");
	return {
		transformer: {      
			babelTransformerPath: require.resolve("react-native-svg-transformer")    
		},    
		resolver: {
			assetExts: assetExts.filter(ext => ext !== "svg"),
			sourceExts: [...sourceExts, "svg","mp3" ]    
			
		}};
})();

Usage

In src/app.js import SComponentContainer

import React from 'react';
import { SComponentContainer } from 'servisofts-component';

const App = () => {
  return (
    <SComponentContainer
      debug //Show debug bar on top
      theme={{
        initialTheme: "dark", 
        themes: {
          default: {
            barStyle: "dark-content",
            barColor: "#ffffff",
            primary: "#ffffff",
            secondary: "#000000",
            background: "#dddddd"
          },
          dark: {
            barStyle: "light-content",
            barColor: "#000000",
            primary: "#000000",
            secondary: "#ffffff",
            background: "#222222"
          }
        }
      }}>

    { /* ... */ }

    </SComponentContainer>
  );
};

In src/index.css copy this style

body {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

/* These styles make the body full-height */

html, body {
  height: 100%;
}

/* These styles disable body scrolling if you are using <ScrollView> */

body {
  overflow: hidden;
}

/* These styles make the root element full-height */

#root {
  overflow: hidden;
  position: fixed;
  width: 100%;
  display: flex;
  height: 100vh;
}

Components

Types

Type SDirectionType

  • "row" | "column"

Type SColType

Type TColStr

  • "xs-12 md-6"

Type TColVal

  • "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "8.543"

Type TColKey

  • "xs" | "sm" | "md" | "lg" | "xl"

Type SViewProps

Type STextProps

Type SComponentContainerProps

Type SNavigationProps

Type SPageProps

Type SPageListProps

  • url: string,
  • component: any,
  • options: { headerShown: boolean }

Type SThemeColors

  • barStyle: "dark-content" | "light-content"
  • barColor: string
  • primary: string
  • secondary: string
  • background: string

Type SThemeOptions

  • "default" | "dark"

Type SThemeProps

Type SThemeThemes

3.0.27

10 days ago

3.0.25

17 days ago

3.0.26

17 days ago

3.0.24

23 days ago

3.0.23

25 days ago

3.0.22

26 days ago

3.0.21

2 months ago

3.0.20

4 months ago

3.0.19

5 months ago

3.0.12

6 months ago

3.0.13

6 months ago

3.0.10

6 months ago

3.0.11

6 months ago

3.0.17

5 months ago

3.0.14

6 months ago

3.0.15

6 months ago

3.0.15-error

6 months ago

3.0.8

6 months ago

3.0.7

6 months ago

3.0.16-beta

5 months ago

3.0.18

5 months ago

3.0.9

6 months ago

3.0.4

7 months ago

3.0.3

7 months ago

3.0.2

7 months ago

3.0.1

7 months ago

3.0.6

7 months ago

3.0.5

7 months ago

2.11.23

7 months ago

2.11.24

7 months ago

2.11.25

7 months ago

2.11.9

11 months ago

2.11.6

11 months ago

2.11.4

11 months ago

2.11.5

11 months ago

2.11.3

11 months ago

2.11.10

11 months ago

2.11.11

11 months ago

2.11.12

11 months ago

2.11.13

11 months ago

2.11.14

10 months ago

2.11.15

10 months ago

2.11.16

10 months ago

2.11.17

9 months ago

2.11.18

9 months ago

2.11.19

9 months ago

2.11.20

9 months ago

2.11.21

9 months ago

2.11.22

9 months ago

2.11.0

12 months ago

2.11.1

12 months ago

2.9.4

1 year ago

2.9.3

1 year ago

2.9.6

1 year ago

2.9.5

1 year ago

2.11.2

12 months ago

2.9.8

1 year ago

2.9.7

1 year ago

2.10.1

1 year ago

2.10.2

1 year ago

2.10.7

1 year ago

2.10.5

1 year ago

2.10.6

1 year ago

2.10.3

1 year ago

2.10.4

1 year ago

2.9.2

1 year ago

2.9.1

2 years ago

2.9.0

2 years ago

2.8.1

2 years ago

2.8.0

2 years ago

2.8.3

2 years ago

2.8.2

2 years ago

2.8.4

2 years ago

2.7.6

2 years ago

2.7.5

2 years ago

2.7.8

2 years ago

2.7.7

2 years ago

2.7.9

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.6.7

2 years ago

2.5.6

2 years ago

2.5.5

2 years ago

2.6.1

2 years ago

2.6.3

2 years ago

2.6.2

2 years ago

2.5.2

2 years ago

2.5.4

2 years ago

2.5.3

2 years ago

2.6.4

2 years ago

2.6.6

2 years ago

2.4.1

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.6

2 years ago

2.3.5

2 years ago

2.4.7

2 years ago

2.4.6

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.3.7

2 years ago

2.5.1

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.1.6

2 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.5

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.11

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.13.2

3 years ago

1.13.6

3 years ago

1.13.5

3 years ago

1.13.4

3 years ago

1.13.3

3 years ago

1.13.8

3 years ago

1.13.7

3 years ago

1.12.2

3 years ago

1.11.3

3 years ago

1.10.4

3 years ago

1.10.3

3 years ago

1.11.1

3 years ago

1.10.2

3 years ago

1.8.2

3 years ago

1.7.3

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.7.2

3 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.7.8

3 years ago

1.6.9

3 years ago

1.8.6

3 years ago

1.6.8

3 years ago

1.8.5

3 years ago

1.7.6

3 years ago

1.6.7

3 years ago

1.7.5

3 years ago

1.8.3

3 years ago

1.7.4

3 years ago

1.10.1

3 years ago

1.4.6

3 years ago

1.4.4

3 years ago

1.4.0

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago