Skip to content

Instantly share code, notes, and snippets.

View aguscha333's full-sized avatar
🇺🇾

Agustina Chaer aguscha333

🇺🇾
View GitHub Profile
@aguscha333
aguscha333 / react-native-font-system-code-usage.js
Last active June 1, 2021 20:18
React Native Font System Code Usage
// MyCustomScreen.js
import { TouchableOpacity } from 'react-native';
import Text from '..(relative_path)/components/Text';
const MyCustomScreen = () => (
<>
<Text as="H1">This is the main title</Text>
<Text as="H2">This a secondary title</Text>
@aguscha333
aguscha333 / react-native-font-system-code.js
Last active June 1, 2021 20:39
React Native Font System Code
// constants/fonts.js
/*
Define font constants so they are easy to refactor
if you need to change your pimary font
*/
export const PRIMARY_FONT_REGULAR = 'NunitoSans-Regular';
export const PRIMARY_FONT_SEMI = 'NunitoSans-SemiBold';
export const PRIMARY_FONT_BOLD = 'NunitoSans-Bold';
@aguscha333
aguscha333 / AnimatedViewWithHook.js
Created June 2, 2020 14:17
Animation example with useAnimate
import React, {useEffect, useRef} from 'react';
import {View, Animated} from 'react-native';
import useAnimate from 'hooks/useAnimate';
const AnimatedView = () => {
const animatedOpacity = useAnimate({
// fromValue: 0, (default)
// toValue: 1, (default)
duration: 1000,
});