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 books = [ | |
{ | |
id: '1', | |
title: 'Harry Potter', | |
author: 'J.K. Rowling', | |
imageUrl: 'https://upload.wikimedia.org/wikipedia/en/6/6b/Harry_Potter_and_the_Philosopher%27s_Stone_Book_Cover.jpg', | |
}, | |
{ | |
id: '2', | |
title: 'The Hobbit', |
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 { View, Text, ScrollView, Pressable, StyleSheet, Alert } from "react-native"; | |
const products = [ | |
{ id: 1, name: "Apple", price: 1 }, | |
{ id: 2, name: "Banana", price: 2 }, | |
{ id: 3, name: "Orange", price: 3 }, | |
{ id: 4, name: "Grapes", price: 4 }, | |
{ id: 5, name: "Mango", price: 5 }, | |
]; |
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 styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#F5F5F5', | |
}, | |
listContent: { | |
padding: 16, | |
}, | |
card: { | |
backgroundColor: '#fff', |
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 animalsData = [ | |
{ | |
id: '1', | |
name: 'Lion', | |
imageUrl: 'https://images.unsplash.com/photo-1546182990-dffeafbe841d?w=400', | |
description: 'Known as the king of the jungle, lions are powerful carnivores that live in prides across African savannas.' | |
}, | |
{ | |
id: '2', | |
name: 'Elephant', |
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 { FlatList, Image, StyleSheet, Text, View, TouchableOpacity, Alert, Platform, } from 'react-native'; | |
import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context'; | |
import animalsData from '../constants/Data'; | |
const AnimalList = () => { | |
const handlePress = (item) => { | |
const message = `You clicked on "${item.name}"`; | |
Platform.OS === 'web' | |
? window.alert(message) |
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 Colors = { | |
primary: "#6849a7", | |
warning: "#cc475a", | |
dark: { | |
text: "#d4d4d4", | |
title: "#fff", | |
background: "#252231", | |
navBackground: "#201e2b", | |
iconColor: "#9591a5", |