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