feat(common): move confirmation modal to his own store, and add 'onClosed' event
This commit is contained in:
@@ -6,7 +6,7 @@ import Buttons from "./Buttons.vue";
|
||||
import ButtonSelector from "~/components/Common/ButtonSelector.vue";
|
||||
|
||||
const store = useContactStore();
|
||||
const { open: openModal, state: modalState } = useConfirmationModal();
|
||||
const confirmationModal = useConfirmationModal();
|
||||
|
||||
const ACTIONS = {
|
||||
github: ["Open", "Github profile", "https://github.com/pihkaal"],
|
||||
@@ -59,7 +59,7 @@ const actionateButton = async (button: (typeof selectedButton)["value"]) => {
|
||||
}
|
||||
} else {
|
||||
const url = content.replace(/^https?:\/\//, "");
|
||||
openModal({
|
||||
confirmationModal.open({
|
||||
text: `Open ${url}?`,
|
||||
onConfirm: async () => {
|
||||
store.pushNotification(`${verb} opened`);
|
||||
@@ -92,7 +92,7 @@ const actionateButton = async (button: (typeof selectedButton)["value"]) => {
|
||||
<CommonConfirmationModal />
|
||||
<CommonButtons
|
||||
:y-offset="
|
||||
store.isIntro ? store.intro.barOffsetY : modalState.buttonsYOffset
|
||||
store.isIntro ? store.intro.barOffsetY : confirmationModal.buttonsYOffset
|
||||
"
|
||||
:opacity="
|
||||
store.isIntro
|
||||
|
||||
Reference in New Issue
Block a user