NathanWalker / nativescript-fancyalert

Fancy alerts for NativeScript.
Other
147 stars 38 forks source link

showSuccess dialog doesn't open modal page onButton click #86

Closed adekunle11 closed 4 years ago

adekunle11 commented 4 years ago

I'm trying to open a modal view in this code, it doesn't work but when i navigate to a normal page it works. This is how i normally open modal views


exports.onItemTap = function (args) {
  const view = args.view;
  // const page = view.page;
  const tappedItem = view.bindingContext;
  const mainView = args.object;
  const option = {
    context: tappedItem,
    fullscreen: true,
    animated: true,
    transition: {
      duration: 100,
      curve: "ease"
    }
  };
  mainView.showModal(modalViewModule, option);
}

This is what i am trying below

TNSFancyAlert.showSuccess(
      "Skog",
      res.name,
      "View profile?"
    ).then((args) => {
      const mainView = args.object;
      //alert("done");
      mainView.showModal(
        modalViewModule,
        option = {
        context: { name: res.name, skill: res.skill, number: res.number, profileImg: res.profileIcon },
        fullscreen: true,
        animated: true,
        transition: {
          duration: 100,
          curve: "ease"
        }
      }
      );
      //mainView.showModal(modalViewModule, option);
    });
adekunle11 commented 4 years ago

fixed it already