Skip to content

Commit

Permalink
feat: ✨ display phone number depending on the time
Browse files Browse the repository at this point in the history
  • Loading branch information
nutfdt committed May 27, 2024
1 parent 70af91c commit c724f3c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions frontend/src/views/GuideContactExpert/ExpertSituation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit c724f3c

Please sign in to comment.