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

0.0.24 • 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');

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.2415latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.2415
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i sthima-native

Weekly Downloads

15

Version

0.0.24

License

ISC

Unpacked Size

37.3 kB

Total Files

38

Last publish

Collaborators

  • npm
  • sthima2
  • uellner