-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ display phone number depending on the time
- Loading branch information
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ const LPS = { | |
const IRCGN = { | ||
email: '[email protected]', | ||
phone: '01 78 47 31 46 ', | ||
fixe: '01 78 47 31 46', | ||
phone: '06 07 98 40 09', | ||
} | ||
const shownLPS = ref<null | string>(null) | ||
const showIRCGNModal = ref(false) | ||
|
@@ -46,6 +47,15 @@ function buildMailto (email: string) { | |
return `mailto:${email}?subject=${subject}&body=${body}` | ||
} | ||
const currentPhone = computed(() => { | ||
const currentHour = new Date().getHours() | ||
if (currentHour >= 8 && currentHour < 18) { | ||
return IRCGN.fixe | ||
} else { | ||
return IRCGN.phone | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
|
@@ -242,7 +252,7 @@ function buildMailto (email: string) { | |
<div class="fr-col-11 fr-col-lg-6 mx-auto"> | ||
<p v-if="priority === 'high'"> | ||
Vous trouverez ci-dessous le numéro de téléphone de la permanence de l'IRCGN.<br><br> | ||
<span class="font-bold">{{ IRCGN.phone }}</span> | ||
<span class="font-bold">{{ currentPhone }}</span> | ||
</p> | ||
<p v-if="priority === 'low'"> | ||
Vous trouverez ci-dessous l'adresse mail de la permanence de l'IRCGN.<br><br> | ||
|