forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site Settings: Add Troubleshoot section to Disconnect JP Flow (Automa…
…ttic#18968) Add a button to get help (either via HappyChat, or the contact form). Implement the mockup found at Automattic#17962 (comment). Note that I've opted to stick with that mockup instead of Automattic#17962 (comment), since it's more consistent with prior art, such as Automattic#18397. This PR uses `jetpack-connect/happychat-button`, to which it adds an `onClick` prop in order to be able to pass the tracking event to it. It unifies some styling that was previously scattered across three different selectors, which ensures that the styling also works for this PR without having to add a fourth selector. (Bonus points for verifying that the styling still works for the other instances -- see testing instructions for Automattic#18397.) It also fixes the `state/analytics` README which I consulted while writing this PR 🙂 Discussion about functionality (what each button is supposed to do) is at Automattic#17962 (comment).
- Loading branch information
Showing
6 changed files
with
61 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
client/my-sites/site-settings/disconnect-site/troubleshoot.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** @format */ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { localize } from 'i18n-calypso'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import JetpackConnectHappychatButton from 'jetpack-connect/happychat-button'; | ||
import HelpButton from 'jetpack-connect/help-button'; | ||
import { recordTracksEvent, withAnalytics } from 'state/analytics/actions'; | ||
|
||
const Troubleshoot = ( { trackSupportClick, translate } ) => ( | ||
<div className="disconnect-site__troubleshooting"> | ||
<JetpackConnectHappychatButton | ||
label={ translate( 'Get help from our Happiness Engineers' ) } | ||
onClick={ trackSupportClick } | ||
> | ||
<HelpButton | ||
label={ translate( 'Get help from our Happiness Engineers' ) } | ||
onClick={ trackSupportClick } | ||
/> | ||
</JetpackConnectHappychatButton> | ||
</div> | ||
); | ||
|
||
export default connect( null, { | ||
trackSupportClick: withAnalytics( | ||
recordTracksEvent( 'calypso_jetpack_disconnect_support_click' ) | ||
), | ||
} )( localize( Troubleshoot ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters