You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hooks.ts 549B

123456789101112131415161718192021222324
  1. import { useSelector } from 'react-redux';
  2. import { SharedVideoButton } from './components';
  3. import { isSharedVideoEnabled } from './functions';
  4. const shareVideo = {
  5. key: 'sharedvideo',
  6. Content: SharedVideoButton,
  7. group: 3
  8. };
  9. /**
  10. * A hook that returns the shared video button if it is enabled and undefined otherwise.
  11. *
  12. * @returns {Object | undefined}
  13. */
  14. export function useSharedVideoButton() {
  15. const sharedVideoEnabled = useSelector(isSharedVideoEnabled);
  16. if (sharedVideoEnabled) {
  17. return shareVideo;
  18. }
  19. }