diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.jsx index 01ae560ae..f1d6db98c 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.jsx +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.jsx @@ -3,7 +3,7 @@ import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { selectors } from '../../../../../../data/redux'; import analyticsEvents from './constants'; -export const handleSocialSharingCheckboxChange = ({ updateField }) => { +export const useTrackSocialSharingChange = ({ updateField }) => { const analytics = useSelector(selectors.app.analytics); const allowVideoSharing = useSelector(selectors.video.allowVideoSharing); return (event) => { @@ -23,4 +23,4 @@ export const handleSocialSharingCheckboxChange = ({ updateField }) => { }; }; -export default handleSocialSharingCheckboxChange; +export default useTrackSocialSharingChange; diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.test.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.test.jsx index 0bd60ab6a..987b73f83 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.test.jsx +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/hooks.test.jsx @@ -18,14 +18,14 @@ jest.mock('@edx/frontend-platform/analytics', () => ({ })); describe('SocialShareWidget hooks', () => { - describe('handleSocialSharingCheckboxChange when', () => { + describe('useTrackSocialSharingChange when', () => { let onClick; let updateField; describe.each([true, false])('box is toggled', (checked) => { beforeAll(() => { jest.resetAllMocks(); updateField = jest.fn(); - onClick = hooks.handleSocialSharingCheckboxChange({ updateField }); + onClick = hooks.useTrackSocialSharingChange({ updateField }); expect(typeof onClick).toBe('function'); onClick({ target: { checked } }); }); diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx index 66909af2a..37515caa6 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx @@ -33,7 +33,7 @@ export const SocialShareWidget = ({ const isSetByCourse = allowVideoSharing.level === 'course'; const videoSharingEnabled = isLibrary ? videoSharingEnabledForAll : videoSharingEnabledForCourse; const learnMoreLink = videoSharingLearnMoreLink || 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/developing_course/social_sharing.html'; - const onSocialSharingCheckboxChange = hooks.handleSocialSharingCheckboxChange({ updateField }); + const onSocialSharingCheckboxChange = hooks.useTrackSocialSharingChange({ updateField }); const getSubtitle = () => { if (allowVideoSharing.value) {