Skip to content

Instantly share code, notes, and snippets.

@WallysonGalvao
Last active June 19, 2020 17:55
Show Gist options
  • Save WallysonGalvao/d83bf7450e4103ae5ed62fab4160d046 to your computer and use it in GitHub Desktop.
Save WallysonGalvao/d83bf7450e4103ae5ed62fab4160d046 to your computer and use it in GitHub Desktop.
Marvelapp
import React from "react";
import { StyleSheet, Text, View } from "react-native";
// Importação de componente de loading do Expo
import { AppLoading } from "expo";
// Importação da biblioteca expo-font
import { useFonts } from "@use-expo/font";
export default function App() {
// Carregamentos das fontes no diretório ./assets/fonts
const [fontsLoaded] = useFonts({
"gilroy-bold": require("./assets/fonts/gilroy-bold.ttf"),
"gilroy-heavy": require("./assets/fonts/gilroy-heavy.ttf"),
"gilroy-medium": require("./assets/fonts/gilroy-medium.ttf"),
"gilroy-regular": require("./assets/fonts/gilroy-regular.ttf"),
"gilroy-semibold": require("./assets/fonts/gilroy-semibold.ttf"),
});
// Caso nossas fontes ainda não tenham sido carregadas é mostrada uma tela
// de loading
if (!fontsLoaded) return <AppLoading />;
return (
<View style={styles.container}>
{/* Adicionamos o styles ao componente Text */}
<Text style={styles.text}>
Open up App.tsx to start working on your app!
</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
// Carregamento da fonte no CSS
text: {
fontFamily: "gilroy-semibold",
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment