This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {useTheme} from '@react-navigation/native'; | |
import {ProgressChart} from 'react-native-chart-kit'; | |
import {MyThemeInterfaceColors, getPercentageInHex} from '_utils'; | |
import {useComponentTrackTrace} from '_hooks'; | |
interface ShowProgressProps { | |
progress: number; | |
height?: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type OneRequiredOneOptional = | |
| {desiredWidth: number; desiredHeight?: number} | |
| {desiredWidth?: number; desiredHeight: number}; | |
interface CommonProps { | |
widthReadFromImage: number; | |
heightReadFromImage: number; | |
} | |
type FullProps = CommonProps & OneRequiredOneOptional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const cheerio = require('cheerio'); | |
const baseUrl = 'https://www.infomerlo.com'; | |
const urlToScrap = baseUrl + '/noticias'; | |
const numberOfFirstElementsToScrap = 10; | |
axios(urlToScrap) | |
.then(response => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const addObjectsToArrayIfIdNotExists = ( | |
baseArray: any[], | |
objects: any[], | |
): any[] => { | |
objects.forEach(obj1 => { | |
if (!baseArray.find(obj2 => obj2.id === obj1.id)) { | |
baseArray.push(obj1); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect, useImperativeHandle, useState} from 'react'; | |
import {Keyboard, View} from 'react-native'; | |
import {useTheme} from '@react-navigation/native'; | |
import {useSpring, animated} from '@react-spring/native'; | |
import {MyThemeInterfaceColors} from '_styles'; | |
import {GetDimensions} from '_atoms'; | |
import {MultilineTextInput, Button, TextInputRef} from '_molecules'; | |
import {getPercentageInHex, themedStyleSheet} from '_utils'; | |
import {usePrevious} from '_hooks'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react" | |
import { View, ViewProps } from "react-native" | |
interface ContainerWithDimensionsProps { | |
children: ({ | |
width, | |
height | |
}: { | |
width: number | |
height: number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const stringifyWithCustomDepth = (obj: any, depth = 1): string => { | |
return !obj | |
? JSON.stringify(obj, null, 2) | |
: typeof obj === 'object' | |
? JSON.stringify( | |
JSON.parse( | |
depth < 1 | |
? '"???"' | |
: `{${Object.keys(obj) | |
.map((k) => `"${k}": ${stringifyWithCustomDepth(obj[k], depth - 1)}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable react/no-array-index-key */ | |
import React, {ReactNode} from 'react'; | |
import {SafeAreaView, View} from 'react-native'; | |
import {withTheme} from '../../Elements'; | |
import {baseTheme, darkTheme, PuraMenteTheme} from '../../../styles/base'; | |
import {makeStyles} from '../../Utils/MakeStylesHoc'; | |
interface CTAWithFadingProps { | |
theme: PuraMenteTheme; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect} from 'react'; | |
import {Keyboard} from 'react-native'; | |
const KeyboardListener: React.FC<{ | |
onDidShow: (e: any) => void; | |
onDidHide: (e: any) => void; | |
}> = ({onDidShow, onDidHide}) => { | |
useEffect(() => { | |
if (onDidShow) Keyboard.addListener('keyboardDidShow', onDidShow); | |
if (onDidHide) Keyboard.addListener('keyboardDidHide', onDidHide); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {PixelRatio, Platform} from 'react-native'; | |
type fontScales = -3 | -2 | -1 | 0 | 1 | 2 | 3; | |
type iOS_fontScales = '0.823' | '0.882' | '0.941' | '1' | '1.118' | '1.235' | '1.353'; | |
type iOS_fontScalesMap<T> = {[scale in iOS_fontScales]: T}; | |
const fontScale_iOS: iOS_fontScalesMap<number> = { | |
'0.823': -3, | |
'0.882': -2, | |
'0.941': -1, |