Skip to content

Commit 37f2d31

Browse files
committed
fix: support mail and phone clickable on mobile
1 parent ea44b81 commit 37f2d31

3 files changed

Lines changed: 10 additions & 25 deletions

File tree

components/composite/StepComplete/SupportMessage/index.tsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ export const SupportMessage: React.FC<Props> = ({
99
supportPhone,
1010
supportEmail,
1111
}) => {
12-
const handleEmail = () => {
13-
return window.open(`mailto:${supportEmail}`)
14-
}
15-
16-
const handlePhone = () => {
17-
return window.open(`tel:${supportEmail}`)
18-
}
19-
2012
const setI18nKey = () => {
2113
if (supportPhone && supportEmail) {
2214
return "stepComplete.fullSupport"
@@ -38,18 +30,11 @@ export const SupportMessage: React.FC<Props> = ({
3830
i18nKey={setI18nKey()}
3931
values={{ email: supportEmail, phone: supportPhone }}
4032
components={{
41-
WrapperEmail: (
42-
<strong
43-
className="text-black border-b border-gray-400 cursor-pointer"
44-
onClick={handleEmail}
45-
/>
46-
),
47-
WrapperPhone: (
48-
<strong
49-
className="text-black border-b border-gray-400 cursor-pointer"
50-
onClick={handlePhone}
51-
/>
33+
WrapperStyle: (
34+
<strong className="text-black border-b border-gray-400 cursor-pointer" />
5235
),
36+
WrapperEmail: <a href={`mailto:${supportEmail}`} />,
37+
WrapperPhone: <a href={`tel:${supportPhone}`} />,
5338
}}
5439
/>
5540
)

public/static/locales/en/common.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@
117117
"title": "Order successfully placed!",
118118
"description": "Your order No: <WrapperOrderId>#{{orderNumber}}</WrapperOrderId>",
119119
"continue": "Continue shopping",
120-
"supportEmail": "If you have any questions about your order, you can email us at <br /><WrapperEmail>{{email}}</WrapperEmail>",
121-
"supportPhone": "If you have any questions about your order, you can call us at <br /><WrapperPhone>{{phone}}</WrapperPhone>",
122-
"fullSupport": "If you have any questions about your order, you can email us at <br /><WrapperEmail>{{email}}</WrapperEmail> or call us at <WrapperPhone>{{phone}}</WrapperPhone>",
120+
"supportEmail": "If you have any questions about your order, you can email us at <br /><WrapperStyle><WrapperEmail>{{email}}</WrapperEmail></WrapperStyle>",
121+
"supportPhone": "If you have any questions about your order, you can call us at <br /><WrapperStyle><WrapperPhone>{{phone}}</WrapperPhone></WrapperStyle>",
122+
"fullSupport": "If you have any questions about your order, you can email us at <br /><WrapperStyle><WrapperEmail>{{email}}</WrapperEmail></WrapperStyle> or call us at <WrapperStyle><WrapperPhone>{{phone}}</WrapperPhone></WrapperStyle>",
123123
"ship_to": "Shipped to:",
124124
"billed_to": "Billed to:",
125125
"payment": "Payment:",

public/static/locales/it/common.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@
117117
"title": "Ordine effettuato con successo!",
118118
"description": "Il tuo ordine No: <WrapperOrderId>#{{orderNumber}}</WrapperOrderId>",
119119
"continue": "Continua lo shopping",
120-
"supportEmail": "Se hai domande sul tuo ordine, puoi inviarci un'e-mail a <WrapperEmail>{{email}}</WrapperEmail>",
121-
"supportPhone": "Se hai domande sul tuo ordine, puoi chiamarci al numero <WrapperPhone>{{phone}}</WrapperPhone>",
122-
"fullSupport": "Se hai domande sul tuo ordine, puoi inviarci un'email a <WrapperEmail>{{email}}</WrapperEmail> o chiamarci al <WrapperPhone>{{phone}}</WrapperPhone>",
120+
"supportEmail": "Se hai domande sul tuo ordine, puoi inviarci un'e-mail a <br /><WrapperStyle><WrapperEmail>{{email}}</WrapperEmail></WrapperStyle>",
121+
"supportPhone": "Se hai domande sul tuo ordine, puoi chiamarci al numero <br /><WrapperStyle><WrapperPhone>{{phone}}</WrapperPhone></WrapperStyle>",
122+
"fullSupport": "Se hai domande sul tuo ordine, puoi inviarci un'email a <br /><WrapperStyle><WrapperEmail>{{email}}</WrapperEmail></WrapperStyle> o chiamarci al <WrapperStyle><WrapperPhone>{{phone}}</WrapperPhone></WrapperStyle>",
123123
"ship_to": "Spedito a:",
124124
"billed_to": "Fatturato a:",
125125
"payment": "Pagamento:",

0 commit comments

Comments
 (0)