@kiwicom/smart-faq
Version:
Smart FAQ
112 lines (90 loc) • 6.16 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 _idx = _interopRequireDefault(require("idx"));
var React = _interopRequireWildcard(require("react"));
var _reactRelay = require("react-relay");
var _CarrierLogo = _interopRequireDefault(require("@kiwicom/orbit-components/lib/CarrierLogo"));
var _Text = _interopRequireDefault(require("@kiwicom/orbit-components/lib/Text"));
var _ChevronRight = _interopRequireDefault(require("@kiwicom/orbit-components/lib/icons/ChevronRight"));
var _FromToRow = _interopRequireDefault(require("./FromToRow"));
var _DateAndPassenger = _interopRequireDefault(require("./DateAndPassenger"));
var _formatBookingId = _interopRequireDefault(require("../../helpers/formatBookingId"));
// @flow
var styles = new String(".card{width:100%;position:relative;border-radius:3px;background-color:#ffffff;border:solid 1px #e8edf1;padding:12px 44px 24px 44px;margin-bottom:24px;}div.fields{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}div.logoCarriers{position:absolute;top:23px;left:6px;}div.chevron{position:absolute;top:25px;right:16px;line-height:1.6;}div.label{display:block;margin-bottom:4px;}div.section{display:block;}p.flight{font-size:16px;font-weight:bold;line-height:1.4;color:#46515e;margin-bottom:12px;margin-left:2px;display:inline-block;}div.arrowIcon{display:inline-block;margin-left:8px;margin-right:8px;vertical-align:top;}@media only screen and (max-width:900px){.card{width:304px;height:100%;margin-bottom:16;}p.flight{font-size:12px;}div.section{display:inline-block;margin-bottom:12px;}div.section:nth-child(1){margin-right:30px;}div.section:nth-child(3){margin-right:65px;}div.fields{display:block;margin-top:5px;}}");
styles.__hash = "3172214047";
styles.__scoped = ".card.jsx-2279155998{width:100%;position:relative;border-radius:3px;background-color:#ffffff;border:solid 1px #e8edf1;padding:12px 44px 24px 44px;margin-bottom:24px;}div.fields.jsx-2279155998{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}div.logoCarriers.jsx-2279155998{position:absolute;top:23px;left:6px;}div.chevron.jsx-2279155998{position:absolute;top:25px;right:16px;line-height:1.6;}div.label.jsx-2279155998{display:block;margin-bottom:4px;}div.section.jsx-2279155998{display:block;}p.flight.jsx-2279155998{font-size:16px;font-weight:bold;line-height:1.4;color:#46515e;margin-bottom:12px;margin-left:2px;display:inline-block;}div.arrowIcon.jsx-2279155998{display:inline-block;margin-left:8px;margin-right:8px;vertical-align:top;}@media only screen and (max-width:900px){.card.jsx-2279155998{width:304px;height:100%;margin-bottom:16;}p.flight.jsx-2279155998{font-size:12px;}div.section.jsx-2279155998{display:inline-block;margin-bottom:12px;}div.section.jsx-2279155998:nth-child(1){margin-right:30px;}div.section.jsx-2279155998:nth-child(3){margin-right:65px;}div.fields.jsx-2279155998{display:block;margin-top:5px;}}";
styles.__scopedHash = "2279155998";
/*:: type Props = {|
type: string,
booking: BookingCard_booking,
departure: BookingCard_departure,
arrival: BookingCard_arrival,
|};*/
var BookingCard = function BookingCard(props
/*: Props*/
) {
var databaseId = (0, _idx.default)(props.booking, function (_) {
return _.databaseId;
});
var carriers = (0, _idx.default)(props.booking, function (_) {
return _.carriers;
}) || [];
var allCarriers = carriers.map(function (c) {
return {
code: c && c.code || '',
name: c && c.name || ''
};
});
return React.createElement("div", {
className: "card"
}, databaseId && React.createElement(_Text.default, {
type: "secondary",
size: "small"
}, "# ", (0, _formatBookingId.default)(databaseId)), React.createElement("div", {
className: "logoCarriers"
}, React.createElement(_CarrierLogo.default, {
size: "medium",
carriers: allCarriers
})), React.createElement(_FromToRow.default, {
type: props.type,
arrival: props.arrival,
departure: props.departure
}), React.createElement("div", {
className: "chevron"
}, React.createElement(_ChevronRight.default, {
size: "medium",
customColor: "#bac7d5"
})), React.createElement(_DateAndPassenger.default, {
departure: props.departure,
booking: props.booking
}), React.createElement("style", null, styles));
};
var _default = (0, _reactRelay.createFragmentContainer)(BookingCard, {
booking: function booking() {
var node = require("./__generated__/BookingCard_booking.graphql");
if (node.hash && node.hash !== "7707674f4ed731e94487884b8805a101") {
console.error("The definition of 'BookingCard_booking' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.");
}
return require("./__generated__/BookingCard_booking.graphql");
},
arrival: function arrival() {
var node = require("./__generated__/BookingCard_arrival.graphql");
if (node.hash && node.hash !== "df11510821be99f1c3974716557c0892") {
console.error("The definition of 'BookingCard_arrival' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.");
}
return require("./__generated__/BookingCard_arrival.graphql");
},
departure: function departure() {
var node = require("./__generated__/BookingCard_departure.graphql");
if (node.hash && node.hash !== "a60ea1b0297cb6607b761254ef17d186") {
console.error("The definition of 'BookingCard_departure' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.");
}
return require("./__generated__/BookingCard_departure.graphql");
}
});
exports.default = _default;