0.0.2 • Published 3 years ago

@sekizlipenguen/react-native-helpers v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-helpers

IMAGE HELPERS

npm.io

Pre-required modules;

yarn add react-native-fast-image

Example SPFastImage loading + auto height

const [time, setTime] = useState(Date.now());
    
<SPFastImage
source={{uri: 'https://www.gstatic.com/webp/gallery/5.jpg?t=' + time}}
width={200}
/>

Example SPFastImage loading(width,height)

<SPFastImage
    source={{uri: 'https://www.gstatic.com/webp/gallery/5.jpg?t=' + time}}
    style={{
        borderRadius: 15,
        height: 200,
        width: 200,
    }}
    resizeMode={'cover'}
/>

Example SPFastImage loading(aspectRatio)

<SPFastImage
    source={{uri: 'https://www.gstatic.com/webp/gallery/5.jpg?t=' + time}}
    style={{
        borderRadius: 15,
        aspectRatio: 375 / 300 // or 4/3 or 4/4
    }}
    resizeMode={'cover'}
/>

Example SPImageBackground

npm.io

<SPImageBackground
    style={{flex: 1}} source={{uri: 'https://www.gstatic.com/webp/gallery/5.jpg?t=' + time}}
    resizeMode={'cover'}
>
  children
</SPImageBackground>

BasicTimer

npm.io

<BasicTimer duration={10} complete={() => alert('completed')}>
    {
        (time) => (
            <Text>{time} seconds</Text>
        )
    }
</BasicTimer>

GLOBAL HELPERS

KeyTypeDescription
screenWidthfunctionscreen Width
screenHeightfunctionscreen Height