Implementación de la pantalla de Guardias, junto a la vista con la descripción;…

Implementación de la pantalla de Guardias, junto a la vista con la descripción; Desarrollo del modal de cierre de sesión
parent 4528f5da
Showing with 2141 additions and 108 deletions
import * as React from 'react';
import { View, Modal, ScrollView, TextInput, StyleSheet, Alert, Image, TouchableOpacity, Text } from 'react-native';
import { DefaultTheme, NavigationContainer, StackActions } from '@react-navigation/native';
import { View, Modal, ScrollView, TextInput, StyleSheet, Image, TouchableOpacity, Text } from 'react-native';
import { StackActions } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { SafeAreaView } from 'react-native-safe-area-context';
import Perfil from './Perfil';
import Contraseña from './Contraseña';
const Stack = createNativeStackNavigator();
......@@ -16,13 +14,13 @@ const Stack = createNativeStackNavigator();
* @returns la siguiente vista o un modal dependiendo si las credenciales son correctas
*/
function ComprobacionAuth(userName, password, setM, navigation){
const jsonInicio = require('./inicio.json');
const jsonInicio = require('./assets/data/load/usuarios.json');
const data = jsonInicio[userName];
if(data){ // se comprueba si el usuario existe
if(jsonInicio[userName].Contraseña == password){ // se verifica si la contraseña corresponde
if(jsonInicio[userName].Password == password){ // se verifica si la contraseña se corresponde con el usuario registrado en la plataforma
return navigation.dispatch(
StackActions.replace('Perfil',{id: userName})
); // Modificar por la visualizacion de la vista principal
StackActions.replace('TabBar',{id: userName})
); // se navega al tabbar que es quien mantiene el resto de la navegacion
}else{
return setM(true);
}
......@@ -35,7 +33,7 @@ function ComprobacionAuth(userName, password, setM, navigation){
* @brief Presenta el contenido de la vista del Login
* @returns El contenido de la vista del Login
*/
function Inicio({navigation}) {
function App({navigation}) {
const [identificador, setIdentificador] = React.useState("");
const [pass, setPass] = React.useState("");
const [m, setM] = React.useState(false);
......@@ -56,14 +54,14 @@ function Inicio({navigation}) {
</Modal>
</View>
<View style={{justifyContent: 'center', alignItems: 'center', padding:'5%'}}>
<Image style={estilos.Logo} source={require('./img/logo.png')} />
<Image style={estilos.Logo} source={require('./assets/img/logo.png')} />
</View>
<View>
<TextInput style={estilos.EntradaTexto} placeholder = "Nombre de usuario" onChangeText={(valor) => setIdentificador(valor)} ></TextInput>
<TextInput secureTextEntry={true} style={estilos.EntradaTexto} placeholder = "Contraseña" onChangeText={(valor) => setPass(valor)}></TextInput>
</View>
<TouchableOpacity style={estilos.Boton} onPress={() => ComprobacionAuth(identificador, pass, setM, navigation)}>
<Text style={{color:'white', fontWeight: 'bold'}}>INICIAR SESIÓN</Text>
<Text style={{color:'white', fontWeight: 'bold', fontSize:15}}>INICIAR SESIÓN</Text>
</TouchableOpacity>
</SafeAreaView>
</ScrollView>
......@@ -71,38 +69,13 @@ function Inicio({navigation}) {
);
}
/**
* @brief Presenta la barra de navegacion del Login, junto con el contenido de la vista
* @returns La vista completa del Login
*/
function App() {
const ref = React.useRef(null);
const tema = DefaultTheme;
tema.colors.background = 'white';
return (
<View style={{ flex: 1 }}>
<NavigationContainer ref={ref}>
<Stack.Navigator initialRouteName="Inicio">
<Stack.Screen name="Inicio de sesión" component={Inicio}
options={{ headerStyle:{ backgroundColor: '#7D9BFF' }, headerTitleStyle: {
color: 'white'
}}} />
<Stack.Screen name="Perfil" component={Perfil} options={{"headerShown": false}}></Stack.Screen>
<Stack.Screen name="Contraseña" component={Contraseña} options={{ headerTintColor:"white", headerStyle:{ backgroundColor: '#7D9BFF' }}}></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
</View>
);
}
/**
* @brief Mantiene todos los estilos aplicados a la vista del Login
*/
// Conjunto de estilos empleados en la vista del Login
const estilos = StyleSheet.create({
EntradaTexto: {
borderBottomWidth: 1,
borderBottomColor: "#B5B2B2",
padding: 15,
paddingBottom: 15,
},
ContenedorTexto:{
padding: 18,
......
import React from "react";
import { StyleSheet, View, Text, ScrollView } from "react-native";
/**
* Funcion que muestra la descripcion de la guardia seleccionada
* @param navigation propiedad que permite la navegacion entre vistas
* @param route propiedad con la que se puede acceder a los atributos pasados entre vistas
* @returns vista con la descripcion de la guardia indicando las actividades a realizar para ese dia
*/
function DescripcionGuardia({navigation, route}){
React.useEffect (() => {
navigation.setOptions({title: "Guardia: " + route.params.cl});
})
const tareas = route.params.t.map((tarea) =>
tarea + "\n\n"
)
return(
<ScrollView style={styles.contenedor}>
<View style={{flex: 1}}>
<Text style = {styles.tituloSeccion}>Día de la guardia</Text>
<View style={[styles.separador, {marginRight: 20}]} />
<View style={styles.contenedorSeccion}>
<View style={styles.contenidoSeccion}>
<Text style = {styles.textoSeccion}>
{route.params.fec}
</Text>
</View>
</View>
<Text style = {styles.tituloSeccion}>Hora de la guardia</Text>
<View style={[styles.separador, {marginRight: 20}]} />
<View style={styles.contenedorSeccion}>
<View style={styles.contenidoSeccion}>
<Text style = {styles.textoSeccion}>
{route.params.horaIni} - {route.params.horaF}
</Text>
</View>
</View>
<Text style = {styles.tituloSeccion}>Tareas a realizar</Text>
<View style={[styles.separador, {marginRight: 20}]}/>
<View style={styles.contenedorSeccion}>
<View style={styles.contenidoSeccion}>
{tareas.length != 0 ?
<Text style = {styles.textoSeccion}>{tareas}</Text>:
<Text style = {styles.textoSeccion}>No hay ninguna actividad por realizar</Text>
}
</View>
</View>
</View>
</ScrollView>
);
}
// Conjunto de estilos empleados en la vista de la descripcion de la guardia
const styles = StyleSheet.create({
contenedor: {
marginTop: 10,
marginLeft: 20
},
contenedorSeccion: {
flexDirection: 'row',
justifyContent: 'center',
marginTop: 12,
marginBottom: 26,
paddingLeft: 20
},
contenidoSeccion: {
width: '94%',
paddingRight: 50
},
tituloSeccion: {
fontSize: 15,
color: '#1f2d3d',
marginBottom: 2.5
},
textoSeccion: {
fontSize: 15,
color: '#8492A6',
marginBottom: 2.5
},
separador: {
paddingBottom: 2.5,
borderBottomWidth: StyleSheet.hairlineWidth,
borderBottomColor: '#C0CCDA'
}
})
export default DescripcionGuardia;
\ No newline at end of file
import React, {Component} from 'react';
import {Text, View, SafeAreaView, Image, StyleSheet, ScrollView, TouchableOpacity} from 'react-native';
const meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]
const diasSemana = ["Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"]
class Guardias extends Component {
// Mantiene el estado de las variables de la vista
state = {
fechaAgrupar: ""
}
// Constructor
constructor(props) {
super(props)
}
/**
* Función que comprueba si una guardia está agrupada dentro de la fecha actual
* @param dateReserva fecha de la guardia (dia, mes y año)
* @param fechaActual fecha actual
*/
ComprobarFecha (dateReserva, fechaActual) {
if ((dateReserva.getDate() + dateReserva.getMonth() + dateReserva.getFullYear()) != this.state.fechaAgrupar) {
this.state.fechaAgrupar = dateReserva.getDate() + dateReserva.getMonth() + dateReserva.getFullYear()
return (
<View>
{/*Se comprueba si la fecha de la guardia coincide con el día actual*/}
<View>
{dateReserva.getDate() == fechaActual.getDate() && dateReserva.getMonth() == fechaActual.getMonth() && dateReserva.getFullYear() == fechaActual.getFullYear() ?
<Text style={estilos.tituloSeccion}>Hoy, {diasSemana[dateReserva.getDay()]}, {dateReserva.getDate()} de {meses[dateReserva.getMonth()]} de {dateReserva.getFullYear()}</Text>:
<Text style={estilos.tituloSeccion}>{diasSemana[dateReserva.getDay()]}, {dateReserva.getDate()} de {meses[dateReserva.getMonth()]} de {dateReserva.getFullYear()}</Text>}
{/* Se dibuja una línea horizontal */}
</View>
<View style={estilos.separador}></View>
</View>
);
}
return null;
}
/**
* Método que permite visualizar la lista de guardias
* @param horaInicio hora de inicio de la guardia
* @param horaFin hora de fin de la guardia
* @param clase nombre de la clase donde se situa la guardia
* @param tareas actividades que tienen que realizar los alumnos de la clase de guardia
* @param dateReserva fecha de la guardia
* @return vista con lista de guardias que tiene el usuario asignadas
*/
ListaGuardia (horaInicio, horaFin, clase, tareas, dateReserva) {
const fecha = dateReserva.getDate() + " de " + meses[dateReserva.getMonth()] + " de " + dateReserva.getFullYear()
return (
<View style={{flex: 1}}>
<View style={estilos.contenedorSeccion}>
{/* Visualización de la lista de guardias */}
<View style={estilos.contenidoSeccion}>
<Text style = {estilos.tituloSeccion}>
{clase}
</Text>
<Text style={estilos.textoSeccion}>Hora: {horaInicio} - {horaFin} </Text>
</View>
{/* Visualización del icono a partir del cual se puede mostrar la informacion de la guardia */}
<TouchableOpacity style={{alignSelf: 'center'}} onPress={()=> this.props.navigation.navigate('Guardia', {horaIni:horaInicio, horaF:horaFin, cl:clase, t: tareas, fec: fecha})}>
<Image style={estilos.iconoFlecha} source={require("./assets/img/icons/flechaAzul.png")}></Image>
</TouchableOpacity>
</View>
</View>
);
}
/**
* Método que permite comprobar si la fecha de la guardia es superior a la fecha actual
* @param id id de la guardia
* @param dia dia de la guardia
* @param mes mes de la guardia
* @param año año de la guardia
* @param fechaActual fecha actual
* @param horaInicio hora de inicio de la guardia
* @param horaFin hora de fin de la guardia
* @param clase nombre de la clase que esta de guardia
* @param tareas actividades que tiene que realizar el alumnado de la clase de guardia
*/
ComprobarFechaActual(id, dia, mes, año, fechaActual, horaInicio, horaFin, clase, tareas) {
const dateReserva = new Date(año, mes - 1, dia, 23, 59, 59)
if(dateReserva >= fechaActual) {
return (
<View style={{marginRight: 20}} key={id}>
{/* Los datos se supondrán que son obtenidos de manera ordenada por fecha */}
{this.ComprobarFecha(dateReserva, fechaActual)}
{/* Se carga la lista con las guardias */}
{this.ListaGuardia(horaInicio, horaFin, clase, tareas, dateReserva)}
</View>
);
}
return null;
}
// Método render
render() {
// se extraen los datos del json
const datosJson = require("./assets/data/load/listaGuardias.json")
const usuarios = require("./assets/data/load/usuarios.json")
const idGuardia = usuarios[this.props.route.params.id].idGuardias
// Se obtiene la fecha actual
const dateActual = new Date()
return (
<SafeAreaView style={{flex: 1}}>
<ScrollView style={estilos.margenLista}>
{/* Se comprueba si la fecha de la guardia es inferior a la fecha actual */}
{idGuardia.map((guardia) =>
this.ComprobarFechaActual(guardia, datosJson[guardia].dia, datosJson[guardia].mes, datosJson[guardia].año, dateActual, datosJson[guardia].horaInicio,
datosJson[guardia].horaFin, datosJson[guardia].clase, datosJson[guardia].tareas)
)}
</ScrollView>
</SafeAreaView>
);
}
}
// Conjunto de estilos empleados en la vista las guardias
const estilos = StyleSheet.create({
margenLista: {
marginTop: 10,
marginLeft: 20
},
tituloSeccion: {
fontSize: 14,
color: '#1f2d3d',
marginBottom: 2
},
separador: {
paddingBottom: 1,
borderBottomWidth: StyleSheet.hairlineWidth,
borderBottomColor: '#C0CCDA'
},
contenedorSeccion: {
flexDirection: 'row',
justifyContent: 'center',
marginTop: 12,
marginBottom: 26,
paddingLeft: 20
},
contenidoSeccion: {
width: '94%',
paddingRight: 50
},
textoSeccion: {
fontSize: 14,
color: "#8492A6"
},
iconoFlecha: {
width: 25,
height: 25,
}
});
export default Guardias;
\ No newline at end of file
import * as React from 'react';
import { DefaultTheme, NavigationContainer} from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Password from './Password';
import TabBar from './TabBar';
import App from './App';
import DescripcionGuardia from './DescripcionGuardia';
const Stack = createNativeStackNavigator();
/**
* @brief Funcion que mantiene las pantallas que forman parte de la navegacion de la aplicacion
* @returns la pantalla correspondiente en funcion del flujo de navegacion definido
*/
function Navegacion() {
const ref = React.useRef(null);
const tema = DefaultTheme;
tema.colors.background = 'white';
return (
<NavigationContainer ref={ref}>
<Stack.Navigator initialRouteName="App">
{/* Pantalla de inicio de sesion */}
<Stack.Screen name="Inicio de sesión" component={App}
options={{ headerStyle:{ backgroundColor: '#7D9BFF' }, headerTitleStyle: {
color: 'white'
}}} />
{/* Vista con el Tab Bar */}
<Stack.Screen name="TabBar" component={TabBar} options={{"headerShown": false}}/>
{/* Pantalla que permite modificar la contraseña */}
<Stack.Screen name="Contraseña" component={Password} options={{ headerTintColor:"white", headerStyle:{ backgroundColor: '#7D9BFF' }}}/>
{/* Pantalla que mantiene la descripcion de las guardias del usuario */}
<Stack.Screen name="Guardia" component={DescripcionGuardia} options={{ headerTintColor:"white", headerStyle:{ backgroundColor: '#7D9BFF' }}}/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default Navegacion;
\ No newline at end of file
import * as React from 'react';
import * as React from 'react';
import { View, Text, TextInput, StyleSheet, TouchableOpacity, Alert, Modal } from 'react-native';
import { View, Text, TextInput, StyleSheet, TouchableOpacity, Modal } from 'react-native';
function ComprobarContraseña(navigation, route, contr, nuevaContr, rNuevaContr, setModal, setTextModal){
const jsonInicio = require('./inicio.json');
if(jsonInicio[route.params.id].Contraseña == contr){
if(nuevaContr != contr){
/**
* @brief Funcion que verifica si los datos incluidos al modificar la contraseña estan correctos
* @param navigation propiedad que permite la navegacion entre vistas
* @param route propiedad con la que se puede acceder a los atributos pasados entre vistas
* @param contr atributo que contiene la contraseña actual del usuario
* @param nuevaContr variable que mantiene la nueva contraseña
* @param rNuevaContr variable que mantiene la nueva contraseña repetida
* @param setModal funcion que permite activar el modal
* @param setTextModal funcion que permite cambiar el texto mostrado en el modal
* @returns la visualizacion del modal o la pantalla del perfil
*/
function CheckPassword(navigation, route, contr, nuevaContr, rNuevaContr, setModal, setTextModal){
const jsonInicio = require('./assets/data/load/usuarios.json');
if(jsonInicio[route.params.id].Password == contr){ // se comprueba si la contraseña es la del usuario
if(nuevaContr != contr){ // se verifica que la nueva contraseña no es igual a la actual
// se comprueba si la contraseña repetida es igual a la nueva y estas no son nulas
if(nuevaContr == rNuevaContr && (nuevaContr != "" || rNuevaContr != "")){
return navigation.goBack();
}else{
setTextModal("La nueva contraseña no coincide o no se han introducido todos los campos.");
setTextModal("La contraseña no coincide o no se han introducido todos los campos.");
}
}else{
setTextModal("La nueva contraseña no puede ser como la actual.");
......@@ -19,42 +31,64 @@ function ComprobarContraseña(navigation, route, contr, nuevaContr, rNuevaContr,
setModal(true);
}
function Contraseña({navigation, route}){
/**
* @brief Modal que muestra el motivo por el que no se puede efectuar el cambio de contraseña
* @param props propiedades para poder mostrar, ocultar y mostrar la informacion del modal
* @returns vista con el modal informativo
*/
const Modales = (props) => {
return (
<Modal transparent={true} visible={props.modal} animationType={'fade'}>
<View style={estilos.CentrarModal}>
<View style={estilos.VistaModal}>
{/* Titulo del modal */}
<Text style={estilos.TituloModal}>Contraseña</Text>
{/* Cuerpo del modal */}
<Text style={estilos.TextoModal}>{props.textModal}</Text>
{/* Boton aceptar */}
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'flex-end'}}>
<TouchableOpacity onPress={()=>props.setModal(false)}>
<Text style={estilos.BotonAceptar}>ACEPTAR</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
/**
* @brief Funcion que mantiene la vista completa del cambio de contraseña
* @param navigation propiedad que permite la navegacion entre vistas
* @param route propiedad con la que se puede acceder a los atributos pasados entre vistas
* @returns la vista con los campos de texto para efectuar el cambio de contraseña
*/
function Password({navigation, route}){
const [contrAct, setContrAct] = React.useState("");
const [nuevaContr, setNuevaContr] = React.useState("");
const [rNuevaContr, setRNuevaContr] = React.useState("");
const [modal, setModal] = React.useState(false);
const [textModal, setTextModal] = React.useState("");
return(
<View style={{flex: 1, padding: 18}}>
<Modal transparent={true} visible={modal} animationType={'fade'}>
<View style={estilos.CentrarModal}>
<View style={estilos.VistaModal}>
<Text style={estilos.TituloModal}>Contraseña</Text>
<Text>{textModal}</Text>
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'flex-end'}}>
<TouchableOpacity onPress={()=>setModal(false)}>
<Text style={estilos.BotonAceptar}>ACEPTAR</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
<Modales modal={modal} textModal={textModal} setModal={setModal}/>
<View>
{/* Entradas de texto para realizar el cambio de contraseña*/}
<TextInput secureTextEntry={true} style={estilos.EntradaTexto} placeholder='Contraseña actual' onChangeText={(valor) => setContrAct(valor)}></TextInput>
<TextInput secureTextEntry={true} style={estilos.EntradaTexto} placeholder='Nueva contraseña' onChangeText={(valor) => setNuevaContr(valor)}></TextInput>
<TextInput secureTextEntry={true} style={estilos.EntradaTexto} placeholder='Repita la nueva contraseña' onChangeText={(valor) => setRNuevaContr(valor)}></TextInput>
</View>
{/* Boton para realizar el cambio de contraseña */}
<View style={{position: 'absolute', bottom: 25, width:'100%', alignSelf:'center'}}>
<TouchableOpacity style={estilos.Boton} onPress={() => ComprobarContraseña(navigation, route, contrAct, nuevaContr, rNuevaContr, setModal, setTextModal)}>
<Text style={{color:'white', fontWeight: 'bold'}}>CONFIRMAR</Text>
<TouchableOpacity style={estilos.Boton} onPress={() => CheckPassword(navigation, route, contrAct, nuevaContr, rNuevaContr, setModal, setTextModal)}>
<Text style={{color:'white', fontWeight: 'bold', fontSize:15}}>CONFIRMAR</Text>
</TouchableOpacity>
</View>
</View>
);
}
// Conjunto de estilos empleados en la vista del cambio de contraseña
const estilos = StyleSheet.create({
Boton:{
......@@ -69,7 +103,8 @@ const estilos = StyleSheet.create({
borderBottomWidth: 1,
borderBottomColor: "#B5B2B2",
paddingBottom: 1,
paddingTop:30
paddingTop:30,
fontSize:16
},
CentrarModal: {
flex: 1,
......@@ -96,7 +131,8 @@ const estilos = StyleSheet.create({
BotonAceptar: {
marginTop: 25,
textAlign: "left",
color:"#47525E"
color:"#47525E",
fontSize:15
},
BotonCancelar:{
marginTop: 25,
......@@ -104,15 +140,16 @@ const estilos = StyleSheet.create({
color:"#FF676A"
},
TextoModal: {
color:"#47525E"
color:"#47525E",
fontSize:16
},
TituloModal:{
fontWeight:"bold",
color:"#47525E",
fontSize:20,
fontSize:21,
paddingBottom:25
}
}
)
export default Contraseña;
\ No newline at end of file
export default Password;
\ No newline at end of file
import * as React from 'react';
import { View, Text, Image, StyleSheet, TouchableOpacity, Modal, TextInput, ScrollView } from 'react-native';
// Mapa que mantiene el conjunto de imagenes empleadas en la aplicacion
const imagenes = {
vacio: require('./img/profile.png')
vacio: require('./assets/img/photoprofiles/profile.png')
}
/**
* @brief Modal para permitir el cambio de numero de telefono
* @param props propiedades necesarias para mostrar u ocultar el modal
* @returns vista con el modal del cambio de contraseña
*/
const CambioTelefono = (props) => {
return(<View style={estilos.CentrarModal}>
<Modal transparent={true} visible={props.modal} animationType={'fade'}>
<View style={estilos.CentrarModal}>
<View style={estilos.VistaModal}>
{/* Titulo del modal */}
<Text style={[estilos.TituloModal, {marginTop:7}]}>Modificar teléfono</Text>
{/* Campo de texto */}
<TextInput style={estilos.EntradaTexto} keyboardType="number-pad" placeholder="Nuevo teléfono"></TextInput>
{/* Botones del modal */}
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'flex-end'}}>
<TouchableOpacity onPress={()=>props.setModal(false)}>
<Text style={estilos.BotonAceptar}>ACEPTAR</Text>
</TouchableOpacity>
<TouchableOpacity style= {{paddingLeft:15}} onPress={()=>props.setModal(false)}>
<Text style={estilos.BotonCancelar}>CANCELAR</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
</View>
);
}
/**
* @brief Modal presentado en el momento de cerrar la sesion activa
* @param props propiedades necesarias para mostrar u ocultar el modal
* @returns vista con el modal de confirmacion del cierre de sesion
*/
const CloseSession = (props) => {
return(
<Modal transparent={true} visible={props.modalS} animationType={'fade'}>
<View style={estilos.CentrarModal}>
<View style={estilos.VistaModal}>
{/* Titulo del modal */}
<Text style={estilos.TituloModal}>
<Image style={{width:36, height:36}} source={require("./assets/img/icons/advertencia.png")}></Image>
{'\t'}Cerrar sesión
</Text>
{/* Cuerpo del modal */}
<Text style={estilos.TextoModal}>¿Está seguro que desea cerrar la sesión activa?</Text>
{/* Botones del modal */}
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'flex-end'}}>
<TouchableOpacity onPress={()=>props.navigation.reset({index: 0, routes: [{name: 'Inicio de sesión'},],})}>
<Text style={estilos.BotonAceptar}>ACEPTAR</Text>
</TouchableOpacity>
<TouchableOpacity style= {{paddingLeft:15}} onPress={()=>props.setModalS(false)}>
<Text style={estilos.BotonCancelar}>CANCELAR</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
);
}
/**
* @brief Funcion que mantiene la vista del perfil de usuario
* @param navigation propiedad que permite la navegacion entre vistas
* @param route propiedad con la que se puede acceder a los atributos pasados entre vistas
* @returns vista con la informacion del perfil de usuario
*/
function Perfil({navigation, route}){
const jsonInicio = require('./inicio.json');
const jsonInicio = require('./assets/data/load/usuarios.json');
const [modal, setModal] = React.useState(false);
const [modalS, setModalS] = React.useState(false);
return(
<ScrollView>
<View style={{padding: 18}}>
<View style={estilos.CentrarModal}>
<Modal transparent={true} visible={modal} animationType={'fade'}>
<View style={estilos.CentrarModal}>
<View style={estilos.VistaModal}>
<Text style={estilos.TituloModal}>Modificar teléfono</Text>
<TextInput style={estilos.EntradaTexto} keyboardType="number-pad" placeholder="Nuevo teléfono"></TextInput>
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'flex-end'}}>
<TouchableOpacity onPress={()=>setModal(false)}>
<Text style={estilos.BotonAceptar}>ACEPTAR</Text>
</TouchableOpacity>
<TouchableOpacity style= {{paddingLeft:15}} onPress={()=>setModal(false)}>
<Text style={estilos.BotonCancelar}>CANCELAR</Text>
</TouchableOpacity>
</View>
</View>
</View>
</Modal>
</View>
{/* Modales */}
<CambioTelefono modal={modal} setModal={setModal} />
<CloseSession modalS={modalS} setModalS={setModalS} navigation={navigation} />
{/* Imagen de perfil */}
<View style={estilos.ContenedorLogo}>
<Image style={estilos.Logo} source={imagenes[jsonInicio[route.params.id].ImagenPerfil]} />
<Text style={estilos.Nombre}>{jsonInicio[route.params.id].Nombre}</Text>
<Text style={estilos.Nombre}>{jsonInicio[route.params.id].Nombre} {jsonInicio[route.params.id].Apellidos}</Text>
</View>
{/* Correo electronico */}
<View style={estilos.ContenedorElemento}>
<Text style={estilos.TituloLista}>Email</Text>
<Text>{jsonInicio[route.params.id].Correo}</Text>
</View>
{/* Telefono del usuario */}
<View style={estilos.ContenedorElemento}>
<View style={estilos.contenedor}>
<View>
<Text style={estilos.TituloLista}>Teléfono</Text>
<Text>{jsonInicio[route.params.id].Teléfono}</Text>
<Text>{jsonInicio[route.params.id].Telefono}</Text>
</View>
<TouchableOpacity onPress={() => setModal(true)}>
<Image style={{height:20, width:20}} source={require('./img/editar.png')} />
<Image style={{height:20, width:20}} source={require('./assets/img/icons/editar.png')} />
</TouchableOpacity>
</View>
</View>
{/* Cambio de contraseña */}
<View style={estilos.ContenedorElemento}>
<View style={estilos.contenedor}>
<View>
......@@ -55,18 +114,20 @@ function Perfil({navigation, route}){
<Text>Cambiar la contraseña de la cuenta</Text>
</View>
<TouchableOpacity onPress={() => navigation.navigate('Contraseña', {id: route.params.id})}>
<Image style={{height:20, width:20}} source={require('./img/flecha.png')} />
<Image style={{height:20, width:20}} source={require('./assets/img/icons/flecha.png')} />
</TouchableOpacity>
</View>
</View>
<TouchableOpacity style={estilos.Boton} onPress={() => navigation.reset({index: 0, routes: [{name: 'Inicio de sesión'},],})}>
<Text style={{color:'white', fontWeight: 'bold'}}>CERRAR SESIÓN</Text>
{/* Boton de cierre de sesion */}
<TouchableOpacity style={estilos.Boton} onPress={() => setModalS(true)}>
<Text style={{color:'white', fontWeight: 'bold', fontSize:15}}>CERRAR SESIÓN</Text>
</TouchableOpacity>
</View>
</ScrollView>
);
}
// Conjunto de estilos empleados en la vista del perfil de usuario
const estilos = StyleSheet.create({
contenedor: {
flexDirection:'row',
......@@ -105,7 +166,6 @@ const estilos = StyleSheet.create({
height:45,
borderRadius:3
},
CentrarModal: {
flex: 1,
backgroundColor: "rgba(1,1,1,0.5)",
......@@ -114,11 +174,11 @@ const estilos = StyleSheet.create({
},
VistaModal: {
width:330,
height:210,
margin: 20,
height:195,
backgroundColor: "white",
borderRadius: 1,
padding: 35,
paddingTop: 20,
shadowColor: "#000",
shadowOffset: {
width: 0,
......@@ -131,26 +191,30 @@ const estilos = StyleSheet.create({
BotonAceptar: {
marginTop: 25,
textAlign: "left",
color:"#47525E"
color:"#47525E",
fontSize:15
},
BotonCancelar:{
marginTop: 25,
textAlign: "left",
color:"#FF676A"
color:"#FF676A",
fontSize:15
},
TextoModal: {
fontSize:16,
color:"#47525E"
},
TituloModal:{
fontWeight:"bold",
color:"#47525E",
fontSize:20,
fontSize:21,
paddingBottom:25
},
EntradaTexto: {
borderBottomWidth: 1,
borderBottomColor: "#B5B2B2",
paddingBottom: 15,
paddingBottom: 10,
fontSize:16
}
});
......
import React from "react";
import { Image } from "react-native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Perfil from "./Perfil.js";
import Guardias from "./Guardias.js";
const tabBar = createBottomTabNavigator(); // Tab bar
/**
* Componente que incorpora el tab bar de la aplicación
* @param route id del usuario logueado
*/
const TabBar = ({route}) => {
return(
<tabBar.Navigator >
{/* Vista de inicio */}
<tabBar.Screen name="Inicio" component={Guardias} initialParams={{id: route.params.id}} // cambiar por inicio
options={{
tabBarIcon: ({size, color}) => {
return <Image style={{width: size, height: size, tintColor: color}} source={require("./assets/img/icons/IconoInicio.png")}/>
},
headerShown: false
}}/>
{/* Vista que contienen guardias que el usuario debera atender */}
<tabBar.Screen name="Guardias" component={Guardias} initialParams={{id: route.params.id}}
options={{
tabBarIcon: ({size, color}) => {
return <Image style={{width: size, height: size, tintColor: color}} source={require("./assets/img/icons/guardias.png")}/>
},
headerTitle: "Mis guardias",
tabBarLabel: "Guardias"
}}/>
{/* Vista de reservas de instalaciones */}
<tabBar.Screen name="Instalaciones" component={Guardias} initialParams={{id: route.params.id}} // cambiar por instalaciones
options={{
tabBarIcon: ({size, color}) => {
return <Image style={{width: size, height: size, tintColor: color}} source={require("./assets/img/icons/IconoInstalaciones.png")}/>
},
headerTitle: "Reservas de instalaciones",
tabBarLabel: "Instalaciones"
}}/>
{/* Vista de reservas de material */}
<tabBar.Screen name="Material" component={Guardias} initialParams={{id: route.params.id}} // cambiar por materiales
options={{
tabBarIcon: ({size, color}) => {
return <Image style={{width: size, height: size, tintColor: color}} source={require("./assets/img/icons/IconoMaterial.png")}/>
},
headerTitle: "Reservas de material",
tabBarLabel: "Material",
headerShadowVisible: false
}}/>
{/* Vista con informacion del perfil de usuario */}
<tabBar.Screen name="Perfil" component={Perfil} initialParams={{id: route.params.id}}
options={{
tabBarIcon: ({size, color}) => {
return <Image style={{width: size, height: size, tintColor: color}} source={require("./assets/img/icons/IconoPerfil.png")}/>
},
headerShown: false
}}/>
</tabBar.Navigator>
);
}
export default TabBar;
\ No newline at end of file
#Fri Dec 30 16:50:54 CET 2022
#Wed Jan 18 02:28:19 CET 2023
C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\src\\main\\res\\mipmap-xxhdpi\\ic_launcher.png=C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\build\\intermediates\\merged_res\\debug\\mipmap-xxhdpi_ic_launcher.png.flat
C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\src\\main\\res\\drawable\\rn_edit_text_material.xml=C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\build\\intermediates\\merged_res\\debug\\drawable_rn_edit_text_material.xml.flat
C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\src\\main\\res\\mipmap-xxxhdpi\\ic_launcher_round.png=C\:\\Users\\Inmaculada\\Desktop\\GIT\\proyecto_TDDM\\android\\app\\build\\intermediates\\merged_res\\debug\\mipmap-xxxhdpi_ic_launcher_round.png.flat
......
#Fri Dec 30 16:51:26 CET 2022
#Wed Jan 18 02:28:50 CET 2023
path.4=14/classes.dex
path.3=12/classes.dex
path.2=0/classes.dex
......
{
"guardia1": {
"dia": "19",
"mes": "01",
"año": "2023",
"horaInicio": "10:00",
"horaFin": "11:00",
"clase": "Clase de 1 ESO A",
"tareas": ["Escribir un poema siguiendo las indicaciones del apartado 2 de la página 17 del libro de Lengua",
"Análisis sintáctico de las siguientes frases: \n\n - Me encontré con Pablo en el parque \n\n - Anduve sin rumbo durante un tiempo \n\n - Lo escucho desde que era pequeño",
"Leer y resumir el fragmento de la obra de Romeo y Julieta de la página 65 del libro de Lengua",
"Responda razonadamente las preguntas de la siguiente página relacionadas con el fragmento mencionado"]
},
"guardia2": {
"dia": "20",
"mes": "01",
"año": "2023",
"horaInicio": "11:00",
"horaFin": "12:00",
"clase": "Clase de 2 BACH D",
"tareas": ["Ejercicios 5, 6 y 7 de la página 44 del libro de Lengua"]
},
"guardia3": {
"dia": "20",
"mes": "01",
"año": "2023",
"horaInicio": "09:00",
"horaFin": "10:00",
"clase": "Clase de 2 ESO B",
"tareas":[]
},
"guardia4": {
"dia": "25",
"mes": "01",
"año": "2023",
"horaInicio": "13:00",
"horaFin": "14:00",
"clase": "Clase de 4 ESO B",
"tareas":["Ejercicios 1, 3 y 7 de la página 23 del libro de Ciencias Sociales"]
},
"guardia5": {
"dia": "25",
"mes": "01",
"año": "2023",
"horaInicio": "12:00",
"horaFin": "13:00",
"clase": "Clase de 1 BACH A",
"tareas":["Resumen de la página 43 del libro de Historia"]
}
}
\ No newline at end of file
{
"dgh00001":{
"Telefono": "677490125",
"Nombre": "David",
"Apellidos":"González Hidalgo",
"Password": "qwerty",
"Correo": "dgh00001@gmail.com",
"ImagenPerfil":"vacio",
"idListaMaterial": ["listaResMat0", "listaResMat1", "listaResMat2"],
"idGuardias": ["guardia1", "guardia2", "guardia4"]
},
"icl00001":{
"Telefono": "658968701",
"Nombre": "Isabel",
"Apellidos": "Cazalla Loma",
"Password": "12345",
"Correo": "icl00001@gmail.com",
"ImagenPerfil":"vacio",
"idListaMaterial": [],
"idGuardias": ["guardia3", "guardia5"]
}
}
\ No newline at end of file

5.54 KB | W: | H:

5.54 KB | W: | H:

img/editar.png
assets/img/icons/editar.png
img/editar.png
assets/img/icons/editar.png
  • 2-up
  • Swipe
  • Onion skin

4.72 KB | W: | H:

4.72 KB | W: | H:

img/flecha.png
assets/img/icons/flecha.png
img/flecha.png
assets/img/icons/flecha.png
  • 2-up
  • Swipe
  • Onion skin

39.7 KB | W: | H:

39.7 KB | W: | H:

img/logo.png
assets/img/logo.png
img/logo.png
assets/img/logo.png
  • 2-up
  • Swipe
  • Onion skin

50.2 KB | W: | H:

50.2 KB | W: | H:

img/profile.png
assets/img/photoprofiles/profile.png
img/profile.png
assets/img/photoprofiles/profile.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,7 +3,7 @@
*/
import {AppRegistry} from 'react-native';
import App from './App';
import Navegacion from './Navegacion';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent(appName, () => Navegacion);
......@@ -3061,6 +3061,23 @@
"integrity": "sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==",
"license": "MIT"
},
"node_modules/@react-navigation/bottom-tabs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-6.5.3.tgz",
"integrity": "sha512-ZA2Ko9fNwNaaSNn7738KpEk8Doi+yjRfTg8Wb/WvduIaK/28qNLAYWBCUEVjBC55y/9zJOzwc4R8Av2J2MG/4g==",
"dependencies": {
"@react-navigation/elements": "^1.3.13",
"color": "^4.2.3",
"warn-once": "^0.1.0"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"react-native": "*",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
}
},
"node_modules/@react-navigation/core": {
"version": "6.4.5",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-6.4.5.tgz",
......@@ -3094,9 +3111,9 @@
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"node_modules/@react-navigation/elements": {
"version": "1.3.12",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.12.tgz",
"integrity": "sha512-iVcLIYg/XJk1p6X1rSFhNhCjAJ3ORqNT2/bJqw7I/liujeJAoz1oZ5JDoEcZaA0wMDts1txxLuqAYJmhCgU2aA==",
"version": "1.3.13",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.13.tgz",
"integrity": "sha512-LqqK5s2ZfYHn2cQ376jC5V9dQztLH5ixkkJj9WR7JY2g4SghDd39WJhL3Jillw1Mu3F3b9sZwvAK+QkXhnDeAA==",
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
......@@ -4556,6 +4573,18 @@
"node": ">=0.10.0"
}
},
"node_modules/color": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
"integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
"dependencies": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
},
"engines": {
"node": ">=12.5.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
......@@ -4574,6 +4603,15 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/color-string": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
"dependencies": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"node_modules/colorette": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz",
......@@ -11441,6 +11479,19 @@
"plist": "^3.0.5"
}
},
"node_modules/simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
"dependencies": {
"is-arrayish": "^0.3.1"
}
},
"node_modules/simple-swizzle/node_modules/is-arrayish": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
},
"node_modules/sisteransi": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
......
MIT License
Copyright (c) 2017 React Navigation Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# `@react-navigation/bottom-tabs`
Bottom tab navigator for React Navigation following iOS design guidelines.
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/bottom-tab-navigator/).
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "BottomTabBar", {
enumerable: true,
get: function () {
return _BottomTabBar.default;
}
});
Object.defineProperty(exports, "BottomTabBarHeightCallbackContext", {
enumerable: true,
get: function () {
return _BottomTabBarHeightCallbackContext.default;
}
});
Object.defineProperty(exports, "BottomTabBarHeightContext", {
enumerable: true,
get: function () {
return _BottomTabBarHeightContext.default;
}
});
Object.defineProperty(exports, "BottomTabView", {
enumerable: true,
get: function () {
return _BottomTabView.default;
}
});
Object.defineProperty(exports, "createBottomTabNavigator", {
enumerable: true,
get: function () {
return _createBottomTabNavigator.default;
}
});
Object.defineProperty(exports, "useBottomTabBarHeight", {
enumerable: true,
get: function () {
return _useBottomTabBarHeight.default;
}
});
var _createBottomTabNavigator = _interopRequireDefault(require("./navigators/createBottomTabNavigator"));
var _BottomTabBar = _interopRequireDefault(require("./views/BottomTabBar"));
var _BottomTabView = _interopRequireDefault(require("./views/BottomTabView"));
var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("./utils/BottomTabBarHeightCallbackContext"));
var _BottomTabBarHeightContext = _interopRequireDefault(require("./utils/BottomTabBarHeightContext"));
var _useBottomTabBarHeight = _interopRequireDefault(require("./utils/useBottomTabBarHeight"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAKA;AACA;AAKA;AACA;AACA;AAAiF"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _warnOnce = _interopRequireDefault(require("warn-once"));
var _BottomTabView = _interopRequireDefault(require("../views/BottomTabView"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function BottomTabNavigator(_ref) {
let {
id,
initialRouteName,
backBehavior,
children,
screenListeners,
screenOptions,
sceneContainerStyle,
...restWithDeprecated
} = _ref;
const {
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: tabBarOptions is deprecated
tabBarOptions,
...rest
} = restWithDeprecated;
let defaultScreenOptions = {};
if (tabBarOptions) {
Object.assign(defaultScreenOptions, {
tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,
tabBarActiveTintColor: tabBarOptions.activeTintColor,
tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,
tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,
tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,
tabBarAllowFontScaling: tabBarOptions.allowFontScaling,
tabBarShowLabel: tabBarOptions.showLabel,
tabBarLabelStyle: tabBarOptions.labelStyle,
tabBarIconStyle: tabBarOptions.iconStyle,
tabBarItemStyle: tabBarOptions.tabStyle,
tabBarLabelPosition: tabBarOptions.labelPosition ?? (tabBarOptions.adaptive === false ? 'below-icon' : undefined),
tabBarStyle: [{
display: tabBarOptions.tabBarVisible ? 'none' : 'flex'
}, defaultScreenOptions.tabBarStyle]
});
Object.keys(defaultScreenOptions).forEach(key => {
if (defaultScreenOptions[key] === undefined) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete defaultScreenOptions[key];
}
});
(0, _warnOnce.default)(tabBarOptions, `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(defaultScreenOptions, null, 2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`);
}
if (typeof lazy === 'boolean') {
defaultScreenOptions.lazy = lazy;
(0, _warnOnce.default)(true, `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`);
}
const {
state,
descriptors,
navigation,
NavigationContent
} = (0, _native.useNavigationBuilder)(_native.TabRouter, {
id,
initialRouteName,
backBehavior,
children,
screenListeners,
screenOptions,
defaultScreenOptions
});
return /*#__PURE__*/React.createElement(NavigationContent, null, /*#__PURE__*/React.createElement(_BottomTabView.default, _extends({}, rest, {
state: state,
navigation: navigation,
descriptors: descriptors,
sceneContainerStyle: sceneContainerStyle
})));
}
var _default = (0, _native.createNavigatorFactory)(BottomTabNavigator);
exports.default = _default;
//# sourceMappingURL=createBottomTabNavigator.js.map
\ No newline at end of file
{"version":3,"names":["BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","warnOnce","JSON","stringify","state","descriptors","navigation","NavigationContent","useNavigationBuilder","TabRouter","createNavigatorFactory"],"sourceRoot":"../../src","sources":["createBottomTabNavigator.tsx"],"mappings":";;;;;;AAAA;AAUA;AACA;AAOA;AAAmD;AAAA;AAAA;AAAA;AAWnD,SAASA,kBAAkB,OASjB;EAAA,IATkB;IAC1BC,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbC,mBAAmB;IACnB,GAAGC;EACE,CAAC;EACN,MAAM;IACJ;IACAC,IAAI;IACJ;IACAC,aAAa;IACb,GAAGC;EACL,CAAC,GAAGH,kBAAkB;EAEtB,IAAII,oBAAgD,GAAG,CAAC,CAAC;EAEzD,IAAIF,aAAa,EAAE;IACjBG,MAAM,CAACC,MAAM,CAACF,oBAAoB,EAAE;MAClCG,oBAAoB,EAAEL,aAAa,CAACM,mBAAmB;MACvDC,qBAAqB,EAAEP,aAAa,CAACQ,eAAe;MACpDC,uBAAuB,EAAET,aAAa,CAACU,iBAAiB;MACxDC,2BAA2B,EAAEX,aAAa,CAACY,qBAAqB;MAChEC,6BAA6B,EAAEb,aAAa,CAACc,uBAAuB;MACpEC,sBAAsB,EAAEf,aAAa,CAACgB,gBAAgB;MACtDC,eAAe,EAAEjB,aAAa,CAACkB,SAAS;MACxCC,gBAAgB,EAAEnB,aAAa,CAACoB,UAAU;MAC1CC,eAAe,EAAErB,aAAa,CAACsB,SAAS;MACxCC,eAAe,EAAEvB,aAAa,CAACwB,QAAQ;MACvCC,mBAAmB,EACjBzB,aAAa,CAAC0B,aAAa,KAC1B1B,aAAa,CAAC2B,QAAQ,KAAK,KAAK,GAAG,YAAY,GAAGC,SAAS,CAAC;MAC/DC,WAAW,EAAE,CACX;QAAEC,OAAO,EAAE9B,aAAa,CAAC+B,aAAa,GAAG,MAAM,GAAG;MAAO,CAAC,EAC1D7B,oBAAoB,CAAC2B,WAAW;IAEpC,CAAC,CAAC;IAGA1B,MAAM,CAAC6B,IAAI,CAAC9B,oBAAoB,CAAC,CACjC+B,OAAO,CAAEC,GAAG,IAAK;MACjB,IAAIhC,oBAAoB,CAACgC,GAAG,CAAC,KAAKN,SAAS,EAAE;QAC3C;QACA,OAAO1B,oBAAoB,CAACgC,GAAG,CAAC;MAClC;IACF,CAAC,CAAC;IAEF,IAAAC,iBAAQ,EACNnC,aAAa,EACZ,4LAA2LoC,IAAI,CAACC,SAAS,CACxMnC,oBAAoB,EACpB,IAAI,EACJ,CAAC,CACD,yFAAwF,CAC3F;EACH;EAEA,IAAI,OAAOH,IAAI,KAAK,SAAS,EAAE;IAC7BG,oBAAoB,CAACH,IAAI,GAAGA,IAAI;IAEhC,IAAAoC,iBAAQ,EACN,IAAI,EACH,+KAA8K,CAChL;EACH;EAEA,MAAM;IAAEG,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzD,IAAAC,4BAAoB,EAMlBC,iBAAS,EAAE;IACXpD,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbM;EACF,CAAC,CAAC;EAEJ,oBACE,oBAAC,iBAAiB,qBAChB,oBAAC,sBAAa,eACRD,IAAI;IACR,KAAK,EAAEqC,KAAM;IACb,UAAU,EAAEE,UAAW;IACvB,WAAW,EAAED,WAAY;IACzB,mBAAmB,EAAE1C;EAAoB,GACzC,CACgB;AAExB;AAAC,eAEc,IAAA+C,8BAAsB,EAKnCtD,kBAAkB,CAAC;AAAA"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map
\ No newline at end of file
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _default = /*#__PURE__*/React.createContext(undefined);
exports.default = _default;
//# sourceMappingURL=BottomTabBarHeightCallbackContext.js.map
\ No newline at end of file
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightCallbackContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAChCC,SAAS,CACV;AAAA"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _default = /*#__PURE__*/React.createContext(undefined);
exports.default = _default;
//# sourceMappingURL=BottomTabBarHeightContext.js.map
\ No newline at end of file
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAAqBC,SAAS,CAAC;AAAA"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useBottomTabBarHeight;
var React = _interopRequireWildcard(require("react"));
var _BottomTabBarHeightContext = _interopRequireDefault(require("./BottomTabBarHeightContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function useBottomTabBarHeight() {
const height = React.useContext(_BottomTabBarHeightContext.default);
if (height === undefined) {
throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");
}
return height;
}
//# sourceMappingURL=useBottomTabBarHeight.js.map
\ No newline at end of file
{"version":3,"names":["useBottomTabBarHeight","height","React","useContext","BottomTabBarHeightContext","undefined","Error"],"sourceRoot":"../../src","sources":["useBottomTabBarHeight.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAoE;AAAA;AAAA;AAErD,SAASA,qBAAqB,GAAG;EAC9C,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,kCAAyB,CAAC;EAE1D,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,2FAA2F,CAC5F;EACH;EAEA,OAAOL,MAAM;AACf"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useIsKeyboardShown;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function useIsKeyboardShown() {
const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);
React.useEffect(() => {
const handleKeyboardShow = () => setIsKeyboardShown(true);
const handleKeyboardHide = () => setIsKeyboardShown(false);
let subscriptions;
if (_reactNative.Platform.OS === 'ios') {
subscriptions = [_reactNative.Keyboard.addListener('keyboardWillShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardWillHide', handleKeyboardHide)];
} else {
subscriptions = [_reactNative.Keyboard.addListener('keyboardDidShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardDidHide', handleKeyboardHide)];
}
return () => {
subscriptions.forEach(s => s.remove());
};
}, []);
return isKeyboardShown;
}
//# sourceMappingURL=useIsKeyboardShown.js.map
\ No newline at end of file
{"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"sourceRoot":"../../src","sources":["useIsKeyboardShown.tsx"],"mappings":";;;;;;AAAA;AACA;AAAuE;AAAA;AAExD,SAASA,kBAAkB,GAAG;EAC3C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EAEnED,KAAK,CAACE,SAAS,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,IAAI,CAAC;IACzD,MAAMK,kBAAkB,GAAG,MAAML,kBAAkB,CAAC,KAAK,CAAC;IAE1D,IAAIM,aAAoC;IAExC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBF,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEN,kBAAkB,CAAC,EAC5DK,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEL,kBAAkB,CAAC,CAC7D;IACH,CAAC,MAAM;MACLC,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEN,kBAAkB,CAAC,EAC3DK,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEL,kBAAkB,CAAC,CAC5D;IACH;IAEA,OAAO,MAAM;MACXC,aAAa,CAACK,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,EAAE,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOd,eAAe;AACxB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Badge;
var _native = require("@react-navigation/native");
var _color = _interopRequireDefault(require("color"));
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function Badge(_ref) {
let {
children,
style,
visible = true,
size = 18,
...rest
} = _ref;
const [opacity] = React.useState(() => new _reactNative.Animated.Value(visible ? 1 : 0));
const [rendered, setRendered] = React.useState(visible);
const theme = (0, _native.useTheme)();
React.useEffect(() => {
if (!rendered) {
return;
}
_reactNative.Animated.timing(opacity, {
toValue: visible ? 1 : 0,
duration: 150,
useNativeDriver: true
}).start(_ref2 => {
let {
finished
} = _ref2;
if (finished && !visible) {
setRendered(false);
}
});
return () => opacity.stopAnimation();
}, [opacity, rendered, visible]);
if (!rendered) {
if (visible) {
setRendered(true);
} else {
return null;
}
}
// @ts-expect-error: backgroundColor definitely exists
const {
backgroundColor = theme.colors.notification,
...restStyle
} = _reactNative.StyleSheet.flatten(style) || {};
const textColor = (0, _color.default)(backgroundColor).isLight() ? 'black' : 'white';
const borderRadius = size / 2;
const fontSize = Math.floor(size * 3 / 4);
return /*#__PURE__*/React.createElement(_reactNative.Animated.Text, _extends({
numberOfLines: 1,
style: [{
transform: [{
scale: opacity.interpolate({
inputRange: [0, 1],
outputRange: [0.5, 1]
})
}],
color: textColor,
lineHeight: size - 1,
height: size,
minWidth: size,
opacity,
backgroundColor,
fontSize,
borderRadius
}, styles.container, restStyle]
}, rest), children);
}
const styles = _reactNative.StyleSheet.create({
container: {
alignSelf: 'flex-end',
textAlign: 'center',
paddingHorizontal: 4,
overflow: 'hidden'
}
});
//# sourceMappingURL=Badge.js.map
\ No newline at end of file
{"version":3,"names":["Badge","children","style","visible","size","rest","opacity","React","useState","Animated","Value","rendered","setRendered","theme","useTheme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","StyleSheet","flatten","textColor","color","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAA0E;AAAA;AAAA;AAAA;AAqB3D,SAASA,KAAK,OAMnB;EAAA,IANoB;IAC5BC,QAAQ;IACRC,KAAK;IACLC,OAAO,GAAG,IAAI;IACdC,IAAI,GAAG,EAAE;IACT,GAAGC;EACE,CAAC;EACN,MAAM,CAACC,OAAO,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,MAAM,IAAIC,qBAAQ,CAACC,KAAK,CAACP,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC3E,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGL,KAAK,CAACC,QAAQ,CAACL,OAAO,CAAC;EAEvD,MAAMU,KAAK,GAAG,IAAAC,gBAAQ,GAAE;EAExBP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,IAAI,CAACJ,QAAQ,EAAE;MACb;IACF;IAEAF,qBAAQ,CAACO,MAAM,CAACV,OAAO,EAAE;MACvBW,OAAO,EAAEd,OAAO,GAAG,CAAC,GAAG,CAAC;MACxBe,QAAQ,EAAE,GAAG;MACbC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,CAAC,SAAkB;MAAA,IAAjB;QAAEC;MAAS,CAAC;MACpB,IAAIA,QAAQ,IAAI,CAAClB,OAAO,EAAE;QACxBS,WAAW,CAAC,KAAK,CAAC;MACpB;IACF,CAAC,CAAC;IAEF,OAAO,MAAMN,OAAO,CAACgB,aAAa,EAAE;EACtC,CAAC,EAAE,CAAChB,OAAO,EAAEK,QAAQ,EAAER,OAAO,CAAC,CAAC;EAEhC,IAAI,CAACQ,QAAQ,EAAE;IACb,IAAIR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of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = BottomTabBarItem;
var _native = require("@react-navigation/native");
var _color = _interopRequireDefault(require("color"));
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
var _TabBarIcon = _interopRequireDefault(require("./TabBarIcon"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function BottomTabBarItem(_ref) {
let {
focused,
route,
descriptor,
label,
icon,
badge,
badgeStyle,
to,
button = _ref2 => {
let {
children,
style,
onPress,
to,
accessibilityRole,
...rest
} = _ref2;
if (_reactNative.Platform.OS === 'web' && to) {
// React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
// We need to use `onClick` to be able to prevent default browser handling of links.
return /*#__PURE__*/_react.default.createElement(_native.Link, _extends({}, rest, {
to: to,
style: [styles.button, style],
onPress: e => {
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
// ignore clicks with modifier keys
e.button == null || e.button === 0) // ignore everything but left clicks
) {
e.preventDefault();
onPress === null || onPress === void 0 ? void 0 : onPress(e);
}
}
}), children);
} else {
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({}, rest, {
accessibilityRole: accessibilityRole,
onPress: onPress,
style: style
}), children);
}
},
accessibilityLabel,
testID,
onPress,
onLongPress,
horizontal,
activeTintColor: customActiveTintColor,
inactiveTintColor: customInactiveTintColor,
activeBackgroundColor = 'transparent',
inactiveBackgroundColor = 'transparent',
showLabel = true,
allowFontScaling,
labelStyle,
iconStyle,
style
} = _ref;
const {
colors
} = (0, _native.useTheme)();
const activeTintColor = customActiveTintColor === undefined ? colors.primary : customActiveTintColor;
const inactiveTintColor = customInactiveTintColor === undefined ? (0, _color.default)(colors.text).mix((0, _color.default)(colors.card), 0.5).hex() : customInactiveTintColor;
const renderLabel = _ref3 => {
let {
focused
} = _ref3;
if (showLabel === false) {
return null;
}
const color = focused ? activeTintColor : inactiveTintColor;
if (typeof label === 'string') {
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
numberOfLines: 1,
style: [styles.label, {
color
}, horizontal ? styles.labelBeside : styles.labelBeneath, labelStyle],
allowFontScaling: allowFontScaling
}, label);
}
const {
options
} = descriptor;
const children = typeof options.tabBarLabel === 'string' ? options.tabBarLabel : options.title !== undefined ? options.title : route.name;
return label({
focused,
color,
position: horizontal ? 'beside-icon' : 'below-icon',
children
});
};
const renderIcon = _ref4 => {
let {
focused
} = _ref4;
if (icon === undefined) {
return null;
}
const activeOpacity = focused ? 1 : 0;
const inactiveOpacity = focused ? 0 : 1;
return /*#__PURE__*/_react.default.createElement(_TabBarIcon.default, {
route: route,
horizontal: horizontal,
badge: badge,
badgeStyle: badgeStyle,
activeOpacity: activeOpacity,
inactiveOpacity: inactiveOpacity,
activeTintColor: activeTintColor,
inactiveTintColor: inactiveTintColor,
renderIcon: icon,
style: iconStyle
});
};
const scene = {
route,
focused
};
const backgroundColor = focused ? activeBackgroundColor : inactiveBackgroundColor;
return button({
to,
onPress,
onLongPress,
testID,
accessibilityLabel,
// FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS
accessibilityRole: _reactNative.Platform.select({
ios: 'button',
default: 'tab'
}),
accessibilityState: {
selected: focused
},
// @ts-expect-error: keep for compatibility with older React Native versions
accessibilityStates: focused ? ['selected'] : [],
style: [styles.tab, {
backgroundColor
}, horizontal ? styles.tabLandscape : styles.tabPortrait, style],
children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderIcon(scene), renderLabel(scene))
});
}
const styles = _reactNative.StyleSheet.create({
tab: {
flex: 1,
alignItems: 'center'
},
tabPortrait: {
justifyContent: 'flex-end',
flexDirection: 'column'
},
tabLandscape: {
justifyContent: 'center',
flexDirection: 'row'
},
label: {
textAlign: 'center',
backgroundColor: 'transparent'
},
labelBeneath: {
fontSize: 10
},
labelBeside: {
fontSize: 13,
marginLeft: 20,
marginTop: 3
},
button: {
display: 'flex'
}
});
//# sourceMappingURL=BottomTabItem.js.map
\ No newline at end of file
{"version":3,"names":["BottomTabBarItem","focused","route","descriptor","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","Platform","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","useTheme","undefined","primary","Color","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","options","tabBarLabel","title","name","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","StyleSheet","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"sourceRoot":"../../src","sources":["BottomTabItem.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAgBA;AAAsC;AAAA;AA+GvB,SAASA,gBAAgB,OAiE9B;EAAA,IAjE+B;IACvCC,OAAO;IACPC,KAAK;IACLC,UAAU;IACVC,KAAK;IACLC,IAAI;IACJC,KAAK;IACLC,UAAU;IACVC,EAAE;IACFC,MAAM,GAAG,SAOsB;MAAA,IAPrB;QACRC,QAAQ;QACRC,KAAK;QACLC,OAAO;QACPJ,EAAE;QACFK,iBAAiB;QACjB,GAAGC;MACoB,CAAC;MACxB,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAIR,EAAE,EAAE;QAC/B;QACA;QACA,oBACE,6BAAC,YAAI,eACCM,IAAI;UACR,EAAE,EAAEN,EAAG;UACP,KAAK,EAAE,CAACS,MAAM,CAACR,MAAM,EAAEE,KAAK,CAAE;UAC9B,OAAO,EAAGO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;EACnB,CAAC;EACDV,YAAY,EAAE;IACZ2B,QAAQ,EAAE;EACZ,CAAC;EACD5B,WAAW,EAAE;IACX4B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE;EACb,CAAC;EACDtE,MAAM,EAAE;IACNuE,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = BottomTabView;
var _elements = require("@react-navigation/elements");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("../utils/BottomTabBarHeightCallbackContext"));
var _BottomTabBarHeightContext = _interopRequireDefault(require("../utils/BottomTabBarHeightContext"));
var _BottomTabBar = _interopRequireWildcard(require("./BottomTabBar"));
var _ScreenFallback = require("./ScreenFallback");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function BottomTabView(props) {
const {
tabBar = props => /*#__PURE__*/React.createElement(_BottomTabBar.default, props),
state,
navigation,
descriptors,
safeAreaInsets,
detachInactiveScreens = _reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'android' || _reactNative.Platform.OS === 'ios',
sceneContainerStyle
} = props;
const focusedRouteKey = state.routes[state.index].key;
const [loaded, setLoaded] = React.useState([focusedRouteKey]);
if (!loaded.includes(focusedRouteKey)) {
setLoaded([...loaded, focusedRouteKey]);
}
const dimensions = _elements.SafeAreaProviderCompat.initialMetrics.frame;
const [tabBarHeight, setTabBarHeight] = React.useState(() => (0, _BottomTabBar.getTabBarHeight)({
state,
descriptors,
dimensions,
layout: {
width: dimensions.width,
height: 0
},
insets: {
..._elements.SafeAreaProviderCompat.initialMetrics.insets,
...props.safeAreaInsets
},
style: descriptors[state.routes[state.index].key].options.tabBarStyle
}));
const renderTabBar = () => {
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Consumer, null, insets => tabBar({
state: state,
descriptors: descriptors,
navigation: navigation,
insets: {
top: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.top) ?? (insets === null || insets === void 0 ? void 0 : insets.top) ?? 0,
right: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.right) ?? (insets === null || insets === void 0 ? void 0 : insets.right) ?? 0,
bottom: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.bottom) ?? (insets === null || insets === void 0 ? void 0 : insets.bottom) ?? 0,
left: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.left) ?? (insets === null || insets === void 0 ? void 0 : insets.left) ?? 0
}
}));
};
const {
routes
} = state;
return /*#__PURE__*/React.createElement(_elements.SafeAreaProviderCompat, null, /*#__PURE__*/React.createElement(_ScreenFallback.MaybeScreenContainer, {
enabled: detachInactiveScreens,
hasTwoStates: true,
style: styles.container
}, routes.map((route, index) => {
const descriptor = descriptors[route.key];
const {
lazy = true,
unmountOnBlur
} = descriptor.options;
const isFocused = state.index === index;
if (unmountOnBlur && !isFocused) {
return null;
}
if (lazy && !loaded.includes(route.key) && !isFocused) {
// Don't render a lazy screen if we've never navigated to it
return null;
}
const {
freezeOnBlur,
header = _ref => {
let {
layout,
options
} = _ref;
return /*#__PURE__*/React.createElement(_elements.Header, _extends({}, options, {
layout: layout,
title: (0, _elements.getHeaderTitle)(options, route.name)
}));
},
headerShown,
headerStatusBarHeight,
headerTransparent
} = descriptor.options;
return /*#__PURE__*/React.createElement(_ScreenFallback.MaybeScreen, {
key: route.key,
style: [_reactNative.StyleSheet.absoluteFill, {
zIndex: isFocused ? 0 : -1
}],
visible: isFocused,
enabled: detachInactiveScreens,
freezeOnBlur: freezeOnBlur
}, /*#__PURE__*/React.createElement(_BottomTabBarHeightContext.default.Provider, {
value: tabBarHeight
}, /*#__PURE__*/React.createElement(_elements.Screen, {
focused: isFocused,
route: descriptor.route,
navigation: descriptor.navigation,
headerShown: headerShown,
headerStatusBarHeight: headerStatusBarHeight,
headerTransparent: headerTransparent,
header: header({
layout: dimensions,
route: descriptor.route,
navigation: descriptor.navigation,
options: descriptor.options
}),
style: sceneContainerStyle
}, descriptor.render())));
})), /*#__PURE__*/React.createElement(_BottomTabBarHeightCallbackContext.default.Provider, {
value: setTabBarHeight
}, renderTabBar()));
}
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
overflow: 'hidden'
}
});
//# sourceMappingURL=BottomTabView.js.map
\ No newline at end of file
{"version":3,"names":["BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","Platform","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","React","useState","includes","dimensions","SafeAreaProviderCompat","initialMetrics","frame","tabBarHeight","setTabBarHeight","getTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","getHeaderTitle","name","headerShown","headerStatusBarHeight","headerTransparent","StyleSheet","absoluteFill","zIndex","render","create","flex","overflow"],"sourceRoot":"../../src","sources":["BottomTabView.tsx"],"mappings":";;;;;;AAAA;AAUA;AACA;AACA;AAUA;AACA;AACA;AACA;AAAqE;AAAA;AAAA;AAAA;AAQtD,SAASA,aAAa,CAACC,KAAY,EAAE;EAClD,MAAM;IACJC,MAAM,GAAID,KAAwB,iBAAK,oBAAC,qBAAY,EAAKA,KAAK,CAAI;IAClEE,KAAK;IACLC,UAAU;IACVC,WAAW;IACXC,cAAc;IACdC,qBAAqB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAC3CD,qBAAQ,CAACC,EAAE,KAAK,SAAS,IACzBD,qBAAQ,CAACC,EAAE,KAAK,KAAK;IACvBC;EACF,CAAC,GAAGT,KAAK;EAET,MAAMU,eAAe,GAAGR,KAAK,CAACS,MAAM,CAACT,KAAK,CAACU,KAAK,CAAC,CAACC,GAAG;EACrD,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,CAACP,eAAe,CAAC,CAAC;EAE7D,IAAI,CAACI,MAAM,CAACI,QAAQ,CAACR,eAAe,CAAC,EAAE;IACrCK,SAAS,CAAC,CAAC,GAAGD,MAAM,EAAEJ,eAAe,CAAC,CAAC;EACzC;EAEA,MAAMS,UAAU,GAAGC,gCAAsB,CAACC,cAAc,CAACC,KAAK;EAC9D,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGR,KAAK,CAACC,QAAQ,CAAC,MACrD,IAAAQ,6BAAe,EAAC;IACdvB,KAAK;IACLE,WAAW;IACXe,UAAU;IACVO,MAAM,EAAE;MAAEC,KAAK,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nB,KAAK,EAAEH,UAAU,CAACD,KAAM;MACxB,UAAU,EAAEC,UAAU,CAACvC,UAAW;MAClC,WAAW,EAAE+C,WAAY;MACzB,qBAAqB,EAAEC,qBAAsB;MAC7C,iBAAiB,EAAEC,iBAAkB;MACrC,MAAM,EAAEL,MAAM,CAAC;QACbrB,MAAM,EAAEP,UAAU;QAClBsB,KAAK,EAAEC,UAAU,CAACD,KAAK;QACvBtC,UAAU,EACRuC,UAAU,CAACvC,UAAoD;QACjE4B,OAAO,EAAEW,UAAU,CAACX;MACtB,CAAC,CAAE;MACH,KAAK,EAAEtB;IAAoB,GAE1BiC,UAAU,CAACc,MAAM,EAAE,CACb,CAC0B,CACzB;EAElB,CAAC,CAAC,CACmB,eACvB,oBAAC,0CAAiC,CAAC,QAAQ;IAAC,KAAK,EAAEhC;EAAgB,GAChES,YAAY,EAAE,CAC4B,CACtB;AAE7B;AAEA,MAAMK,MAAM,GAAGe,uBAAU,CAACI,MAAM,CAAC;EAC/BlB,SAAS,EAAE;IACTmB,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MaybeScreen = MaybeScreen;
exports.MaybeScreenContainer = void 0;
var _elements = require("@react-navigation/elements");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
let Screens;
try {
Screens = require('react-native-screens');
} catch (e) {
// Ignore
}
const MaybeScreenContainer = _ref => {
var _Screens, _Screens$screensEnabl;
let {
enabled,
...rest
} = _ref;
if ((_Screens = Screens) !== null && _Screens !== void 0 && (_Screens$screensEnabl = _Screens.screensEnabled) !== null && _Screens$screensEnabl !== void 0 && _Screens$screensEnabl.call(_Screens)) {
return /*#__PURE__*/React.createElement(Screens.ScreenContainer, _extends({
enabled: enabled
}, rest));
}
return /*#__PURE__*/React.createElement(_reactNative.View, rest);
};
exports.MaybeScreenContainer = MaybeScreenContainer;
function MaybeScreen(_ref2) {
var _Screens2, _Screens2$screensEnab;
let {
visible,
children,
...rest
} = _ref2;
if ((_Screens2 = Screens) !== null && _Screens2 !== void 0 && (_Screens2$screensEnab = _Screens2.screensEnabled) !== null && _Screens2$screensEnab !== void 0 && _Screens2$screensEnab.call(_Screens2)) {
return /*#__PURE__*/React.createElement(Screens.Screen, _extends({
activityState: visible ? 2 : 0
}, rest), children);
}
return /*#__PURE__*/React.createElement(_elements.ResourceSavingView, _extends({
visible: visible
}, rest), children);
}
//# sourceMappingURL=ScreenFallback.js.map
\ No newline at end of file
{"version":3,"names":["Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sourceRoot":"../../src","sources":["ScreenFallback.tsx"],"mappings":";;;;;;;AAAA;AACA;AACA;AAAqE;AAAA;AAAA;AAUrE,IAAIA,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGK,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC;EACC,gBAAIL,OAAO,8DAAP,SAASM,cAAc,kDAAvB,oCAA2B,EAAE;IAC/B,oBAAO,oBAAC,OAAO,CAAC,eAAe;MAAC,OAAO,EAAEF;IAAQ,GAAKC,IAAI,EAAI;EAChE;EAEA,oBAAO,oBAAC,iBAAI,EAAKA,IAAI,CAAI;AAC3B,CAAC;AAAC;AAEK,SAASE,WAAW,QAAwC;EAAA;EAAA,IAAvC;IAAEC,OAAO;IAAEC,QAAQ;IAAE,GAAGJ;EAAY,CAAC;EAC/D,iBAAIL,OAAO,+DAAP,UAASM,cAAc,kDAAvB,qCAA2B,EAAE;IAC/B,oBACE,oBAAC,OAAO,CAAC,MAAM;MAAC,aAAa,EAAEE,OAAO,GAAG,CAAC,GAAG;IAAE,GAAKH,IAAI,GACrDI,QAAQ,CACM;EAErB;EAEA,oBACE,oBAAC,4BAAkB;IAAC,OAAO,EAAED;EAAQ,GAAKH,IAAI,GAC3CI,QAAQ,CACU;AAEzB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = TabBarIcon;
var _react = _interopRequireDefault(require("react"));
var _reactNative = require("react-native");
var _Badge = _interopRequireDefault(require("./Badge"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TabBarIcon(_ref) {
let {
route: _,
horizontal,
badge,
badgeStyle,
activeOpacity,
inactiveOpacity,
activeTintColor,
inactiveTintColor,
renderIcon,
style
} = _ref;
const size = 25;
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them.
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
style: [horizontal ? styles.iconHorizontal : styles.iconVertical, style]
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
style: [styles.icon, {
opacity: activeOpacity
}]
}, renderIcon({
focused: true,
size,
color: activeTintColor
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
style: [styles.icon, {
opacity: inactiveOpacity
}]
}, renderIcon({
focused: false,
size,
color: inactiveTintColor
})), /*#__PURE__*/_react.default.createElement(_Badge.default, {
visible: badge != null,
style: [styles.badge, horizontal ? styles.badgeHorizontal : styles.badgeVertical, badgeStyle],
size: size * 3 / 4
}, badge));
}
const styles = _reactNative.StyleSheet.create({
icon: {
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them:
// Cover the whole iconContainer:
position: 'absolute',
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
width: '100%',
// Workaround for react-native >= 0.54 layout bug
minWidth: 25
},
iconVertical: {
flex: 1
},
iconHorizontal: {
height: '100%',
marginTop: 3
},
badge: {
position: 'absolute',
left: 3
},
badgeVertical: {
top: 3
},
badgeHorizontal: {
top: 7
}
});
//# sourceMappingURL=TabBarIcon.js.map
\ No newline at end of file
{"version":3,"names":["TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","StyleSheet","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","flex","marginTop","left","top"],"sourceRoot":"../../src","sources":["TabBarIcon.tsx"],"mappings":";;;;;;AACA;AACA;AAQA;AAA4B;AAmBb,SAASA,UAAU,OAWxB;EAAA,IAXyB;IACjCC,KAAK,EAAEC,CAAC;IACRC,UAAU;IACVC,KAAK;IACLC,UAAU;IACVC,aAAa;IACbC,eAAe;IACfC,eAAe;IACfC,iBAAiB;IACjBC,UAAU;IACVC;EACK,CAAC;EACN,MAAMC,IAAI,GAAG,EAAE;;EAEf;EACA;E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E,UAAU;IACpBS,IAAI,EAAE;EACR,CAAC;EACDZ,aAAa,EAAE;IACba,GAAG,EAAE;EACP,CAAC;EACDd,eAAe,EAAE;IACfc,GAAG,EAAE;EACP;AACF,CAAC,CAAC"}
\ No newline at end of file
/**
* Navigators
*/
export { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator';
/**
* Views
*/
export { default as BottomTabBar } from './views/BottomTabBar';
export { default as BottomTabView } from './views/BottomTabView';
/**
* Utilities
*/
export { default as BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext';
export { default as BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';
export { default as useBottomTabBarHeight } from './utils/useBottomTabBarHeight';
/**
* Types
*/
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"names":["default","createBottomTabNavigator","BottomTabBar","BottomTabView","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","useBottomTabBarHeight"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,wBAAwB,QAAQ,uCAAuC;;AAE3F;AACA;AACA;AACA,SAASD,OAAO,IAAIE,YAAY,QAAQ,sBAAsB;AAC9D,SAASF,OAAO,IAAIG,aAAa,QAAQ,uBAAuB;;AAEhE;AACA;AACA;AACA,SAASH,OAAO,IAAII,iCAAiC,QAAQ,2CAA2C;AACxG,SAASJ,OAAO,IAAIK,yBAAyB,QAAQ,mCAAmC;AACxF,SAASL,OAAO,IAAIM,qBAAqB,QAAQ,+BAA+B;;AAEhF;AACA;AACA"}
\ No newline at end of file
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { createNavigatorFactory, TabRouter, useNavigationBuilder } from '@react-navigation/native';
import * as React from 'react';
import warnOnce from 'warn-once';
import BottomTabView from '../views/BottomTabView';
function BottomTabNavigator(_ref) {
let {
id,
initialRouteName,
backBehavior,
children,
screenListeners,
screenOptions,
sceneContainerStyle,
...restWithDeprecated
} = _ref;
const {
// @ts-expect-error: lazy is deprecated
lazy,
// @ts-expect-error: tabBarOptions is deprecated
tabBarOptions,
...rest
} = restWithDeprecated;
let defaultScreenOptions = {};
if (tabBarOptions) {
Object.assign(defaultScreenOptions, {
tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,
tabBarActiveTintColor: tabBarOptions.activeTintColor,
tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,
tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,
tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,
tabBarAllowFontScaling: tabBarOptions.allowFontScaling,
tabBarShowLabel: tabBarOptions.showLabel,
tabBarLabelStyle: tabBarOptions.labelStyle,
tabBarIconStyle: tabBarOptions.iconStyle,
tabBarItemStyle: tabBarOptions.tabStyle,
tabBarLabelPosition: tabBarOptions.labelPosition ?? (tabBarOptions.adaptive === false ? 'below-icon' : undefined),
tabBarStyle: [{
display: tabBarOptions.tabBarVisible ? 'none' : 'flex'
}, defaultScreenOptions.tabBarStyle]
});
Object.keys(defaultScreenOptions).forEach(key => {
if (defaultScreenOptions[key] === undefined) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete defaultScreenOptions[key];
}
});
warnOnce(tabBarOptions, `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(defaultScreenOptions, null, 2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`);
}
if (typeof lazy === 'boolean') {
defaultScreenOptions.lazy = lazy;
warnOnce(true, `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`);
}
const {
state,
descriptors,
navigation,
NavigationContent
} = useNavigationBuilder(TabRouter, {
id,
initialRouteName,
backBehavior,
children,
screenListeners,
screenOptions,
defaultScreenOptions
});
return /*#__PURE__*/React.createElement(NavigationContent, null, /*#__PURE__*/React.createElement(BottomTabView, _extends({}, rest, {
state: state,
navigation: navigation,
descriptors: descriptors,
sceneContainerStyle: sceneContainerStyle
})));
}
export default createNavigatorFactory(BottomTabNavigator);
//# sourceMappingURL=createBottomTabNavigator.js.map
\ No newline at end of file
{"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","React","warnOnce","BottomTabView","BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent"],"sourceRoot":"../../src","sources":["createBottomTabNavigator.tsx"],"mappings":";AAAA,SACEA,sBAAsB,EAKtBC,SAAS,EAETC,oBAAoB,QACf,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,QAAQ,MAAM,WAAW;AAOhC,OAAOC,aAAa,MAAM,wBAAwB;AAWlD,SAASC,kBAAkB,OASjB;EAAA,IATkB;IAC1BC,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbC,mBAAmB;IACnB,GAAGC;EACE,CAAC;EACN,MAAM;IACJ;IACAC,IAAI;IACJ;IACAC,aAAa;IACb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AC7BG,oBAAoB,CAACH,IAAI,GAAGA,IAAI;IAEhCX,QAAQ,CACN,IAAI,EACH,+KAA8K,CAChL;EACH;EAEA,MAAM;IAAEiD,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzDtD,oBAAoB,CAMlBD,SAAS,EAAE;IACXM,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbM;EACF,CAAC,CAAC;EAEJ,oBACE,oBAAC,iBAAiB,qBAChB,oBAAC,aAAa,eACRD,IAAI;IACR,KAAK,EAAEoC,KAAM;IACb,UAAU,EAAEE,UAAW;IACvB,WAAW,EAAED,WAAY;IACzB,mBAAmB,EAAEzC;EAAoB,GACzC,CACgB;AAExB;AAEA,eAAeb,sBAAsB,CAKnCM,kBAAkB,CAAC"}
\ No newline at end of file
export {};
//# sourceMappingURL=types.js.map
\ No newline at end of file
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
\ No newline at end of file
import * as React from 'react';
export default /*#__PURE__*/React.createContext(undefined);
//# sourceMappingURL=BottomTabBarHeightCallbackContext.js.map
\ No newline at end of file
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightCallbackContext.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,4BAAeA,KAAK,CAACC,aAAa,CAChCC,SAAS,CACV"}
\ No newline at end of file
import * as React from 'react';
export default /*#__PURE__*/React.createContext(undefined);
//# sourceMappingURL=BottomTabBarHeightContext.js.map
\ No newline at end of file
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightContext.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,4BAAeA,KAAK,CAACC,aAAa,CAAqBC,SAAS,CAAC"}
\ No newline at end of file
import * as React from 'react';
import BottomTabBarHeightContext from './BottomTabBarHeightContext';
export default function useBottomTabBarHeight() {
const height = React.useContext(BottomTabBarHeightContext);
if (height === undefined) {
throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");
}
return height;
}
//# sourceMappingURL=useBottomTabBarHeight.js.map
\ No newline at end of file
{"version":3,"names":["React","BottomTabBarHeightContext","useBottomTabBarHeight","height","useContext","undefined","Error"],"sourceRoot":"../../src","sources":["useBottomTabBarHeight.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,yBAAyB,MAAM,6BAA6B;AAEnE,eAAe,SAASC,qBAAqB,GAAG;EAC9C,MAAMC,MAAM,GAAGH,KAAK,CAACI,UAAU,CAACH,yBAAyB,CAAC;EAE1D,IAAIE,MAAM,KAAKE,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,2FAA2F,CAC5F;EACH;EAEA,OAAOH,MAAM;AACf"}
\ No newline at end of file
import * as React from 'react';
import { Keyboard, Platform } from 'react-native';
export default function useIsKeyboardShown() {
const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);
React.useEffect(() => {
const handleKeyboardShow = () => setIsKeyboardShown(true);
const handleKeyboardHide = () => setIsKeyboardShown(false);
let subscriptions;
if (Platform.OS === 'ios') {
subscriptions = [Keyboard.addListener('keyboardWillShow', handleKeyboardShow), Keyboard.addListener('keyboardWillHide', handleKeyboardHide)];
} else {
subscriptions = [Keyboard.addListener('keyboardDidShow', handleKeyboardShow), Keyboard.addListener('keyboardDidHide', handleKeyboardHide)];
}
return () => {
subscriptions.forEach(s => s.remove());
};
}, []);
return isKeyboardShown;
}
//# sourceMappingURL=useIsKeyboardShown.js.map
\ No newline at end of file
{"version":3,"names":["React","Keyboard","Platform","useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","OS","addListener","forEach","s","remove"],"sourceRoot":"../../src","sources":["useIsKeyboardShown.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAA8BC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAEtE,eAAe,SAASC,kBAAkB,GAAG;EAC3C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGL,KAAK,CAACM,QAAQ,CAAC,KAAK,CAAC;EAEnEN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMH,kBAAkB,CAAC,IAAI,CAAC;IACzD,MAAMI,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,KAAK,CAAC;IAE1D,IAAIK,aAAoC;IAExC,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE;MACzBD,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAW,CAAC,kBAAkB,EAAEJ,kBAAkB,CAAC,EAC5DP,QAAQ,CAACW,WAAW,CAAC,kBAAkB,EAAEH,kBAAkB,CAAC,CAC7D;IACH,CAAC,MAAM;MACLC,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAW,CAAC,iBAAiB,EAAEJ,kBAAkB,CAAC,EAC3DP,QAAQ,CAACW,WAAW,CAAC,iBAAiB,EAAEH,kBAAkB,CAAC,CAC5D;IACH;IAEA,OAAO,MAAM;MACXC,aAAa,CAACG,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,EAAE,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOX,eAAe;AACxB"}
\ No newline at end of file
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { useTheme } from '@react-navigation/native';
import color from 'color';
import * as React from 'react';
import { Animated, StyleSheet } from 'react-native';
export default function Badge(_ref) {
let {
children,
style,
visible = true,
size = 18,
...rest
} = _ref;
const [opacity] = React.useState(() => new Animated.Value(visible ? 1 : 0));
const [rendered, setRendered] = React.useState(visible);
const theme = useTheme();
React.useEffect(() => {
if (!rendered) {
return;
}
Animated.timing(opacity, {
toValue: visible ? 1 : 0,
duration: 150,
useNativeDriver: true
}).start(_ref2 => {
let {
finished
} = _ref2;
if (finished && !visible) {
setRendered(false);
}
});
return () => opacity.stopAnimation();
}, [opacity, rendered, visible]);
if (!rendered) {
if (visible) {
setRendered(true);
} else {
return null;
}
}
// @ts-expect-error: backgroundColor definitely exists
const {
backgroundColor = theme.colors.notification,
...restStyle
} = StyleSheet.flatten(style) || {};
const textColor = color(backgroundColor).isLight() ? 'black' : 'white';
const borderRadius = size / 2;
const fontSize = Math.floor(size * 3 / 4);
return /*#__PURE__*/React.createElement(Animated.Text, _extends({
numberOfLines: 1,
style: [{
transform: [{
scale: opacity.interpolate({
inputRange: [0, 1],
outputRange: [0.5, 1]
})
}],
color: textColor,
lineHeight: size - 1,
height: size,
minWidth: size,
opacity,
backgroundColor,
fontSize,
borderRadius
}, styles.container, restStyle]
}, rest), children);
}
const styles = StyleSheet.create({
container: {
alignSelf: 'flex-end',
textAlign: 'center',
paddingHorizontal: 4,
overflow: 'hidden'
}
});
//# sourceMappingURL=Badge.js.map
\ No newline at end of file
{"version":3,"names":["useTheme","color","React","Animated","StyleSheet","Badge","children","style","visible","size","rest","opacity","useState","Value","rendered","setRendered","theme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","flatten","textColor","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAaC,UAAU,QAAmB,cAAc;AAqBzE,eAA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B,KAAK,CAACwB,eAAe,CAAC,CAACM,OAAO,EAAE,GAAG,OAAO,GAAG,OAAO;EAEtE,MAAMC,YAAY,GAAGvB,IAAI,GAAG,CAAC;EAC7B,MAAMwB,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAAE1B,IAAI,GAAG,CAAC,GAAI,CAAC,CAAC;EAE3C,oBACE,oBAAC,QAAQ,CAAC,IAAI;IACZ,aAAa,EAAE,CAAE;IACjB,KAAK,EAAE,CACL;MACE2B,SAAS,EAAE,CACT;QACEC,KAAK,EAAE1B,OAAO,CAAC2B,WAAW,CAAC;UACzBC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;UAClBC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;MACH,CAAC,CACF;MACDvC,KAAK,EAAE6B,SAAS;MAChBW,UAAU,EAAEhC,IAAI,GAAG,CAAC;MACpBiC,MAAM,EAAEjC,IAAI;MACZkC,QAAQ,EAAElC,IAAI;MACdE,OAAO;MACPc,eAAe;MACfQ,QAAQ;MACRD;IACF,CAAC,EACDY,MAAM,CAACC,SAAS,EAChBjB,SAAS;EACT,GACElB,IAAI,GAEPJ,QAAQ,CACK;AAEpB;AAEA,MAAMsC,MAAM,GAAGxC,UAAU,CAAC0C,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UAAU;IACrBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
\ No newline at end of file
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { Link, useTheme } from '@react-navigation/native';
import Color from 'color';
import React from 'react';
import { Platform, Pressable, StyleSheet, Text } from 'react-native';
import TabBarIcon from './TabBarIcon';
export default function BottomTabBarItem(_ref) {
let {
focused,
route,
descriptor,
label,
icon,
badge,
badgeStyle,
to,
button = _ref2 => {
let {
children,
style,
onPress,
to,
accessibilityRole,
...rest
} = _ref2;
if (Platform.OS === 'web' && to) {
// React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
// We need to use `onClick` to be able to prevent default browser handling of links.
return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
to: to,
style: [styles.button, style],
onPress: e => {
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
// ignore clicks with modifier keys
e.button == null || e.button === 0) // ignore everything but left clicks
) {
e.preventDefault();
onPress === null || onPress === void 0 ? void 0 : onPress(e);
}
}
}), children);
} else {
return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
accessibilityRole: accessibilityRole,
onPress: onPress,
style: style
}), children);
}
},
accessibilityLabel,
testID,
onPress,
onLongPress,
horizontal,
activeTintColor: customActiveTintColor,
inactiveTintColor: customInactiveTintColor,
activeBackgroundColor = 'transparent',
inactiveBackgroundColor = 'transparent',
showLabel = true,
allowFontScaling,
labelStyle,
iconStyle,
style
} = _ref;
const {
colors
} = useTheme();
const activeTintColor = customActiveTintColor === undefined ? colors.primary : customActiveTintColor;
const inactiveTintColor = customInactiveTintColor === undefined ? Color(colors.text).mix(Color(colors.card), 0.5).hex() : customInactiveTintColor;
const renderLabel = _ref3 => {
let {
focused
} = _ref3;
if (showLabel === false) {
return null;
}
const color = focused ? activeTintColor : inactiveTintColor;
if (typeof label === 'string') {
return /*#__PURE__*/React.createElement(Text, {
numberOfLines: 1,
style: [styles.label, {
color
}, horizontal ? styles.labelBeside : styles.labelBeneath, labelStyle],
allowFontScaling: allowFontScaling
}, label);
}
const {
options
} = descriptor;
const children = typeof options.tabBarLabel === 'string' ? options.tabBarLabel : options.title !== undefined ? options.title : route.name;
return label({
focused,
color,
position: horizontal ? 'beside-icon' : 'below-icon',
children
});
};
const renderIcon = _ref4 => {
let {
focused
} = _ref4;
if (icon === undefined) {
return null;
}
const activeOpacity = focused ? 1 : 0;
const inactiveOpacity = focused ? 0 : 1;
return /*#__PURE__*/React.createElement(TabBarIcon, {
route: route,
horizontal: horizontal,
badge: badge,
badgeStyle: badgeStyle,
activeOpacity: activeOpacity,
inactiveOpacity: inactiveOpacity,
activeTintColor: activeTintColor,
inactiveTintColor: inactiveTintColor,
renderIcon: icon,
style: iconStyle
});
};
const scene = {
route,
focused
};
const backgroundColor = focused ? activeBackgroundColor : inactiveBackgroundColor;
return button({
to,
onPress,
onLongPress,
testID,
accessibilityLabel,
// FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS
accessibilityRole: Platform.select({
ios: 'button',
default: 'tab'
}),
accessibilityState: {
selected: focused
},
// @ts-expect-error: keep for compatibility with older React Native versions
accessibilityStates: focused ? ['selected'] : [],
style: [styles.tab, {
backgroundColor
}, horizontal ? styles.tabLandscape : styles.tabPortrait, style],
children: /*#__PURE__*/React.createElement(React.Fragment, null, renderIcon(scene), renderLabel(scene))
});
}
const styles = StyleSheet.create({
tab: {
flex: 1,
alignItems: 'center'
},
tabPortrait: {
justifyContent: 'flex-end',
flexDirection: 'column'
},
tabLandscape: {
justifyContent: 'center',
flexDirection: 'row'
},
label: {
textAlign: 'center',
backgroundColor: 'transparent'
},
labelBeneath: {
fontSize: 10
},
labelBeside: {
fontSize: 13,
marginLeft: 20,
marginTop: 3
},
button: {
display: 'flex'
}
});
//# sourceMappingURL=BottomTabItem.js.map
\ No newline at end of file
{"version":3,"names":["Link","useTheme","Color","React","Platform","Pressable","StyleSheet","Text","TabBarIcon","BottomTabBarItem","focused","route","descriptor","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","undefined","primary","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","options","tabBarLabel","title","name","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"sourceRoot":"../../src","sources":["BottomTabItem.tsx"],"mappings":";AAAA,SAASA,IAAI,EAASC,QAAQ,QAAQ,0BAA0B;AAChE,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAEEC,QAAQ,EACRC,SAAS,EAETC,UAAU,EACVC,IAAI,QAGC,cAAc;AAOrB,OAAOC,UAAU,MAAM,cAAc;AA+GrC,eAAe,SAASC,gBAAgB,OAiE9B;EAAA,IAjE+B;IACvCC,OAAO;IACPC,KAAK;IACLC,UAAU;IACVC,KAAK;IACLC,IAAI;IACJC,KAAK;IACLC,UAAU;IACVC,EAAE;IACFC,MAAM,GAAG,SAOsB;MAAA,IAPrB;QACRC,QAAQ;QACRC,KAAK;QACLC,OAAO;QACPJ,EAAE;QACFK,iBAAiB;QACjB,GAAGC;MACoB,CAAC;MACxB,IAAInB,QAAQ,CAACoB,EAAE,KAAK,KAAK,IAAIP,EAAE,EAAE;QAC/B;QACA;QACA,oBACE,oBAAC,IAAI,eACCM,IAAI;UACR,EAAE,EAAEN,EAAG;UACP,KAAK,EAAE,CAACQ,MAAM,CAACP,MAAM,EAAEE,KAAK,CAAE;UAC9B,OAAO,EAAGM,CAAM,IAAK;YACnB,IACE,EAAEA,CAAC,CAACC,OAAO,IAAID,CAAC,CAACE,MAAM,IAAIF,CAAC,CAACG,OAAO,IAAIH,CAAC,CAACI,QAAQ,CAAC;YAAI;YACtDJ,CAAC,CAACR,MAAM,IAAI,IAAI,IAAIQ,CAAC,CAACR,MAAM,KAAK,CAAC,CAAC,CAAC;YAAA,EACrC;cACAQ,CAAC,CAACK,cAAc,EAAE;cAClBV,OAAO,aAAP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IACFI,OAAO;IACPa,WAAW;IACXD,MAAM;IACND,kBAAkB;IAClB;IACAV,iBAAiB,EAAElB,QAAQ,CAAC+D,MAAM,CAAC;MAAEC,GAAG,EAAE,QAAQ;MAAEC,OAAO,EAAE;IAAM,CAAC,CAAC;IACrEC,kBAAkB,EAAE;MAAEC,QAAQ,EAAE7D;IAAQ,CAAC;IACzC;IACA8D,mBAAmB,EAAE9D,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE;IAChDU,KAAK,EAAE,CACLK,MAAM,CAACgD,GAAG,EACV;MAAEP;IAAgB,CAAC,EACnB/B,UAAU,GAAGV,MAAM,CAACiD,YAAY,GAAGjD,MAAM,CAACkD,WAAW,EACrDvD,KAAK,CACN;IACDD,QAAQ,eACN,oBAAC,KAAK,CAAC,QAAQ,QACZ2C,UAAU,CAACG,KAAK,CAAC,EACjBZ,WAAW,CAACY,KAAK,CAAC;EAGzB,CAAC,CAAC;AACJ;AAEA,MAAMxC,MAAM,GAAGnB,UAAU,CAACsE,MAAM,CAAC;EAC/BH,GAAG,EAAE;IACHI,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACDH,WAAW,EAAE;IACXI,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE;EACjB,CAAC;EACDN,YAAY,EAAE;IACZK,cAAc,EAAE,QAAQ;IACxBC,aAAa,EAAE;EACjB,CAAC;EACDnE,KAAK,EAAE;IACLoE,SAAS,EAAE,QAAQ;IACnBf,eAAe,EAAE;EACnB,CAAC;EACDV,YAAY,EAAE;IACZ0B,QAAQ,EAAE;EACZ,CAAC;EACD3B,WAAW,EAAE;IACX2B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE;EACb,CAAC;EACDlE,MAAM,EAAE;IACNmE,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
\ No newline at end of file
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
import * as React from 'react';
import { Platform, StyleSheet } from 'react-native';
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
import BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';
import BottomTabBarHeightContext from '../utils/BottomTabBarHeightContext';
import BottomTabBar, { getTabBarHeight } from './BottomTabBar';
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
export default function BottomTabView(props) {
const {
tabBar = props => /*#__PURE__*/React.createElement(BottomTabBar, props),
state,
navigation,
descriptors,
safeAreaInsets,
detachInactiveScreens = Platform.OS === 'web' || Platform.OS === 'android' || Platform.OS === 'ios',
sceneContainerStyle
} = props;
const focusedRouteKey = state.routes[state.index].key;
const [loaded, setLoaded] = React.useState([focusedRouteKey]);
if (!loaded.includes(focusedRouteKey)) {
setLoaded([...loaded, focusedRouteKey]);
}
const dimensions = SafeAreaProviderCompat.initialMetrics.frame;
const [tabBarHeight, setTabBarHeight] = React.useState(() => getTabBarHeight({
state,
descriptors,
dimensions,
layout: {
width: dimensions.width,
height: 0
},
insets: {
...SafeAreaProviderCompat.initialMetrics.insets,
...props.safeAreaInsets
},
style: descriptors[state.routes[state.index].key].options.tabBarStyle
}));
const renderTabBar = () => {
return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, insets => tabBar({
state: state,
descriptors: descriptors,
navigation: navigation,
insets: {
top: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.top) ?? (insets === null || insets === void 0 ? void 0 : insets.top) ?? 0,
right: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.right) ?? (insets === null || insets === void 0 ? void 0 : insets.right) ?? 0,
bottom: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.bottom) ?? (insets === null || insets === void 0 ? void 0 : insets.bottom) ?? 0,
left: (safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.left) ?? (insets === null || insets === void 0 ? void 0 : insets.left) ?? 0
}
}));
};
const {
routes
} = state;
return /*#__PURE__*/React.createElement(SafeAreaProviderCompat, null, /*#__PURE__*/React.createElement(MaybeScreenContainer, {
enabled: detachInactiveScreens,
hasTwoStates: true,
style: styles.container
}, routes.map((route, index) => {
const descriptor = descriptors[route.key];
const {
lazy = true,
unmountOnBlur
} = descriptor.options;
const isFocused = state.index === index;
if (unmountOnBlur && !isFocused) {
return null;
}
if (lazy && !loaded.includes(route.key) && !isFocused) {
// Don't render a lazy screen if we've never navigated to it
return null;
}
const {
freezeOnBlur,
header = _ref => {
let {
layout,
options
} = _ref;
return /*#__PURE__*/React.createElement(Header, _extends({}, options, {
layout: layout,
title: getHeaderTitle(options, route.name)
}));
},
headerShown,
headerStatusBarHeight,
headerTransparent
} = descriptor.options;
return /*#__PURE__*/React.createElement(MaybeScreen, {
key: route.key,
style: [StyleSheet.absoluteFill, {
zIndex: isFocused ? 0 : -1
}],
visible: isFocused,
enabled: detachInactiveScreens,
freezeOnBlur: freezeOnBlur
}, /*#__PURE__*/React.createElement(BottomTabBarHeightContext.Provider, {
value: tabBarHeight
}, /*#__PURE__*/React.createElement(Screen, {
focused: isFocused,
route: descriptor.route,
navigation: descriptor.navigation,
headerShown: headerShown,
headerStatusBarHeight: headerStatusBarHeight,
headerTransparent: headerTransparent,
header: header({
layout: dimensions,
route: descriptor.route,
navigation: descriptor.navigation,
options: descriptor.options
}),
style: sceneContainerStyle
}, descriptor.render())));
})), /*#__PURE__*/React.createElement(BottomTabBarHeightCallbackContext.Provider, {
value: setTabBarHeight
}, renderTabBar()));
}
const styles = StyleSheet.create({
container: {
flex: 1,
overflow: 'hidden'
}
});
//# sourceMappingURL=BottomTabView.js.map
\ No newline at end of file
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","React","Platform","StyleSheet","SafeAreaInsetsContext","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","BottomTabBar","getTabBarHeight","MaybeScreen","MaybeScreenContainer","BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","useState","includes","dimensions","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","name","headerShown","headerStatusBarHeight","headerTransparent","absoluteFill","zIndex","render","create","flex","overflow"],"sourceRoot":"../../src","sources":["BottomTabView.tsx"],"mappings":";AAAA,SACEA,cAAc,EACdC,MAAM,EACNC,sBAAsB,EACtBC,MAAM,QACD,4BAA4B;AAKnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SAASC,qBAAqB,QAAQ,gCAAgC;AAUtE,OAAOC,iCAAiC,MAAM,4CAA4C;AAC1F,OAAOC,yBAAyB,MAAM,oCAAoC;AAC1E,OAAOC,YAAY,IAAIC,eAAe,QAAQ,gBAAgB;AAC9D,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,kBAAkB;AAQpE,eAAe,SAASC,aAAa,CAACC,KAAY,EAAE;EAClD,MAAM;IACJC,MAAM,GAAID,KAAwB,iBAAK,oBAAC,YAAY,EAAKA,KAAK,CAAI;IAClEE,KAAK;IACLC,UAAU;IACVC,WAAW;IACXC,cAAc;IACdC,qBAAqB,GAAGhB,QAAQ,CAACiB,EAAE,KAAK,KAAK,IAC3CjB,QAAQ,CAACiB,EAAE,KAAK,SAAS,IACzBjB,QAAQ,CAACiB,EAAE,KAAK,KAAK;IACvBC;EACF,CAAC,GAAGR,KAAK;EAET,MAAMS,eAAe,GAAGP,KAAK,CAACQ,MAAM,CAACR,KAAK,C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() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { ResourceSavingView } from '@react-navigation/elements';
import * as React from 'react';
import { View } from 'react-native';
let Screens;
try {
Screens = require('react-native-screens');
} catch (e) {
// Ignore
}
export const MaybeScreenContainer = _ref => {
var _Screens, _Screens$screensEnabl;
let {
enabled,
...rest
} = _ref;
if ((_Screens = Screens) !== null && _Screens !== void 0 && (_Screens$screensEnabl = _Screens.screensEnabled) !== null && _Screens$screensEnabl !== void 0 && _Screens$screensEnabl.call(_Screens)) {
return /*#__PURE__*/React.createElement(Screens.ScreenContainer, _extends({
enabled: enabled
}, rest));
}
return /*#__PURE__*/React.createElement(View, rest);
};
export function MaybeScreen(_ref2) {
var _Screens2, _Screens2$screensEnab;
let {
visible,
children,
...rest
} = _ref2;
if ((_Screens2 = Screens) !== null && _Screens2 !== void 0 && (_Screens2$screensEnab = _Screens2.screensEnabled) !== null && _Screens2$screensEnab !== void 0 && _Screens2$screensEnab.call(_Screens2)) {
return /*#__PURE__*/React.createElement(Screens.Screen, _extends({
activityState: visible ? 2 : 0
}, rest), children);
}
return /*#__PURE__*/React.createElement(ResourceSavingView, _extends({
visible: visible
}, rest), children);
}
//# sourceMappingURL=ScreenFallback.js.map
\ No newline at end of file
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sourceRoot":"../../src","sources":["ScreenFallback.tsx"],"mappings":";AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAoBC,IAAI,QAA8B,cAAc;AAUpE,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC;EACC,gBAAIL,OAAO,8DAAP,SAASM,cAAc,kDAAvB,oCAA2B,EAAE;IAC/B,oBAAO,oBAAC,OAAO,CAAC,eAAe;MAAC,OAAO,EAAEF;IAAQ,GAAKC,IAAI,EAAI;EAChE;EAEA,oBAAO,oBAAC,IAAI,EAAKA,IAAI,CAAI;AAC3B,CAAC;AAED,OAAO,SAASE,WAAW,QAAwC;EAAA;EAAA,IAAvC;IAAEC,OAAO;IAAEC,QAAQ;IAAE,GAAGJ;EAAY,CAAC;EAC/D,iBAAIL,OAAO,+DAAP,UAASM,cAAc,kDAAvB,qCAA2B,EAAE;IAC/B,oBACE,oBAAC,OAAO,CAAC,MAAM;MAAC,aAAa,EAAEE,OAAO,GAAG,CAAC,GAAG;IAAE,GAAKH,IAAI,GACrDI,QAAQ,CACM;EAErB;EAEA,oBACE,oBAAC,kBAAkB;IAAC,OAAO,EAAED;EAAQ,GAAKH,IAAI,GAC3CI,QAAQ,CACU;AAEzB"}
\ No newline at end of file
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Badge from './Badge';
export default function TabBarIcon(_ref) {
let {
route: _,
horizontal,
badge,
badgeStyle,
activeOpacity,
inactiveOpacity,
activeTintColor,
inactiveTintColor,
renderIcon,
style
} = _ref;
const size = 25;
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them.
return /*#__PURE__*/React.createElement(View, {
style: [horizontal ? styles.iconHorizontal : styles.iconVertical, style]
}, /*#__PURE__*/React.createElement(View, {
style: [styles.icon, {
opacity: activeOpacity
}]
}, renderIcon({
focused: true,
size,
color: activeTintColor
})), /*#__PURE__*/React.createElement(View, {
style: [styles.icon, {
opacity: inactiveOpacity
}]
}, renderIcon({
focused: false,
size,
color: inactiveTintColor
})), /*#__PURE__*/React.createElement(Badge, {
visible: badge != null,
style: [styles.badge, horizontal ? styles.badgeHorizontal : styles.badgeVertical, badgeStyle],
size: size * 3 / 4
}, badge));
}
const styles = StyleSheet.create({
icon: {
// We render the icon twice at the same position on top of each other:
// active and inactive one, so we can fade between them:
// Cover the whole iconContainer:
position: 'absolute',
alignSelf: 'center',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
width: '100%',
// Workaround for react-native >= 0.54 layout bug
minWidth: 25
},
iconVertical: {
flex: 1
},
iconHorizontal: {
height: '100%',
marginTop: 3
},
badge: {
position: 'absolute',
left: 3
},
badgeVertical: {
top: 3
},
badgeHorizontal: {
top: 7
}
});
//# sourceMappingURL=TabBarIcon.js.map
\ No newline at end of file
{"version":3,"names":["React","StyleSheet","View","Badge","TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","flex","marginTop","left","top"],"sourceRoot":"../../src","sources":["TabBarIcon.tsx"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAErB,OAAOC,KAAK,MAAM,SAAS;AAmB3B,eAAe,SAASC,UAAU,OAWxB;EAAA,IAXyB;IACjCC,KAAK,EAAEC,CAAC;IACRC,UAAU;IACVC,KAAK;IACLC,UAAU;IACVC,aAAa;IACbC,eAAe;IACfC,eAAe;IACfC,iBAAiB;IACjBC,UAAU;IACVC;EACK,CAAC;EACN,MAAMC,IAAI,GAAG,EAAE;;EAEf;EACA;EACA,oBACE,oBAAC,IAAI;IACH,KAAK,EAAE,CAACT,UAAU,GAAGU,MAAM,CAACC,cAAc,GAAGD,MAAM,CAACE,YAAY,EAAEJ,KAAK;EAAE,gBAEzE,oBAAC,IAAI;IAAC,KAAK,EAAE,CAACE,MAAM,CAACG,IAAI,EAAE;MAAEC,OAAO,EAAEX;IAAc,CAAC;EAAE,GACpDI,UAAU,CAAC;IACVQ,OAAO,EAAE,IAAI;IACbN,IAAI;IACJO,KAAK,EAAEX;EACT,CAAC,CAAC,CACG,eACP,oBAAC,IAAI;IAAC,KAAK,EAAE,CAACK,MAAM,CAACG,IAAI,EAAE;MAAEC,OAAO,EAAEV;IAAgB,CAAC;EAAE,GACtDG,UAAU,CAAC;IACVQ,OAAO,EAAE,KAAK;IACdN,IAAI;IACJO,KAAK,EAAEV;EACT,CAAC,CAAC,CACG,eACP,oBAAC,KAAK;IACJ,OAAO,EAAEL,KAAK,IAAI,IAAK;IACvB,KAAK,EAAE,CACLS,MAAM,CAACT,KAAK,EACZD,UAAU,GAAGU,MAAM,CAACO,eAAe,GAAGP,MAAM,CAACQ,aAAa,EAC1DhB,UAAU,CACV;IACF,IAAI,EAAGO,IAAI,GAAG,CAAC,GAAI;EAAE,GAEpBR,KAAK,CACA,CACH;AAEX;AAEA,MAAMS,MAAM,GAAGhB,UAAU,CAACyB,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJ;IACA;IACA;IACAO,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE,MAAM;IACb;IACAC,QAAQ,EAAE;EACZ,CAAC;EACDd,YAAY,EAAE;IACZe,IAAI,EAAE;EACR,CAAC;EACDhB,cAAc,EAAE;IACda,MAAM,EAAE,MAAM;IACdI,SAAS,EAAE;EACb,CAAC;EACD3B,KAAK,EAAE;IACLmB,QAAQ,EAAE,UAAU;IACpBS,IAAI,EAAE;EACR,CAAC;EACDX,aAAa,EAAE;IACbY,GAAG,EAAE;EACP,CAAC;EACDb,eAAe,EAAE;IACfa,GAAG,EAAE;EACP;AACF,CAAC,CAAC"}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment