From 2916ab502e04548961b5c6b65abe411af279d770 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Tue, 25 Aug 2020 13:27:59 +0530 Subject: [PATCH] Announcement banner --- assets/css/styles.scss | 2 +- components/layout/pw-header.vue | 58 ++++++++++++++++----------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/assets/css/styles.scss b/assets/css/styles.scss index c09634527..bed9a5dfc 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -662,7 +662,7 @@ section { } .toasted-container .toasted { - justify-content: flex-start !important; + justify-content: space-between !important; } .toasted.info { diff --git a/components/layout/pw-header.vue b/components/layout/pw-header.vue index bd4d5aefe..9f5179be3 100644 --- a/components/layout/pw-header.vue +++ b/components/layout/pw-header.vue @@ -362,34 +362,34 @@ export default { }) } - // let showAd = localStorage.getItem("showAd") === "no" - // if (!showAd) { - // setTimeout(() => { - // this.$toast.clear() - // this.$toast.show( - // "Get De-Coding The Passion Project book, expertly crafted by the creator of Hoppscotch. Whoosh this away to dismiss →", - // { - // icon: "", - // duration: 0, - // theme: "toasted-ad", - // action: [ - // { - // text: "Get", - // icon: "chevron_right", - // onClick: (e, toastObject) => { - // localStorage.setItem("showAd", "no") - // toastObject.goAway(0) - // window.open("https://gum.co/keky") - // }, - // }, - // ], - // onComplete() { - // localStorage.setItem("showAd", "no") - // }, - // } - // ) - // }, 11000) - // } + let showAd = localStorage.getItem("showAd") === "no" + if (!showAd) { + setTimeout(() => { + this.$toast.clear() + this.$toast.show( + "Postwoman is now Hoppscotch 🎉
Read the announcement
Whoosh this away to dismiss.
", + { + icon: "", + duration: 0, + theme: "toasted-ad", + action: [ + { + text: "GitHub", + icon: "chevron_right", + onClick: (e, toastObject) => { + // localStorage.setItem("showAd", "no") + toastObject.goAway(0) + window.open("https://github.com/hoppscotch/hoppscotch") + }, + }, + ], + onComplete() { + // localStorage.setItem("showAd", "no") + }, + } + ) + }, 8000) + } let showExtensionsToast = localStorage.getItem("showExtensionsToast") === "yes" @@ -446,7 +446,7 @@ export default { title: "Hoppscotch", text: "Hoppscotch • A free, fast and beautiful API request builder - Helps you create requests faster, saving precious time on development.", - url: "https://hoppscotch.io/", + url: "https://hoppscotch.io", }) .then(() => {}) .catch(console.error)