UNPKG

@kiwicom/smart-faq

Version:
92 lines (73 loc) 5.12 kB
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _style = _interopRequireDefault(require("styled-jsx/style")); var React = _interopRequireWildcard(require("react")); var _reactRouterDom = require("react-router-dom"); var _Responsive = require("../Responsive"); var _Header = _interopRequireDefault(require("./Header")); var _StaticFAQ = _interopRequireDefault(require("../../StaticFAQ")); var _Article = _interopRequireDefault(require("../../StaticFAQ/ArticleDetail/Article")); var _common = require("../../common"); var _UserStatus = _interopRequireDefault(require("../../helpers/UserStatus")); var _SelectedBooking = require("../../context/SelectedBooking"); var _BookingPage = _interopRequireDefault(require("./BookingPage")); // @flow var styles = new String(".ContentPage{min-width:650px;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.FAQWrapper{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative;}.ContentPage .Body{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;min-height:0;}.FAQ{width:650px;height:100%;}.BookingInfo{width:548px;}@media only screen and (max-width:1180px){.ContentPage{min-width:320px;width:100vw;}.ContentPage .Body{height:calc(100% - (123px));}.FAQ{width:100%;}.BookingInfo{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.BookingInfo,.FAQWrapper{width:50%;}}"); styles.__hash = "2765741777"; styles.__scoped = ".ContentPage.jsx-1946215120{min-width:650px;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.FAQWrapper.jsx-1946215120{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative;}.ContentPage.jsx-1946215120 .Body.jsx-1946215120{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;min-height:0;}.FAQ.jsx-1946215120{width:650px;height:100%;}.BookingInfo.jsx-1946215120{width:548px;}@media only screen and (max-width:1180px){.ContentPage.jsx-1946215120{min-width:320px;width:100vw;}.ContentPage.jsx-1946215120 .Body.jsx-1946215120{height:calc(100% - (123px));}.FAQ.jsx-1946215120{width:100%;}.BookingInfo.jsx-1946215120{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.BookingInfo.jsx-1946215120,.FAQWrapper.jsx-1946215120{width:50%;}}"; styles.__scopedHash = "1946215120"; var FAQRoute = function FAQRoute(_ref) { var history = _ref.history; return React.createElement(_reactRouterDom.Switch, { location: history.location }, React.createElement(_reactRouterDom.Route, { exact: true, path: "/faq/:categoryId?", component: _StaticFAQ.default }), React.createElement(_reactRouterDom.Route, { path: "/faq/:categoryId/article/:articleId", component: _Article.default })); }; var ContentPage = function ContentPage(props /*: Props*/ ) { return React.createElement(_SelectedBooking.SelectedBooking.Consumer, null, function (_ref2) { var bookingPage = _ref2.bookingPage, selectedBooking = _ref2.selectedBooking; return React.createElement("div", { className: "jsx-".concat(styles.__scopedHash) + " " + "ContentPage" }, React.createElement(_Header.default, null), React.createElement("div", { className: "jsx-".concat(styles.__scopedHash) + " " + "Body" }, bookingPage === 'ALL_BOOKINGS' ? React.createElement("div", { className: "jsx-".concat(styles.__scopedHash) + " " + "BookingInfo" }, React.createElement(_BookingPage.default, { bookingPage: bookingPage, selectedBooking: selectedBooking })) : React.createElement(_Responsive.Desktop, null, React.createElement(_UserStatus.default.LoggedIn, null, React.createElement("div", { className: "jsx-".concat(styles.__scopedHash) + " " + "BookingInfo" }, React.createElement(_BookingPage.default, { bookingPage: bookingPage, selectedBooking: selectedBooking })))), React.createElement("div", { className: "jsx-".concat(styles.__scopedHash) + " " + "FAQWrapper" }, React.createElement(_common.ScrollableContent, null, React.createElement("div", { id: "SmartFAQ_Body", className: "jsx-".concat(styles.__scopedHash) + " " + "FAQ" }, bookingPage === 'ALL_BOOKINGS' ? React.createElement(_Responsive.Desktop, null, React.createElement(FAQRoute, { history: props.history })) : React.createElement(FAQRoute, { history: props.history }))))), React.createElement(_style.default, { styleId: styles.__scopedHash, css: styles.__scoped })); }); }; var _default = (0, _reactRouterDom.withRouter)(ContentPage); exports.default = _default;