您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }