Skip to content

Commit

Permalink
Add contact button back to no results card when phone number available
Browse files Browse the repository at this point in the history
  • Loading branch information
devcshort committed Sep 29, 2023
1 parent a494fb6 commit 65898ca
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
31 changes: 30 additions & 1 deletion packages/client/components/molecules/NoResultsCard.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 (
<Card shadow="sm" p="lg" radius="md" withBorder>
Expand All @@ -33,8 +49,21 @@ export function NoResultsCard(props: Props) {
<Text align="center" color="dimmed">
{!props.showAltSubtitle
? t('no_results.subtitle')
: config?.contact?.number
? t('no_results.need_help')
: t('no_results.alt_subtitle')}
</Text>
<Flex align="center" justify="center" mt="md">
{config?.contact?.number && (
<Button
leftIcon={<IconPhone color={theme.colors.secondary[5]} />}
href={`tel:${config.contact.number}`}
component={Anchor}
>
{config.contact.number}
</Button>
)}
</Flex>
</Card>
);
}
5 changes: 3 additions & 2 deletions packages/client/public/locales/ar/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"no_results": {
"title": "لا توجد نتائج تطابق الاستعلام الخاص بك",
"subtitle": "لقد قدمنا بعض النتائج المماثلة أدناه",
"alt_subtitle": "جرب استعلام أو عامل تصفية مختلف"
"alt_subtitle": "جرب استعلام أو عامل تصفية مختلف",
"need_help": "تحتاج مساعدة؟ لدينا أشخاص يقفون إلى جانبنا."
}
}
}
3 changes: 2 additions & 1 deletion packages/client/public/locales/en/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
3 changes: 2 additions & 1 deletion packages/client/public/locales/es/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
5 changes: 3 additions & 2 deletions packages/client/public/locales/ne/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"no_results": {
"title": "तपाईको क्वेरीसँग मेल खाने कुनै नतिजा फेला परेन",
"subtitle": "हामीले तल केही समान परिणामहरू प्रदान गरेका छौं",
"alt_subtitle": "फरक क्वेरी वा फिल्टर प्रयास गर्नुहोस्"
"alt_subtitle": "फरक क्वेरी वा फिल्टर प्रयास गर्नुहोस्",
"need_help": "सहयोग चाहियो? हामीसँग मानिसहरू उभिएका छन्।"
}
}
}
5 changes: 3 additions & 2 deletions packages/client/public/locales/so/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}
5 changes: 3 additions & 2 deletions packages/client/public/locales/vi/page-search.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}

0 comments on commit 65898ca

Please sign in to comment.