2021-09-10 04:49:15 +08:00
|
|
|
import React from 'react';
|
2019-03-16 04:07:14 +08:00
|
|
|
import { Session } from 'meteor/session';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import BannerComponent from './component';
|
2021-09-11 04:48:52 +08:00
|
|
|
import { layoutSelectInput, layoutDispatch } from '../layout/context';
|
2021-07-12 21:22:26 +08:00
|
|
|
|
|
|
|
const BannerContainer = (props) => {
|
2021-09-11 04:48:52 +08:00
|
|
|
const bannerBar = layoutSelectInput((i) => i.bannerBar);
|
2021-07-12 21:22:26 +08:00
|
|
|
const { hasBanner } = bannerBar;
|
2021-09-11 04:48:52 +08:00
|
|
|
const layoutContextDispatch = layoutDispatch();
|
2021-07-12 21:22:26 +08:00
|
|
|
|
2021-08-05 19:03:24 +08:00
|
|
|
return <BannerComponent {...{ hasBanner, layoutContextDispatch, ...props }} />;
|
2021-07-12 21:22:26 +08:00
|
|
|
};
|
2019-03-16 04:07:14 +08:00
|
|
|
|
|
|
|
export default withTracker(() => ({
|
2019-03-19 02:10:27 +08:00
|
|
|
color: Session.get('bannerColor') || '#0F70D7',
|
|
|
|
text: Session.get('bannerText') || '',
|
2021-07-12 21:22:26 +08:00
|
|
|
}))(BannerContainer);
|