From 65898cad28a389063f53d4e382888a9bc0fb7348 Mon Sep 17 00:00:00 2001 From: Chris Short <13677134+devcshort@users.noreply.github.com> Date: Fri, 29 Sep 2023 13:12:11 -0700 Subject: [PATCH] Add contact button back to no results card when phone number available --- .../components/molecules/NoResultsCard.tsx | 31 ++++++++++++++++++- .../client/public/locales/ar/page-search.json | 5 +-- .../client/public/locales/en/page-search.json | 3 +- .../client/public/locales/es/page-search.json | 3 +- .../client/public/locales/ne/page-search.json | 5 +-- .../client/public/locales/so/page-search.json | 5 +-- .../client/public/locales/vi/page-search.json | 5 +-- 7 files changed, 46 insertions(+), 11 deletions(-) diff --git a/packages/client/components/molecules/NoResultsCard.tsx b/packages/client/components/molecules/NoResultsCard.tsx index 7caf0885..5da57142 100644 --- a/packages/client/components/molecules/NoResultsCard.tsx +++ b/packages/client/components/molecules/NoResultsCard.tsx @@ -1,7 +1,21 @@ -import { Card, Group, Mark, Text, Title } from '@mantine/core'; +import { + Box, + Button, + Card, + Flex, + Group, + Mark, + Text, + Title, + useMantineTheme, +} from '@mantine/core'; import { useTranslation } from 'next-i18next'; import Image from 'next/image'; import { NextRouter } from 'next/router'; +import { useAppConfig } from '../../lib/hooks/useAppConfig'; +import Link from 'next/link'; +import { Anchor } from '../atoms/Anchor'; +import { IconPhone } from '@tabler/icons-react'; type Props = { router: NextRouter; @@ -10,6 +24,8 @@ type Props = { export function NoResultsCard(props: Props) { const { t } = useTranslation('page-search'); + const config = useAppConfig() as any; + const theme = useMantineTheme(); return ( @@ -33,8 +49,21 @@ export function NoResultsCard(props: Props) { {!props.showAltSubtitle ? t('no_results.subtitle') + : config?.contact?.number + ? t('no_results.need_help') : t('no_results.alt_subtitle')} + + {config?.contact?.number && ( + + )} + ); } diff --git a/packages/client/public/locales/ar/page-search.json b/packages/client/public/locales/ar/page-search.json index c5a3b476..66a00e7d 100644 --- a/packages/client/public/locales/ar/page-search.json +++ b/packages/client/public/locales/ar/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "لا توجد نتائج تطابق الاستعلام الخاص بك", "subtitle": "لقد قدمنا بعض النتائج المماثلة أدناه", - "alt_subtitle": "جرب استعلام أو عامل تصفية مختلف" + "alt_subtitle": "جرب استعلام أو عامل تصفية مختلف", + "need_help": "تحتاج مساعدة؟ لدينا أشخاص يقفون إلى جانبنا." } -} \ No newline at end of file +} diff --git a/packages/client/public/locales/en/page-search.json b/packages/client/public/locales/en/page-search.json index 5015c16b..1b83c744 100644 --- a/packages/client/public/locales/en/page-search.json +++ b/packages/client/public/locales/en/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "No results found matching your query", "subtitle": "We've provided some similar results below", - "alt_subtitle": "Try a different query or filter" + "alt_subtitle": "Try a different query or filter", + "need_help": "Need help? We have people standing by." } } diff --git a/packages/client/public/locales/es/page-search.json b/packages/client/public/locales/es/page-search.json index 62f93ded..fda3a3ed 100644 --- a/packages/client/public/locales/es/page-search.json +++ b/packages/client/public/locales/es/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "No se encontraron resultados que coincidan con su consulta", "subtitle": "Hemos proporcionado algunos resultados similares a continuación", - "alt_subtitle": "Pruebe con una consulta o filtro diferente" + "alt_subtitle": "Pruebe con una consulta o filtro diferente", + "need_help": "¿Necesitas ayuda? Tenemos gente esperando." } } diff --git a/packages/client/public/locales/ne/page-search.json b/packages/client/public/locales/ne/page-search.json index 7d376b57..659dbf39 100644 --- a/packages/client/public/locales/ne/page-search.json +++ b/packages/client/public/locales/ne/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "तपाईको क्वेरीसँग मेल खाने कुनै नतिजा फेला परेन", "subtitle": "हामीले तल केही समान परिणामहरू प्रदान गरेका छौं", - "alt_subtitle": "फरक क्वेरी वा फिल्टर प्रयास गर्नुहोस्" + "alt_subtitle": "फरक क्वेरी वा फिल्टर प्रयास गर्नुहोस्", + "need_help": "सहयोग चाहियो? हामीसँग मानिसहरू उभिएका छन्।" } -} \ No newline at end of file +} diff --git a/packages/client/public/locales/so/page-search.json b/packages/client/public/locales/so/page-search.json index 4e185613..d876f2bf 100644 --- a/packages/client/public/locales/so/page-search.json +++ b/packages/client/public/locales/so/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "Wax natiijooyin ah lama helin oo ku habboon weydiintaada", "subtitle": "Waxaan ku bixinnay natiijooyin la mid ah hoos", - "alt_subtitle": "Isku day su'aal kale ama shaandhayn" + "alt_subtitle": "Isku day su'aal kale ama shaandhayn", + "need_help": "Ma u baahan tahay caawimo? Waxaan leenahay dad garab taagan." } -} \ No newline at end of file +} diff --git a/packages/client/public/locales/vi/page-search.json b/packages/client/public/locales/vi/page-search.json index 05dd1559..25fafc8c 100644 --- a/packages/client/public/locales/vi/page-search.json +++ b/packages/client/public/locales/vi/page-search.json @@ -7,6 +7,7 @@ "no_results": { "title": "Không tìm thấy kết quả phù hợp với truy vấn của bạn", "subtitle": "Chúng tôi đã cung cấp một số kết quả tương tự bên dưới", - "alt_subtitle": "Hãy thử một truy vấn hoặc bộ lọc khác" + "alt_subtitle": "Hãy thử một truy vấn hoặc bộ lọc khác", + "need_help": "Cần giúp đỡ? Chúng tôi có người đứng bên cạnh." } -} \ No newline at end of file +}