@kiwicom/smart-faq
Version:
148 lines (117 loc) • 9.38 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 = exports.PureIntro = void 0;
var _style = _interopRequireDefault(require("styled-jsx/style"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var React = _interopRequireWildcard(require("react"));
var _Text = _interopRequireDefault(require("@kiwicom/orbit-components/lib/Text"));
var _Text2 = _interopRequireDefault(require("@kiwicom/nitro/lib/components/Text"));
var _CloseButton = _interopRequireDefault(require("./../common/buttons/CloseButton"));
var _User = require("../context/User");
var _FullFAQLink = _interopRequireDefault(require("../common/FullFAQLink"));
var _loginHOC = require("../common/loginHOC");
var _trackers = require("../helpers/analytics/trackers");
// @flow
var image = "https://images.kiwi.com/smart-faq/woman-with-laptop@2x.jpg";
var style = new String(".Intro{width:480px;padding-top:128px;height:100%;overflow-y:auto;overflow-x:hidden;margin:auto;}div.picture{margin-left:150px;margin-bottom:68px;}div.text{margin-left:40px;}div.picture img{width:203px;height:156px;}p.title{color:#171b1e;font-size:28px;font-weight:bold;margin-bottom:6px;}button{cursor:pointer;height:44px;border-radius:3px;border:0;font-size:14px;font-weight:bold;line-height:1.43;padding:12px 16px;}.primary button{background-color:#00a991;color:#ffffff;margin-bottom:16px;}.secondary button{background-color:#e8edf1;color:#46515e;}div.buttons{margin-left:40px;margin-top:52.4px;}hr.hr-line{margin:36px 64px 22px 64px;height:0;border:0;border-top:1px solid #e8edf1;}.faqLink{margin-left:182px;margin-bottom:20px;line-height:1.4;}@media only screen and (max-width:480px){.Intro{width:100%;padding-top:75px;}div.picture{text-align:center;margin:0px 0px 40px 0px;}hr.hr-line{margin:28px 16px 22px 16px;}div.text{margin-left:16px;margin-right:16px;}p.title{font-size:22px;}div.buttons{margin:28px 16px 24px 16px;}button{width:100%;}.faqLink{text-align:center;margin:0;}}@media only screen and (max-height:480px){.Intro{width:100%;padding-top:20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}div.picture{display:none;}hr.hr-line{width:288px;margin:19px 0 22px;}div.text{width:288px;margin:0;}p.title{font-size:22px;text-align:center;margin-bottom:20px;}div.buttons{width:288px;margin:12px 0 0;}div.buttons button{width:100%;}.faqLink{margin:0;}}");
style.__hash = "1090604671";
style.__scoped = ".Intro.jsx-1816167614{width:480px;padding-top:128px;height:100%;overflow-y:auto;overflow-x:hidden;margin:auto;}div.picture.jsx-1816167614{margin-left:150px;margin-bottom:68px;}div.text.jsx-1816167614{margin-left:40px;}div.picture.jsx-1816167614 img.jsx-1816167614{width:203px;height:156px;}p.title.jsx-1816167614{color:#171b1e;font-size:28px;font-weight:bold;margin-bottom:6px;}button.jsx-1816167614{cursor:pointer;height:44px;border-radius:3px;border:0;font-size:14px;font-weight:bold;line-height:1.43;padding:12px 16px;}.primary.jsx-1816167614 button.jsx-1816167614{background-color:#00a991;color:#ffffff;margin-bottom:16px;}.secondary.jsx-1816167614 button.jsx-1816167614{background-color:#e8edf1;color:#46515e;}div.buttons.jsx-1816167614{margin-left:40px;margin-top:52.4px;}hr.hr-line.jsx-1816167614{margin:36px 64px 22px 64px;height:0;border:0;border-top:1px solid #e8edf1;}.faqLink.jsx-1816167614{margin-left:182px;margin-bottom:20px;line-height:1.4;}@media only screen and (max-width:480px){.Intro.jsx-1816167614{width:100%;padding-top:75px;}div.picture.jsx-1816167614{text-align:center;margin:0px 0px 40px 0px;}hr.hr-line.jsx-1816167614{margin:28px 16px 22px 16px;}div.text.jsx-1816167614{margin-left:16px;margin-right:16px;}p.title.jsx-1816167614{font-size:22px;}div.buttons.jsx-1816167614{margin:28px 16px 24px 16px;}button.jsx-1816167614{width:100%;}.faqLink.jsx-1816167614{text-align:center;margin:0;}}@media only screen and (max-height:480px){.Intro.jsx-1816167614{width:100%;padding-top:20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}div.picture.jsx-1816167614{display:none;}hr.hr-line.jsx-1816167614{width:288px;margin:19px 0 22px;}div.text.jsx-1816167614{width:288px;margin:0;}p.title.jsx-1816167614{font-size:22px;text-align:center;margin-bottom:20px;}div.buttons.jsx-1816167614{width:288px;margin:12px 0 0;}div.buttons.jsx-1816167614 button.jsx-1816167614{width:100%;}.faqLink.jsx-1816167614{margin:0;}}";
style.__scopedHash = "1816167614";
/*:: type Props = {
user: User,
history: {
push: string => void,
},
};*/
var PureIntro =
/*#__PURE__*/
function (_React$Component) {
(0, _inherits2.default)(PureIntro, _React$Component);
function PureIntro() {
var _getPrototypeOf2;
var _this;
(0, _classCallCheck2.default)(this, PureIntro);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(PureIntro)).call.apply(_getPrototypeOf2, [this].concat(args)));
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "goToExistingBooking", function () {
(0, _trackers.simpleTracker)('smartFAQ', {
action: 'clickOnIntroButton',
haveBooking: true
});
_this.props.user ? _this.props.history.push('/faq/') : _this.props.history.push('/sign-in');
});
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "goToNoBooking", function () {
(0, _trackers.simpleTracker)('smartFAQ', {
action: 'clickOnIntroButton',
haveBooking: false
});
_this.props.history.push('/faq/');
});
return _this;
}
(0, _createClass2.default)(PureIntro, [{
key: "render",
value: function render() {
return React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "Intro"
}, React.createElement(_CloseButton.default, null), React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "picture"
}, React.createElement("img", {
alt: "Help",
src: image,
className: "jsx-".concat(style.__scopedHash)
})), React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "text"
}, React.createElement("p", {
className: "jsx-".concat(style.__scopedHash) + " " + "title"
}, React.createElement(_Text2.default, {
t: "smartfaq.intro_page.title"
})), React.createElement(_Text.default, {
type: "secondary"
}, React.createElement(_Text2.default, {
t: "smartfaq.intro_page.subtitle"
}))), React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "buttons"
}, React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "primary"
}, React.createElement("button", {
onClick: this.goToExistingBooking,
"data-cy": "btn-existent-booking",
className: "jsx-".concat(style.__scopedHash)
}, React.createElement(_Text2.default, {
t: "smartfaq.intro_page.existing_booking"
}))), React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "secondary"
}, React.createElement("button", {
onClick: this.goToNoBooking,
"data-cy": "btn-nonexistent-booking",
className: "jsx-".concat(style.__scopedHash)
}, React.createElement(_Text2.default, {
t: "smartfaq.intro_page.no_booking"
})))), React.createElement("hr", {
className: "jsx-".concat(style.__scopedHash) + " " + "hr-line"
}), React.createElement("div", {
className: "jsx-".concat(style.__scopedHash) + " " + "faqLink"
}, React.createElement(_FullFAQLink.default, null)), React.createElement(_style.default, {
styleId: style.__scopedHash,
css: style.__scoped
}));
}
}]);
return PureIntro;
}(React.Component);
exports.PureIntro = PureIntro;
var _default = (0, _User.withUser)((0, _loginHOC.redirectsLoggedIn)(PureIntro));
exports.default = _default;