Skip to content

Instantly share code, notes, and snippets.

View risardi123's full-sized avatar
🐻‍❄️
I may be slow to respond.

Xeanorm risardi123

🐻‍❄️
I may be slow to respond.
View GitHub Profile
const delimiterNumberOnInput = (value, comma) => {
let number = value
if (number.charAt(0) === ",") {
number = ""
} else if (parseFloat(number) === 0 && number.charAt(1) !== ",") {
number = "0"
} else if (number.charAt(0) === "0") {
if (!(number.charAt(1) === ",")) {
number = number.charAt(1)
}
@risardi123
risardi123 / App.js
Last active December 11, 2020 08:41
Animated - status bar height
import React, { useRef, useEffect } from 'react';
import PropTypes from 'prop-types';
import { View, Text, StyleSheet, Animated, StatusBar } from 'react-native';
const HEADER_MAX_HEIGHT = 100;
const HEADER_MIN_HEIGHT = 35;
const HEADER_SCROLL_DISTANCE = HEADER_MAX_HEIGHT - HEADER_MIN_HEIGHT;
const styles = StyleSheet.create({
fill: {
import * as React from 'react';
import { Text, View} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import {createStackNavigator} from '@react-navigation/stack';
const HomeScreen = (props) =>
{
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>