forked from woocommerce/google-listings-and-ads
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit-phone-number.js
More file actions
81 lines (75 loc) · 2.33 KB
/
edit-phone-number.js
File metadata and controls
81 lines (75 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { getSettingsUrl } from '.~/utils/urls';
import TopBar from '.~/components/stepper/top-bar';
import HelpIconButton from '.~/components/help-icon-button';
import useLayout from '.~/hooks/useLayout';
import useGoogleMCPhoneNumber from '.~/hooks/useGoogleMCPhoneNumber';
import Section from '.~/wcdl/section';
import AppDocumentationLink from '.~/components/app-documentation-link';
import PhoneNumberCard from '.~/components/contact-information/phone-number-card';
import usePhoneNumberCheckTrackEventEffect from '.~/components/contact-information/usePhoneNumberCheckTrackEventEffect';
const learnMoreLinkId = 'contact-information-read-more';
const learnMoreUrl =
'https://woo.com/document/google-listings-and-ads/#contact-information';
/**
* Renders the phone number settings page.
*
* @see PhoneNumberCard
* @fires gla_documentation_link_click with `{ context: "settings-phone-number", link_id: "contact-information-read-more", href: "https://woo.com/document/google-listings-and-ads/#contact-information" }`
*/
const EditPhoneNumber = () => {
const phone = useGoogleMCPhoneNumber();
usePhoneNumberCheckTrackEventEffect( phone );
useLayout( 'full-content' );
return (
<>
<TopBar
title={ __( 'Edit phone number', 'google-listings-and-ads' ) }
helpButton={
<HelpIconButton eventContext="edit-phone-number" />
}
backHref={ getSettingsUrl() }
/>
<div className="gla-settings">
<Section
title={ __( 'Phone number', 'google-listings-and-ads' ) }
description={
<div>
<p>
{ __(
'Your phone number is required by Google for verification purposes. It will be shared with the Google Merchant Center and will not be displayed to customers.',
'google-listings-and-ads'
) }
</p>
<p>
<AppDocumentationLink
context={ 'settings-phone-number' }
linkId={ learnMoreLinkId }
href={ learnMoreUrl }
>
{ __(
'Learn more',
'google-listings-and-ads'
) }
</AppDocumentationLink>
</p>
</div>
}
>
<PhoneNumberCard
view="settings"
phoneNumber={ phone }
initEditing={ true }
/>
</Section>
</div>
</>
);
};
export default EditPhoneNumber;