kupos-ui-components-lib 4.0.6 โ†’ 4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -455,13 +455,11 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
455
455
  }
456
456
  }
457
457
  else if (f.value.toLowerCase().indexOf("salon") > -1) {
458
- // for (let bt of it.fare_str.split(",")) {
459
- // if (
460
- // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
461
- // ) {
462
- // return true;
463
- // }
464
- // }
458
+ for (let bt of it.fare_str.split(",")) {
459
+ if (bt.toLowerCase().split(":")[0].indexOf("salon") > -1) {
460
+ return true;
461
+ }
462
+ }
465
463
  for (let bt of it.seat_types) {
466
464
  if (((_g = bt === null || bt === void 0 ? void 0 : bt.label) === null || _g === void 0 ? void 0 : _g.toLowerCase().indexOf("salon")) > -1) {
467
465
  return true;
@@ -133,7 +133,8 @@ class ServiceFilter extends React.Component {
133
133
  option.type !== "seat_types" &&
134
134
  option.type !== "tipo" &&
135
135
  option.type !== "special_departure" &&
136
- option.type !== "train_type")) &&
136
+ option.type !== "train_type" &&
137
+ option.type !== "amenities")) &&
137
138
  option.options.map((val, i) => {
138
139
  var _a, _b, _c, _d, _e, _f, _g, _h;
139
140
  let iconKey = "";
@@ -188,6 +189,9 @@ class ServiceFilter extends React.Component {
188
189
  else if (val.label === "PET_FRIENDLY") {
189
190
  label = (_h = this.props.translation) === null || _h === void 0 ? void 0 : _h.petFriendly;
190
191
  }
192
+ else if (val.label === "cortina divisoria") {
193
+ label = "Cortina divisoria";
194
+ }
191
195
  else {
192
196
  // Use translation if available, otherwise use the label
193
197
  label = val.trText
@@ -8,9 +8,9 @@ import LottiePlayer from "../../assets/LottiePlayer";
8
8
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
9
9
  function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, originIconStyle, t = (key) => key, }) {
10
10
  var _a, _b, _c, _d, _e, _f, _g;
11
- console.log("๐Ÿš€ ~ ServiceItemPB ~ serviceItem:", serviceItem, metaData);
12
11
  const SvgAmenities = ({ moreAnemities, name, color, }) => {
13
- const amenityKey = name.toLowerCase().replace(/\s/g, "_");
12
+ var _a;
13
+ const amenityKey = (_a = name === null || name === void 0 ? void 0 : name.toLowerCase()) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, "_");
14
14
  const getIconPath = () => {
15
15
  const amenityFileName = `${amenityKey}.png`;
16
16
  const imagePath = getAmenitiesImage(amenityFileName);
@@ -111,7 +111,6 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
111
111
  }
112
112
  };
113
113
  const getAmenityName = (rawAmenity) => {
114
- console.log("๐Ÿš€ ~ getAmenityName ~ rawAmenity:", rawAmenity);
115
114
  switch (rawAmenity) {
116
115
  case "mobile ticket":
117
116
  return "Ticket mรณvil";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -525,13 +525,13 @@ const FilterBarDesktop = ({
525
525
  }
526
526
  }
527
527
  } else if (f.value.toLowerCase().indexOf("salon") > -1) {
528
- // for (let bt of it.fare_str.split(",")) {
529
- // if (
530
- // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
531
- // ) {
532
- // return true;
533
- // }
534
- // }
528
+ for (let bt of it.fare_str.split(",")) {
529
+ if (
530
+ bt.toLowerCase().split(":")[0].indexOf("salon") > -1
531
+ ) {
532
+ return true;
533
+ }
534
+ }
535
535
 
536
536
  for (let bt of it.seat_types) {
537
537
  if (bt?.label?.toLowerCase().indexOf("salon") > -1) {
@@ -214,7 +214,8 @@ class ServiceFilter extends React.Component<
214
214
  option.type !== "seat_types" &&
215
215
  option.type !== "tipo" &&
216
216
  option.type !== "special_departure" &&
217
- option.type !== "train_type")) &&
217
+ option.type !== "train_type" &&
218
+ option.type !== "amenities")) &&
218
219
  option.options.map((val: any, i: number) => {
219
220
  let iconKey = "";
220
221
  if (val.icon === "sunrise") {
@@ -256,6 +257,8 @@ class ServiceFilter extends React.Component<
256
257
  label = "Tren express";
257
258
  } else if (val.label === "PET_FRIENDLY") {
258
259
  label = this.props.translation?.petFriendly;
260
+ } else if (val.label === "cortina divisoria") {
261
+ label = "Cortina divisoria";
259
262
  } else {
260
263
  // Use translation if available, otherwise use the label
261
264
  label = val.trText
@@ -31,7 +31,6 @@ function ServiceItemPB({
31
31
  originIconStyle,
32
32
  t = (key: string) => key,
33
33
  }: ServiceItemProps & { currencySign?: string }): React.ReactElement {
34
- console.log("๐Ÿš€ ~ ServiceItemPB ~ serviceItem:", serviceItem, metaData);
35
34
  const SvgAmenities = ({
36
35
  moreAnemities,
37
36
  name,
@@ -41,7 +40,7 @@ function ServiceItemPB({
41
40
  name: string;
42
41
  color?: string;
43
42
  }) => {
44
- const amenityKey = name.toLowerCase().replace(/\s/g, "_");
43
+ const amenityKey = name?.toLowerCase()?.replace(/\s/g, "_");
45
44
 
46
45
  const getIconPath = () => {
47
46
  const amenityFileName = `${amenityKey}.png`;
@@ -157,7 +156,6 @@ function ServiceItemPB({
157
156
  };
158
157
 
159
158
  const getAmenityName = (rawAmenity: string): string => {
160
- console.log("๐Ÿš€ ~ getAmenityName ~ rawAmenity:", rawAmenity);
161
159
  switch (rawAmenity) {
162
160
  case "mobile ticket":
163
161
  return "Ticket mรณvil";