Commit 30b64ab2 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Se creó un boton para ir a la pantalla anterior

parent da12ee17
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
import { TouchableOpacity, StyleSheet } from "react-native";
import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router";

export const FloatingBackButton = () => {
  if (!router.canGoBack()) {
    return null;
  }
  const handleBack = () => {
    router.back();
  };
  return (
    <TouchableOpacity style={styles.back_button} onPress={handleBack}>
      <Ionicons name="arrow-back-outline" size={30} />
    </TouchableOpacity>
  );
};

const styles = StyleSheet.create({
  back_button: {
    position: "absolute",
    top: 15,
    left: 10,
    height: 40,
    width: 40,
    justifyContent: "center",
    alignItems: "center",
    borderRadius: 25,
    backgroundColor: "white",
    borderWidth: 2,
    elevation: 5,
    zIndex: 1,
  },
});