2019-05-17 04:11:10 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
|
|
|
import CaptionsService from '/imports/ui/components/captions/service';
|
|
|
|
import CaptionsReaderMenuContainer from '/imports/ui/components/actions-bar/captions/reader-menu/container';
|
|
|
|
import CaptionsButton from './component';
|
|
|
|
|
2021-08-09 22:24:02 +08:00
|
|
|
const CaptionsButtonContainer = (props) => <CaptionsButton {...props} />;
|
2019-05-17 04:11:10 +08:00
|
|
|
|
|
|
|
export default withModalMounter(withTracker(({ mountModal }) => ({
|
2019-05-18 04:02:28 +08:00
|
|
|
isActive: CaptionsService.isCaptionsActive(),
|
2019-05-23 22:51:01 +08:00
|
|
|
handleOnClick: () => (CaptionsService.isCaptionsActive()
|
|
|
|
? CaptionsService.deactivateCaptions()
|
|
|
|
: mountModal(<CaptionsReaderMenuContainer />)),
|
2019-05-17 04:11:10 +08:00
|
|
|
}))(CaptionsButtonContainer));
|