@sthima/sthima-native
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

sthima-native

Sthima's component librery

components

SInput

SForm

SFacebookBtn

SAppleBtn

SEmailBtn

SToast

Simple toast messager

import React from "react";
import { Button, View } from 'react-native';
import {SToast} from 'sthima-native';

const App = () => {
    return (
        <View style={{flex: 1}}>
            <Button title={'Show toast'}  onPress={() => SToast.show("This is a toast")}/>
        </View>
    )
}

export default App;

Roles

Decides whether to render its children components based on a list of roles.

import React from "react";
import { View } from 'react-native';
import {SText, SRoles, SConfig} from 'sthima-native';

SConfig.userRoles = ['admin'];

const App = () => {
    return (
        <View style={{flex: 1}}>
            {/* Will take the roles on SConfig.userRoles */}
            <SRoles roles={["admin", "superAdmin"]}>
                <SText>Will render, has permission</SText>
            </SRoles>

            {/* Will take the roles on SConfig.userRoles */}
            <SRoles roles={["superAdmin"]}>
                <SText>will not render render</SText>
            </SRoles>


            {/* Will take the userRoles injected */}
            <SRoles roles={["superAdmin"]} userRoles={["superAdmin"]}>
                <SText>Exlusive to superAdmin Text but with direct role injection</SText>
            </SRoles>
        </View>
    )
}

export default App;

Utils

SFetch

SConfig

SFont

SDebug

This class allows you to have more control over what it's printed out on the debugger. Set the debug level on SDebug.debugLevel with one of these options

export enum SDebugLevel {
  log,
  info,
  warn,
  error,
  silent,
}

and them use Debug instead on console:

import {SDebug, SDebugLevel} from 'sthima-native'

SDebug.debugLevel = SDebugLevel.warn;

SDebug.log('Will not be printed');
SDebug.warn('This one will be printed');

Readme

Keywords

Package Sidebar

Install

npm i @sthima/sthima-native

Weekly Downloads

5

Version

0.0.10

License

ISC

Unpacked Size

54.1 kB

Total Files

42

Last publish

Collaborators

  • willian.gaspar
  • joaoschaab
  • lgmafra
  • diorgelesdias
  • drbeckert
  • uellner
  • mmarchini