init
This commit is contained in:
commit
44f31f8b9f
402 changed files with 47865 additions and 0 deletions
66
modules/account/modals/index.js
Normal file
66
modules/account/modals/index.js
Normal file
|
@ -0,0 +1,66 @@
|
|||
import { ModalProgrammatic, DialogProgrammatic } from 'buefy'
|
||||
|
||||
import { Settings } from '../dependencies'
|
||||
|
||||
import DecryptInfo from './DecryptInfo.vue'
|
||||
import SetupAccount from './SetupAccount.vue'
|
||||
import SessionUpdate from './SessionUpdate.vue'
|
||||
import RecoverAccount from './RecoverAccount.vue'
|
||||
import ShowRecoverKey from './ShowRecoverKey.vue'
|
||||
|
||||
const openSettingsModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: Settings })
|
||||
}
|
||||
|
||||
const openSetupAccountModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: SetupAccount, canCancel: false })
|
||||
}
|
||||
|
||||
const openDecryptModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: DecryptInfo })
|
||||
}
|
||||
|
||||
const openRecoverAccountModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: RecoverAccount })
|
||||
}
|
||||
|
||||
const openShowRecoverKeyModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: ShowRecoverKey })
|
||||
}
|
||||
|
||||
function createModal({ component, props, parent, ...rest }) {
|
||||
ModalProgrammatic.open({
|
||||
props,
|
||||
parent,
|
||||
component,
|
||||
width: 440,
|
||||
hasModalCard: true,
|
||||
customClass: 'is-pinned',
|
||||
...rest
|
||||
})
|
||||
}
|
||||
|
||||
const openRemoveAccountModal = ({ i18n, onConfirm }) => {
|
||||
DialogProgrammatic.confirm({
|
||||
onConfirm,
|
||||
title: i18n.t('account.modals.removeAccount.title'),
|
||||
type: 'is-primary is-outlined',
|
||||
message: i18n.t('account.modals.removeAccount.description'),
|
||||
cancelText: i18n.t('account.modals.removeAccount.cancel'),
|
||||
confirmText: i18n.t('account.modals.removeAccount.remove')
|
||||
})
|
||||
}
|
||||
|
||||
const openConfirmModal = ({ parent, ...props }) => {
|
||||
createModal({ props, parent, component: SessionUpdate, customClass: 'dialog' })
|
||||
}
|
||||
|
||||
export {
|
||||
openDecryptModal,
|
||||
openConfirmModal,
|
||||
openSettingsModal,
|
||||
openSetupAccountModal,
|
||||
openRemoveAccountModal,
|
||||
openShowRecoverKeyModal,
|
||||
openRecoverAccountModal
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue