Skip to content

Commit 57b7c61

Browse files
committed
Agrega Practica 2 y 3: Componente Alumno y lista dinamica
1 parent 5ebab55 commit 57b7c61

File tree

11 files changed

+9292
-0
lines changed

11 files changed

+9292
-0
lines changed

hola-mundo/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# generated native folders
40+
/ios
41+
/android

hola-mundo/App.js

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
// CORRECCIÓN: SafeAreaView ahora viene de react-native
3+
import { StyleSheet, Text, View, ScrollView, SafeAreaView } from 'react-native';
4+
import { useState } from 'react';
5+
// Asegúrate de que esta ruta apunte a tu carpeta src
6+
import Alumno from './src/components/Alumno';
7+
8+
export default function App() {
9+
const alumnos = [
10+
// ... (Aquí va toda la lista de alumnos que mandó tu maestra) ...
11+
{ nombre: 'CANDELARIA MORA SAMANTHA', matricula: '2114354' },
12+
{ nombre: 'CANTU SILVA JAVIER', matricula: '2111889' },
13+
{
14+
nombre: 'CARMONA LOZANO ANGEL EMILIANO',
15+
matricula: '2069119'
16+
},
17+
{
18+
nombre: 'CASTILLO ACOSTA JORGE',
19+
matricula: '2132842'
20+
},
21+
{
22+
nombre: 'DAVILA GONZALEZ ALDO ADRIAN',
23+
matricula: '1994122'
24+
},
25+
{
26+
nombre: 'DURAN BARRIENTOS FABRIZIO',
27+
matricula: '2018230'
28+
},
29+
{
30+
nombre: 'FLORES GONZALEZ SEBASTIAN',
31+
matricula: '2104564'
32+
},
33+
{
34+
nombre: 'DURAN BARRIENTOS FABRIZIO',
35+
matricula: '2018230'
36+
},
37+
{
38+
nombre: 'FLORES GONZALEZ SEBASTIAN',
39+
matricula: '2104564'
40+
},
41+
{
42+
nombre: 'FLORES LÓPEZ DIEGO',
43+
matricula: '2066033'
44+
},
45+
{
46+
nombre: 'FLORES MARTINEZ ERICK ADRIAN',
47+
matricula: '2132976'
48+
},
49+
{
50+
nombre: 'GARZA AVALOS DIEGO',
51+
matricula: '2066114'
52+
},
53+
{
54+
nombre: 'GONZALEZ OVALLE CHRISTIAN GABRIEL',
55+
matricula: '2031243'
56+
},
57+
{
58+
nombre: 'GRANJA PEÑA DIEGO',
59+
matricula: '2064733'
60+
},
61+
{
62+
nombre: 'IBARRA RODRIGUEZ ALEXIS',
63+
matricula: '2031243'
64+
},
65+
{
66+
nombre: 'MARTINEZ ELIAS ANGEL SEBASTIAN',
67+
matricula: '2064733'
68+
},
69+
{
70+
nombre: 'MENDIETA GONZALEZ ESMERALDA GABRIELA',
71+
matricula: '2094647'
72+
},
73+
{
74+
nombre: 'MIRELES VELAZQUEZ ALEJANDRO',
75+
matricula: '2005102'
76+
},
77+
{
78+
nombre: 'MONSIVAIS SALAZAR ANDRES',
79+
matricula: '2064574'
80+
},
81+
{
82+
nombre: 'PARRAZALEZ VALDESPINO MARTHA JULIETA',
83+
matricula: '2024783'
84+
},
85+
{
86+
nombre: 'PEÑA MUNGARRO LUIS ANGEL',
87+
matricula: '2066077'
88+
},
89+
{
90+
nombre: 'PUENTE REYNOSO JULIO CESAR',
91+
matricula: '2092151'
92+
},
93+
{
94+
nombre: 'RAMIREZ LOPEZ BRYAN',
95+
matricula: '2103708'
96+
},
97+
{
98+
nombre: 'RAMOS AVILA LILIANA VALERIA',
99+
matricula: '2115192'
100+
},
101+
{
102+
nombre: 'RICO JAUREGUI MAURICIO',
103+
matricula: '2037503'
104+
},
105+
{
106+
nombre: 'RIVERA LUNA ADRIAN',
107+
matricula: '2131513'
108+
},
109+
{
110+
nombre: 'RIVERA REYNA JOSE EMILIO',
111+
matricula: '2013503'
112+
},
113+
{
114+
nombre: 'RODRIGUEZ OLVERA ROSA ISELA',
115+
matricula: '2004613'
116+
},
117+
{
118+
nombre: 'RODRIGUEZ RODRIGUEZ ANGEL AZAEL',
119+
matricula: '2133022'
120+
},
121+
{
122+
nombre: 'SANCHEZ GALARZA JUAN CARLOS',
123+
matricula: '2026061'
124+
},
125+
{
126+
nombre: 'SOLIS ORTIZ ALFREDO',
127+
matricula: '2095320'
128+
},
129+
{
130+
nombre: 'VELAZQUEZ ABREGO HERWIN DANIEL',
131+
matricula: '2025350'
132+
},
133+
{
134+
nombre: 'VILLAGRA RODRIGUEZ ANDRES NEHUEL',
135+
matricula: '2103895'
136+
},
137+
{
138+
nombre: 'ZACATENCO OLIVE RODRIGO',
139+
matricula: '1857791'
140+
},
141+
{
142+
nombre: 'ZAVALA CANTU TERESA MARGARITA',
143+
matricula: '2025218'
144+
}
145+
];
146+
147+
// Funcionalidad del Botón
148+
const [mensaje, setMensaje] = useState('Toca un botón para saludar');
149+
150+
// Modificamos la función para que reciba el nombre del alumno
151+
const saludo = (nombreDelAlumno) => {
152+
setMensaje('Hola, ' + nombreDelAlumno);
153+
};
154+
155+
return (
156+
<SafeAreaView style={estilos.container}>
157+
<StatusBar style="auto" />
158+
159+
{/* Aquí mostramos el estado dinámico */}
160+
<View style={estilos.header}>
161+
<Text style={estilos.textoMensaje}>{mensaje}</Text>
162+
</View>
163+
164+
<ScrollView contentContainerStyle={estilos.contenido}>
165+
{alumnos.map((alumno, index) =>
166+
(
167+
<Alumno
168+
key={index} // Usamos index para evitar el error de matrículas duplicadas
169+
nombre={alumno.nombre}
170+
matricula={alumno.matricula}
171+
// Le mandamos la función "saludo" al componente Alumno
172+
accionBoton={() => saludo(alumno.nombre)}
173+
/>
174+
)
175+
)}
176+
</ScrollView>
177+
</SafeAreaView>
178+
)
179+
}
180+
181+
const estilos = StyleSheet.create({
182+
container: {
183+
flex: 1,
184+
backgroundColor: '#fff',
185+
paddingTop: 40,
186+
},
187+
header: {
188+
backgroundColor: '#c1121f',
189+
padding: 20,
190+
alignItems: 'center',
191+
},
192+
textoMensaje: {
193+
color: '#fff',
194+
fontSize: 18,
195+
fontWeight: 'bold',
196+
},
197+
contenido: {
198+
paddingBottom: 20,
199+
}
200+
});

hola-mundo/app.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"expo": {
3+
"name": "hola-mundo",
4+
"slug": "hola-mundo",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"newArchEnabled": true,
10+
"splash": {
11+
"image": "./assets/splash-icon.png",
12+
"resizeMode": "contain",
13+
"backgroundColor": "#ffffff"
14+
},
15+
"ios": {
16+
"supportsTablet": true
17+
},
18+
"android": {
19+
"adaptiveIcon": {
20+
"foregroundImage": "./assets/adaptive-icon.png",
21+
"backgroundColor": "#ffffff"
22+
},
23+
"edgeToEdgeEnabled": true
24+
},
25+
"web": {
26+
"favicon": "./assets/favicon.png"
27+
}
28+
}
29+
}
17.1 KB
Loading

hola-mundo/assets/favicon.png

1.43 KB
Loading

hola-mundo/assets/icon.png

21.9 KB
Loading

hola-mundo/assets/splash-icon.png

17.1 KB
Loading

hola-mundo/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { registerRootComponent } from 'expo';
2+
3+
import App from './App';
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that whether you load the app in Expo Go or in a native build,
7+
// the environment is set up appropriately
8+
registerRootComponent(App);

0 commit comments

Comments
 (0)