import React from "react";
import { Text, TouchableOpacity } from "react-native";
import { customeButtons,GetPageTheme } from "../styles/Global";
import { useRoute } from '@react-navigation/native';

const CustomButton = (props) => {
  const route = useRoute();
  // const PageTheme=GetPageTheme(props.DarkTheme,route.name);
  const customeButton=customeButtons(props.DarkMode,route.name);

  return (
    <TouchableOpacity
      activeOpacity={0.6}
      onPress={props.onPress}
      style={customeButton.buttonStyle}>
      <Text style={customeButton.textStyle}>{props.title}</Text>
    </TouchableOpacity>
  );
};
export default CustomButton;