react-code-dataset / wp-calypso /client /landing /subscriptions /tracks /use-record-comment-emails-toggle.tsx
react-code-dataset / wp-calypso /client /landing /subscriptions /tracks /use-record-comment-emails-toggle.tsx
Download wp-calypso/client/landing/subscriptions/tracks/use-record-comment-emails-toggle.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/tracks/use-record-comment-emails-toggle.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/subscriptions/tracks/use-record-comment-emails-toggle.tsx
-
curl -L -o use-record-comment-emails-toggle.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/tracks/use-record-comment-emails-toggle.tsx
672 Bytes
| import useRecordSubscriptionsTracksEvent from './use-record-subscriptions-tracks-event'; | |
| const useRecordCommentEmailsToggle = () => { | |
| const recordSubscriptionsTracksEvent = useRecordSubscriptionsTracksEvent(); | |
| const recordCommentEmailsToggle = ( | |
| enabled: boolean, | |
| tracksProps: { | |
| blog_id: string | null; | |
| } | |
| ) => { | |
| if ( enabled ) { | |
| recordSubscriptionsTracksEvent( | |
| 'calypso_subscriptions_comment_emails_toggle_on', | |
| tracksProps | |
| ); | |
| } else { | |
| recordSubscriptionsTracksEvent( | |
| 'calypso_subscriptions_comment_emails_toggle_off', | |
| tracksProps | |
| ); | |
| } | |
| }; | |
| return recordCommentEmailsToggle; | |
| }; | |
| export default useRecordCommentEmailsToggle; | |