Skip to content

Update Vue School banner copy #1690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .vitepress/theme/components/VueSchoolBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<div class="vs-core">
<div class="vs-slogan">
<div class="vs-slogan-title">
Get up to <strong>40% off</strong> your Vue School Subscription
Extended for <strong>48 hours!</strong>
</div>
<div class="vs-slogan-subtitle">
Time Limited Offer
Get up to 40% off your Vue School Subscription
</div>
</div>
<div class="vs-button">
Expand All @@ -37,7 +37,9 @@ import { ref, onMounted } from 'vue'
const isVisible = ref(false)

onMounted(() => {
isVisible.value = !localStorage.getItem('VS_FW_22_OFFER')
const now = new Date()
const end = new Date('2022-05-04T00:00:00+02:00')
isVisible.value = !localStorage.getItem('VS_FW_22_OFFER') && (now < end)
if (isVisible.value) document.body.classList.add('has-top-banner')
})

Expand Down