2020-04-26 03:03:35 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import Timer from './component';
|
|
|
|
import Service from './service';
|
2020-04-27 01:44:01 +08:00
|
|
|
import { layoutDispatch } from '/imports/ui/components/layout/context';
|
2020-04-26 03:03:35 +08:00
|
|
|
|
2020-04-27 01:44:01 +08:00
|
|
|
const TimerContainer = ({ children, ...props }) => {
|
|
|
|
const layoutContextDispatch = layoutDispatch();
|
|
|
|
return (
|
|
|
|
<Timer {...{ layoutContextDispatch, ...props}}>
|
|
|
|
{children}
|
|
|
|
</Timer>
|
|
|
|
);
|
2020-04-26 03:03:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default withTracker(() => {
|
|
|
|
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
|
|
|
return {
|
|
|
|
isRTL,
|
|
|
|
isActive: Service.isActive(),
|
|
|
|
isModerator: Service.isModerator(),
|
2023-05-16 03:46:44 +08:00
|
|
|
timeOffset: Service.getTimeOffset(),
|
|
|
|
timer: Service.getTimer(),
|
2021-09-03 20:44:16 +08:00
|
|
|
isMusicActive: Service.isMusicActive(),
|
2020-04-26 03:03:35 +08:00
|
|
|
};
|
|
|
|
})(TimerContainer);
|