import { CommonActions } from '@react-navigation/native';
import { NavigationRoutes } from '../enum';

export const resetToMagicLinkConfirm = ({ email, verificationCode }: MagicLinkProps) =>
  CommonActions.reset({
    index: 0,
    routes: [{ name: NavigationRoutes.MagicLinkConfirm, params: { email, verificationCode } }],
  });

export const resetAfterLogout = () =>
  CommonActions.reset({
    index: 0,
    routes: [{ name: NavigationRoutes.Landing }],
  });

type MagicLinkProps = {
  email: String;
  verificationCode: string;
};
