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 { StatusBar, Text } from "react-native"; | |
import { AppLoading } from "expo"; | |
import { useFonts } from "@use-expo/font"; | |
// Importação do arquivo de rotas | |
import Routes from "./src/routes"; | |
export default function App() { | |
const [fontsLoaded] = useFonts({ |
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, useEffect } from "react"; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
ScrollView, | |
TouchableOpacity, | |
} from "react-native"; | |
import Constants from "expo-constants"; | |
import { LinearGradient } from "expo-linear-gradient"; |
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
{/* | |
O método onPress será o responsável pela navegação da página Home | |
para a página Deail, também estamos enviando como paramêtro um objeto | |
chamado character, que contém todas as informações do personagem. | |
*/} | |
<ScrollView horizontal showsHorizontalScrollIndicator={false}> | |
{characters | |
.filter((character) => character.category === "heroes") | |
.map((character) => ( |
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 { StyleSheet, View, Text } from "react-native"; | |
const Detail = () => { | |
return ( | |
<View style={styles.container}> | |
<Text>Detail</Text> | |
</View> | |
); | |
}; |
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 { NavigationContainer } from "@react-navigation/native"; | |
import { createStackNavigator } from "@react-navigation/stack"; | |
import Home from "./pages/Home"; | |
// Criar a pasta Detail com um arquivo index.tsx dentro dela | |
import Detail from "./pages/Detail"; | |
const AppStack = createStackNavigator(); |
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, useEffect } from "react"; | |
import { StyleSheet, View, Text, ScrollView } from "react-native"; | |
import Constants from "expo-constants"; | |
import { LinearGradient } from "expo-linear-gradient"; | |
import Section from "../../components/Section"; | |
import Card from "../../components/Card"; | |
import Menu from "../../assets/icons/menu.svg"; | |
import Logo from "../../assets/icons/logo.svg"; |
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, useEffect } from "react"; | |
import { StyleSheet, View, Text, ScrollView } from "react-native"; | |
import Constants from "expo-constants"; | |
import { LinearGradient } from "expo-linear-gradient"; | |
import Section from "../../components/Section"; | |
import Card from "../../components/Card"; | |
import Menu from "../../assets/icons/menu.svg"; | |
import Logo from "../../assets/icons/logo.svg"; |
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
// Adicionar o useState e useEffect | |
import React, { useState, useEffect } from "react"; | |
import { StyleSheet, View, Text, ScrollView } from "react-native"; | |
import Constants from "expo-constants"; | |
import { LinearGradient } from "expo-linear-gradient"; | |
import Menu from "../../assets/icons/menu.svg"; | |
import Logo from "../../assets/icons/logo.svg"; | |
import Search from "../../assets/icons/search.svg"; |
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 { StyleSheet, View, Text, Image } from "react-native"; | |
interface ICharacter { | |
name: string; | |
alterEgo: string; | |
imagePath: string; | |
} | |
const Card: React.FC<ICharacter> = ({ name, alterEgo, imagePath }) => { |
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 { StyleSheet, View, Text, Image } from "react-native"; | |
import SpiderMan from "../../assets/chars/spider-man.png"; | |
import { thumbnails } from "../../assets/folders"; | |
interface ICharacter { | |
name: string; | |
alterEgo: string; |