Skip to content
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

feat: ✨ display phone number depending on the time #461

Merged
merged 1 commit into from
May 27, 2024
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
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
Loading