@kiwicom/smart-faq
Version:
Smart FAQ
124 lines (101 loc) • 6.39 kB
JavaScript
"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("../../../shared/StaticFAQ"));
var _Article = _interopRequireDefault(require("../../../shared/StaticFAQ/ArticleDetail/Article"));
var _UserStatus = _interopRequireDefault(require("../../helpers/UserStatus"));
var _BookingState = require("../../context/BookingState");
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%;}@media only screen and (max-width:1180px){.ContentPage{min-width:320px;width:100vw;}.ContentPage .Body{height:calc(100% - (123px));}.FAQ{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.FAQWrapper{width:50%;}}");
styles.__hash = "61777663";
styles.__scoped = ".ContentPage.jsx-780438590{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-780438590{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative;}.ContentPage.jsx-780438590 .Body.jsx-780438590{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;min-height:0;}.FAQ.jsx-780438590{width:650px;height:100%;}@media only screen and (max-width:1180px){.ContentPage.jsx-780438590{min-width:320px;width:100vw;}.ContentPage.jsx-780438590 .Body.jsx-780438590{height:calc(100% - (123px));}.FAQ.jsx-780438590{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.FAQWrapper.jsx-780438590{width:50%;}}";
styles.__scopedHash = "780438590";
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 bookingScreenStyles = new String(".BookingInfo{width:548px;}@media only screen and (max-width:1180px){.BookingInfo{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.BookingInfo{width:50%;}}");
bookingScreenStyles.__hash = "3908246290";
bookingScreenStyles.__scoped = ".BookingInfo.jsx-203239187{width:548px;}@media only screen and (max-width:1180px){.BookingInfo.jsx-203239187{width:100%;}}@media only screen and (max-width:1180px) and (min-width:900px){.BookingInfo.jsx-203239187{width:50%;}}";
bookingScreenStyles.__scopedHash = "203239187";
var BookingScreen = function BookingScreen(_ref2) {
var bookingPage = _ref2.bookingPage,
selectedBooking = _ref2.selectedBooking;
if (bookingPage === 'ALL_BOOKINGS') {
return React.createElement("div", {
"data-cy": "booking-info-screen",
className: "jsx-".concat(bookingScreenStyles.__scopedHash) + " " + "BookingInfo"
}, React.createElement(_BookingPage.default, {
bookingPage: bookingPage,
selectedBooking: selectedBooking
}), React.createElement(_style.default, {
styleId: bookingScreenStyles.__scopedHash,
css: bookingScreenStyles.__scoped
}));
}
return React.createElement(_Responsive.Desktop, null, React.createElement(_UserStatus.default.LoggedIn, null, React.createElement("div", {
"data-cy": "booking-info-screen",
className: "jsx-".concat(bookingScreenStyles.__scopedHash) + " " + "BookingInfo"
}, React.createElement(_BookingPage.default, {
bookingPage: bookingPage,
selectedBooking: selectedBooking
}), React.createElement(_style.default, {
styleId: bookingScreenStyles.__scopedHash,
css: bookingScreenStyles.__scoped
}))));
};
var ContentPage = function ContentPage(props
/*: Props*/
) {
return React.createElement(_SelectedBooking.SelectedBooking.Consumer, null, function (_ref3) {
var bookingPage = _ref3.bookingPage,
selectedBooking = _ref3.selectedBooking;
return React.createElement(_BookingState.BookingState.Consumer, null, function (_ref4) {
var showBooking = _ref4.showBooking;
return React.createElement("div", {
className: "jsx-".concat(styles.__scopedHash) + " " + "ContentPage"
}, React.createElement(_Header.default, {
renderOnlyLoggedOut: !showBooking
}), React.createElement("div", {
className: "jsx-".concat(styles.__scopedHash) + " " + "Body"
}, showBooking && React.createElement(BookingScreen, {
bookingPage: bookingPage,
selectedBooking: selectedBooking
}), React.createElement("div", {
className: "jsx-".concat(styles.__scopedHash) + " " + "FAQWrapper"
}, 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;