popup with object
This commit is contained in:
parent
1675d4f7ff
commit
efb31cc993
3 changed files with 23 additions and 21 deletions
|
|
@ -8,18 +8,7 @@ const TimeInput = require('../components/TimeInput');
|
|||
const BitcoinMethodCheckboxes = require('../components/BitcoinMethodCheckboxes');
|
||||
const TrustCheckboxes = require('../components/TrustCheckboxes');
|
||||
const BigNotesCheckbox = require('../components/BigNotesCheckbox');
|
||||
|
||||
const offerCreatedPopup = document.getElementById('offer-created-confirmation');
|
||||
function toggleOfferCreatedAlert() {
|
||||
offerCreatedPopup.classList.remove('max-size-zero');
|
||||
offerCreatedPopup.classList.add('revealed');
|
||||
setTimeout(() => {
|
||||
offerCreatedPopup.classList.remove('revealed');
|
||||
}, 3000);
|
||||
setTimeout(() => {
|
||||
offerCreatedPopup.classList.add('max-size-zero');
|
||||
}, 4000);
|
||||
}
|
||||
const PopupNotification = require('../components/PopupNotification');
|
||||
|
||||
class CreateOfferModal {
|
||||
// Actual creation logic to be provided by a service
|
||||
|
|
@ -254,12 +243,18 @@ class CreateOfferModal {
|
|||
}
|
||||
|
||||
function offersPage() {
|
||||
const offerCreatedPopup = new PopupNotification({
|
||||
parentElement: document.body,
|
||||
text: '¡Oferta creada! Puedes verla en tus ofertas.',
|
||||
});
|
||||
|
||||
offerCreatedPopup.render();
|
||||
const createOfferModal = new CreateOfferModal({
|
||||
parentElement: document.body,
|
||||
onCreationCallback: async () => {
|
||||
await myOffers.getOffersFromApi();
|
||||
await myOffers.render();
|
||||
await toggleOfferCreatedAlert();
|
||||
offerCreatedPopup.displayTemporarily(3000);
|
||||
},
|
||||
});
|
||||
createOfferModal.render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue