umwd-components 0.1.175 → 0.1.177

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.
@@ -9,6 +9,7 @@
9
9
  var React = require('react');
10
10
  var material = require('@mui/material');
11
11
  var getIcon = require('../lib/getIcon.js');
12
+ var BlockRendererClient = require('./BlockRendererClient.js');
12
13
 
13
14
  function ColumnsSection(_ref) {
14
15
  let {
@@ -60,11 +61,9 @@ function ColumnsSection(_ref) {
60
61
  fill: "currentColor",
61
62
  stroke: "none"
62
63
  }
63
- }), column.heading), /*#__PURE__*/React.createElement(material.Typography, {
64
- variant: "body2",
65
- color: "text.secondary",
66
- component: "div"
67
- }, column.text)));
64
+ }), column.heading), column.textV2 ? /*#__PURE__*/React.createElement(BlockRendererClient.BlockRendererClient, {
65
+ content: column.textV2
66
+ }) : /*#__PURE__*/React.createElement(material.Typography, null, column.text)));
68
67
  })));
69
68
  }
70
69
 
@@ -20,6 +20,8 @@ function ContactForm(_ref) {
20
20
  data
21
21
  } = _ref;
22
22
  const {
23
+ title = "Write us",
24
+ subtitle = "We're open for any suggestion or just to have a chat",
23
25
  maxWidth,
24
26
  sx = {},
25
27
  glass = false
@@ -145,10 +147,13 @@ function ContactForm(_ref) {
145
147
  }, /*#__PURE__*/React.createElement(material.Typography, {
146
148
  variant: "h6",
147
149
  align: "center"
148
- }, "Write us"), /*#__PURE__*/React.createElement(material.Typography, {
150
+ }, title), /*#__PURE__*/React.createElement(material.Typography, {
149
151
  variant: "body1",
150
- align: "center"
151
- }, "We're open for any suggestion or just to have a chat"), showSuccessMessage && /*#__PURE__*/React.createElement(material.Paper, {
152
+ align: "center",
153
+ sx: {
154
+ pb: 3
155
+ }
156
+ }, subtitle), showSuccessMessage && /*#__PURE__*/React.createElement(material.Paper, {
152
157
  sx: {
153
158
  p: 2
154
159
  }
@@ -43,83 +43,87 @@ function FleetSection(_ref) {
43
43
  }
44
44
  },
45
45
  useFlexGap: true
46
- }, airplane.map(airplane => /*#__PURE__*/React.createElement(material.Card, {
47
- key: airplane.id,
48
- sx: {
49
- display: "flex",
50
- flexDirection: "column",
51
- justifyContent: "space-between",
52
- flex: 1,
53
- minWidth: 275
54
- }
55
- }, /*#__PURE__*/React.createElement(material.CardHeader, {
56
- title: airplane.name,
57
- subheader: airplane.description
58
- }), /*#__PURE__*/React.createElement(material.Box, {
59
- sx: {
60
- flex: 1
61
- }
62
- }), /*#__PURE__*/React.createElement(material.CardContent, {
63
- sx: {
64
- p: 1,
65
- height: 180,
66
- mb: 2
67
- }
68
- }, /*#__PURE__*/React.createElement(material.Paper, {
69
- sx: {
70
- p: 1,
71
- display: "grid",
72
- alignItems: "center",
73
- justifyContent: "center",
74
- height: "100%",
75
- position: "relative"
76
- },
77
- variant: "outlined"
78
- }, airplane.floorplan !== null && /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
79
- src: airplane.floorplan.url,
80
- alt: airplane.floorplan.alternativeText,
81
- width: airplane.floorplan.width,
82
- height: airplane.floorplan.height,
83
- style: {
84
- objectFit: "contain",
85
- width: "100%",
86
- paddingBottom: "20px"
87
- }
88
- }), airplane.cabinHeight && airplane.cabinWidth && airplane.cabinLength && /*#__PURE__*/React.createElement(material.Box, {
89
- sx: {
90
- position: "absolute",
91
- right: ".5rem",
92
- bottom: ".5rem"
93
- }
94
- }, /*#__PURE__*/React.createElement(material.Typography, {
95
- variant: "body2",
96
- color: "text.secondary",
97
- align: "right"
98
- }, /*#__PURE__*/React.createElement("strong", null, "Cabin Dimensions:"), " ", /*#__PURE__*/React.createElement("strong", null, "H"), " ", airplane.cabinHeight, " m ", /*#__PURE__*/React.createElement("strong", null, "W"), " ", airplane.cabinWidth, " m ", /*#__PURE__*/React.createElement("strong", null, "L"), " ", airplane.cabinLength, " m")))), /*#__PURE__*/React.createElement(material.CardContent, {
99
- sx: {
100
- /* height: "33%" */
101
- }
102
- }, /*#__PURE__*/React.createElement(material.Stack, {
103
- direction: "row",
104
- spacing: 1,
105
- flexWrap: "wrap",
106
- useFlexGap: true
107
- }, /*#__PURE__*/React.createElement(material.Chip, {
108
- label: "Range: ".concat(airplane.range, " km"),
109
- variant: "filled",
110
- color: "primary",
111
- icon: /*#__PURE__*/React.createElement(RadarIcon, null)
112
- }), /*#__PURE__*/React.createElement(material.Chip, {
113
- label: "Speed: ".concat(airplane.speed, " km/h"),
114
- variant: "filled",
115
- color: "primary",
116
- icon: /*#__PURE__*/React.createElement(SpeedIcon, null)
117
- }), /*#__PURE__*/React.createElement(material.Chip, {
118
- label: "Ceiling: ".concat(airplane.ceiling, " ft"),
119
- variant: "filled",
120
- color: "primary",
121
- icon: /*#__PURE__*/React.createElement(HeightIcon, null)
122
- })))))));
46
+ }, airplane.map(airplane => {
47
+ var _airplane$floorplan$i;
48
+ return /*#__PURE__*/React.createElement(material.Card, {
49
+ key: airplane.id,
50
+ sx: {
51
+ display: "flex",
52
+ flexDirection: "column",
53
+ justifyContent: "space-between",
54
+ flex: 1,
55
+ minWidth: 275
56
+ }
57
+ }, /*#__PURE__*/React.createElement(material.CardHeader, {
58
+ title: airplane.name,
59
+ subheader: airplane.description
60
+ }), /*#__PURE__*/React.createElement(material.Box, {
61
+ sx: {
62
+ flex: 1
63
+ }
64
+ }), /*#__PURE__*/React.createElement(material.CardContent, {
65
+ sx: {
66
+ p: 1,
67
+ height: 180,
68
+ mb: 2
69
+ }
70
+ }, /*#__PURE__*/React.createElement(material.Paper, {
71
+ sx: {
72
+ p: 1,
73
+ display: "grid",
74
+ alignItems: "center",
75
+ justifyContent: "center",
76
+ height: "100%",
77
+ position: "relative"
78
+ },
79
+ variant: "outlined"
80
+ }, airplane.floorplan !== null && /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
81
+ id: (_airplane$floorplan$i = airplane.floorplan.id) === null || _airplane$floorplan$i === void 0 ? void 0 : _airplane$floorplan$i.toString(),
82
+ src: airplane.floorplan.url,
83
+ alt: airplane.floorplan.alternativeText,
84
+ width: airplane.floorplan.width,
85
+ height: airplane.floorplan.height,
86
+ style: {
87
+ objectFit: "contain",
88
+ width: "100%",
89
+ paddingBottom: "20px"
90
+ }
91
+ }), airplane.cabinHeight && airplane.cabinWidth && airplane.cabinLength && /*#__PURE__*/React.createElement(material.Box, {
92
+ sx: {
93
+ position: "absolute",
94
+ right: ".5rem",
95
+ bottom: ".5rem"
96
+ }
97
+ }, /*#__PURE__*/React.createElement(material.Typography, {
98
+ variant: "body2",
99
+ color: "text.secondary",
100
+ align: "right"
101
+ }, /*#__PURE__*/React.createElement("strong", null, "Cabin Dimensions:"), " ", /*#__PURE__*/React.createElement("strong", null, "H"), " ", airplane.cabinHeight, " m ", /*#__PURE__*/React.createElement("strong", null, "W"), " ", airplane.cabinWidth, " m ", /*#__PURE__*/React.createElement("strong", null, "L"), " ", airplane.cabinLength, " m")))), /*#__PURE__*/React.createElement(material.CardContent, {
102
+ sx: {
103
+ /* height: "33%" */
104
+ }
105
+ }, /*#__PURE__*/React.createElement(material.Stack, {
106
+ direction: "row",
107
+ spacing: 1,
108
+ flexWrap: "wrap",
109
+ useFlexGap: true
110
+ }, /*#__PURE__*/React.createElement(material.Chip, {
111
+ label: "Range: ".concat(airplane.range, " km"),
112
+ variant: "filled",
113
+ color: "primary",
114
+ icon: /*#__PURE__*/React.createElement(RadarIcon, null)
115
+ }), /*#__PURE__*/React.createElement(material.Chip, {
116
+ label: "Speed: ".concat(airplane.speed, " km/h"),
117
+ variant: "filled",
118
+ color: "primary",
119
+ icon: /*#__PURE__*/React.createElement(SpeedIcon, null)
120
+ }), /*#__PURE__*/React.createElement(material.Chip, {
121
+ label: "Ceiling: ".concat(airplane.ceiling, " ft"),
122
+ variant: "filled",
123
+ color: "primary",
124
+ icon: /*#__PURE__*/React.createElement(HeightIcon, null)
125
+ }))));
126
+ })));
123
127
  }
124
128
 
125
129
  /*
@@ -17,6 +17,9 @@ var MuiLink = require('./MuiLink.js');
17
17
  function needsShortening(data, maxLength) {
18
18
  let totalLength = 0;
19
19
  for (const paragraph of data) {
20
+ var _paragraph$children;
21
+ if ((paragraph === null || paragraph === void 0 || (_paragraph$children = paragraph.children) === null || _paragraph$children === void 0 ? void 0 : _paragraph$children.length) === 0) continue;
22
+ if (paragraph.children[0].type !== "text") continue;
20
23
  totalLength += paragraph.children[0].text.length;
21
24
  }
22
25
  return totalLength > maxLength;
@@ -25,6 +28,9 @@ function shortenParagraphs(data, maxLength) {
25
28
  let totalLength = 0;
26
29
  const shortenedData = [];
27
30
  for (const paragraph of data) {
31
+ var _paragraph$children2;
32
+ if ((paragraph === null || paragraph === void 0 || (_paragraph$children2 = paragraph.children) === null || _paragraph$children2 === void 0 ? void 0 : _paragraph$children2.length) === 0) continue;
33
+ if (paragraph.children[0].type !== "text") continue;
28
34
  const textNode = paragraph.children[0];
29
35
  const textLength = textNode.text.length;
30
36
  const remainingLength = maxLength - totalLength;
@@ -55,6 +55,7 @@ function PictureBarSection(_ref) {
55
55
  flex: "1 1 0"
56
56
  }
57
57
  }, /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
58
+ id: picture.id.toString(),
58
59
  src: picture.url,
59
60
  alt: picture.alternativeText,
60
61
  width: picture.width,
@@ -35,6 +35,7 @@ var TwitterIcon = require('@mui/icons-material/Twitter');
35
35
  var LocalShippingIcon = require('@mui/icons-material/LocalShipping');
36
36
  var InstagramIcon = require('@mui/icons-material/Instagram');
37
37
  var APIcon = require('./APIcon.js');
38
+ var FavoriteIcon = require('@mui/icons-material/Favorite');
38
39
 
39
40
  function getIcon(icon) {
40
41
  switch (icon) {
@@ -92,6 +93,8 @@ function getIcon(icon) {
92
93
  return InstagramIcon;
93
94
  case "APIcon":
94
95
  return APIcon.default;
96
+ case "FavoriteIcon":
97
+ return FavoriteIcon;
95
98
  default:
96
99
  return null;
97
100
  }
@@ -7,6 +7,7 @@
7
7
  import React__default from 'react';
8
8
  import { Container, Grid, Paper, Typography } from '@mui/material';
9
9
  import getIcon from '../lib/getIcon.js';
10
+ import { BlockRendererClient } from './BlockRendererClient.js';
10
11
 
11
12
  function ColumnsSection(_ref) {
12
13
  let {
@@ -58,11 +59,9 @@ function ColumnsSection(_ref) {
58
59
  fill: "currentColor",
59
60
  stroke: "none"
60
61
  }
61
- }), column.heading), /*#__PURE__*/React__default.createElement(Typography, {
62
- variant: "body2",
63
- color: "text.secondary",
64
- component: "div"
65
- }, column.text)));
62
+ }), column.heading), column.textV2 ? /*#__PURE__*/React__default.createElement(BlockRendererClient, {
63
+ content: column.textV2
64
+ }) : /*#__PURE__*/React__default.createElement(Typography, null, column.text)));
66
65
  })));
67
66
  }
68
67
 
@@ -16,6 +16,8 @@ function ContactForm(_ref) {
16
16
  data
17
17
  } = _ref;
18
18
  const {
19
+ title = "Write us",
20
+ subtitle = "We're open for any suggestion or just to have a chat",
19
21
  maxWidth,
20
22
  sx = {},
21
23
  glass = false
@@ -141,10 +143,13 @@ function ContactForm(_ref) {
141
143
  }, /*#__PURE__*/React__default.createElement(Typography, {
142
144
  variant: "h6",
143
145
  align: "center"
144
- }, "Write us"), /*#__PURE__*/React__default.createElement(Typography, {
146
+ }, title), /*#__PURE__*/React__default.createElement(Typography, {
145
147
  variant: "body1",
146
- align: "center"
147
- }, "We're open for any suggestion or just to have a chat"), showSuccessMessage && /*#__PURE__*/React__default.createElement(Paper, {
148
+ align: "center",
149
+ sx: {
150
+ pb: 3
151
+ }
152
+ }, subtitle), showSuccessMessage && /*#__PURE__*/React__default.createElement(Paper, {
148
153
  sx: {
149
154
  p: 2
150
155
  }
@@ -41,83 +41,87 @@ function FleetSection(_ref) {
41
41
  }
42
42
  },
43
43
  useFlexGap: true
44
- }, airplane.map(airplane => /*#__PURE__*/React__default.createElement(Card, {
45
- key: airplane.id,
46
- sx: {
47
- display: "flex",
48
- flexDirection: "column",
49
- justifyContent: "space-between",
50
- flex: 1,
51
- minWidth: 275
52
- }
53
- }, /*#__PURE__*/React__default.createElement(CardHeader, {
54
- title: airplane.name,
55
- subheader: airplane.description
56
- }), /*#__PURE__*/React__default.createElement(Box, {
57
- sx: {
58
- flex: 1
59
- }
60
- }), /*#__PURE__*/React__default.createElement(CardContent, {
61
- sx: {
62
- p: 1,
63
- height: 180,
64
- mb: 2
65
- }
66
- }, /*#__PURE__*/React__default.createElement(Paper, {
67
- sx: {
68
- p: 1,
69
- display: "grid",
70
- alignItems: "center",
71
- justifyContent: "center",
72
- height: "100%",
73
- position: "relative"
74
- },
75
- variant: "outlined"
76
- }, airplane.floorplan !== null && /*#__PURE__*/React__default.createElement(StrapiImage, {
77
- src: airplane.floorplan.url,
78
- alt: airplane.floorplan.alternativeText,
79
- width: airplane.floorplan.width,
80
- height: airplane.floorplan.height,
81
- style: {
82
- objectFit: "contain",
83
- width: "100%",
84
- paddingBottom: "20px"
85
- }
86
- }), airplane.cabinHeight && airplane.cabinWidth && airplane.cabinLength && /*#__PURE__*/React__default.createElement(Box, {
87
- sx: {
88
- position: "absolute",
89
- right: ".5rem",
90
- bottom: ".5rem"
91
- }
92
- }, /*#__PURE__*/React__default.createElement(Typography, {
93
- variant: "body2",
94
- color: "text.secondary",
95
- align: "right"
96
- }, /*#__PURE__*/React__default.createElement("strong", null, "Cabin Dimensions:"), " ", /*#__PURE__*/React__default.createElement("strong", null, "H"), " ", airplane.cabinHeight, " m ", /*#__PURE__*/React__default.createElement("strong", null, "W"), " ", airplane.cabinWidth, " m ", /*#__PURE__*/React__default.createElement("strong", null, "L"), " ", airplane.cabinLength, " m")))), /*#__PURE__*/React__default.createElement(CardContent, {
97
- sx: {
98
- /* height: "33%" */
99
- }
100
- }, /*#__PURE__*/React__default.createElement(Stack, {
101
- direction: "row",
102
- spacing: 1,
103
- flexWrap: "wrap",
104
- useFlexGap: true
105
- }, /*#__PURE__*/React__default.createElement(Chip, {
106
- label: "Range: ".concat(airplane.range, " km"),
107
- variant: "filled",
108
- color: "primary",
109
- icon: /*#__PURE__*/React__default.createElement(RadarIcon, null)
110
- }), /*#__PURE__*/React__default.createElement(Chip, {
111
- label: "Speed: ".concat(airplane.speed, " km/h"),
112
- variant: "filled",
113
- color: "primary",
114
- icon: /*#__PURE__*/React__default.createElement(SpeedIcon, null)
115
- }), /*#__PURE__*/React__default.createElement(Chip, {
116
- label: "Ceiling: ".concat(airplane.ceiling, " ft"),
117
- variant: "filled",
118
- color: "primary",
119
- icon: /*#__PURE__*/React__default.createElement(HeightIcon, null)
120
- })))))));
44
+ }, airplane.map(airplane => {
45
+ var _airplane$floorplan$i;
46
+ return /*#__PURE__*/React__default.createElement(Card, {
47
+ key: airplane.id,
48
+ sx: {
49
+ display: "flex",
50
+ flexDirection: "column",
51
+ justifyContent: "space-between",
52
+ flex: 1,
53
+ minWidth: 275
54
+ }
55
+ }, /*#__PURE__*/React__default.createElement(CardHeader, {
56
+ title: airplane.name,
57
+ subheader: airplane.description
58
+ }), /*#__PURE__*/React__default.createElement(Box, {
59
+ sx: {
60
+ flex: 1
61
+ }
62
+ }), /*#__PURE__*/React__default.createElement(CardContent, {
63
+ sx: {
64
+ p: 1,
65
+ height: 180,
66
+ mb: 2
67
+ }
68
+ }, /*#__PURE__*/React__default.createElement(Paper, {
69
+ sx: {
70
+ p: 1,
71
+ display: "grid",
72
+ alignItems: "center",
73
+ justifyContent: "center",
74
+ height: "100%",
75
+ position: "relative"
76
+ },
77
+ variant: "outlined"
78
+ }, airplane.floorplan !== null && /*#__PURE__*/React__default.createElement(StrapiImage, {
79
+ id: (_airplane$floorplan$i = airplane.floorplan.id) === null || _airplane$floorplan$i === void 0 ? void 0 : _airplane$floorplan$i.toString(),
80
+ src: airplane.floorplan.url,
81
+ alt: airplane.floorplan.alternativeText,
82
+ width: airplane.floorplan.width,
83
+ height: airplane.floorplan.height,
84
+ style: {
85
+ objectFit: "contain",
86
+ width: "100%",
87
+ paddingBottom: "20px"
88
+ }
89
+ }), airplane.cabinHeight && airplane.cabinWidth && airplane.cabinLength && /*#__PURE__*/React__default.createElement(Box, {
90
+ sx: {
91
+ position: "absolute",
92
+ right: ".5rem",
93
+ bottom: ".5rem"
94
+ }
95
+ }, /*#__PURE__*/React__default.createElement(Typography, {
96
+ variant: "body2",
97
+ color: "text.secondary",
98
+ align: "right"
99
+ }, /*#__PURE__*/React__default.createElement("strong", null, "Cabin Dimensions:"), " ", /*#__PURE__*/React__default.createElement("strong", null, "H"), " ", airplane.cabinHeight, " m ", /*#__PURE__*/React__default.createElement("strong", null, "W"), " ", airplane.cabinWidth, " m ", /*#__PURE__*/React__default.createElement("strong", null, "L"), " ", airplane.cabinLength, " m")))), /*#__PURE__*/React__default.createElement(CardContent, {
100
+ sx: {
101
+ /* height: "33%" */
102
+ }
103
+ }, /*#__PURE__*/React__default.createElement(Stack, {
104
+ direction: "row",
105
+ spacing: 1,
106
+ flexWrap: "wrap",
107
+ useFlexGap: true
108
+ }, /*#__PURE__*/React__default.createElement(Chip, {
109
+ label: "Range: ".concat(airplane.range, " km"),
110
+ variant: "filled",
111
+ color: "primary",
112
+ icon: /*#__PURE__*/React__default.createElement(RadarIcon, null)
113
+ }), /*#__PURE__*/React__default.createElement(Chip, {
114
+ label: "Speed: ".concat(airplane.speed, " km/h"),
115
+ variant: "filled",
116
+ color: "primary",
117
+ icon: /*#__PURE__*/React__default.createElement(SpeedIcon, null)
118
+ }), /*#__PURE__*/React__default.createElement(Chip, {
119
+ label: "Ceiling: ".concat(airplane.ceiling, " ft"),
120
+ variant: "filled",
121
+ color: "primary",
122
+ icon: /*#__PURE__*/React__default.createElement(HeightIcon, null)
123
+ }))));
124
+ })));
121
125
  }
122
126
 
123
127
  /*
@@ -15,6 +15,9 @@ import { MuiLink } from './MuiLink.js';
15
15
  function needsShortening(data, maxLength) {
16
16
  let totalLength = 0;
17
17
  for (const paragraph of data) {
18
+ var _paragraph$children;
19
+ if ((paragraph === null || paragraph === void 0 || (_paragraph$children = paragraph.children) === null || _paragraph$children === void 0 ? void 0 : _paragraph$children.length) === 0) continue;
20
+ if (paragraph.children[0].type !== "text") continue;
18
21
  totalLength += paragraph.children[0].text.length;
19
22
  }
20
23
  return totalLength > maxLength;
@@ -23,6 +26,9 @@ function shortenParagraphs(data, maxLength) {
23
26
  let totalLength = 0;
24
27
  const shortenedData = [];
25
28
  for (const paragraph of data) {
29
+ var _paragraph$children2;
30
+ if ((paragraph === null || paragraph === void 0 || (_paragraph$children2 = paragraph.children) === null || _paragraph$children2 === void 0 ? void 0 : _paragraph$children2.length) === 0) continue;
31
+ if (paragraph.children[0].type !== "text") continue;
26
32
  const textNode = paragraph.children[0];
27
33
  const textLength = textNode.text.length;
28
34
  const remainingLength = maxLength - totalLength;
@@ -53,6 +53,7 @@ function PictureBarSection(_ref) {
53
53
  flex: "1 1 0"
54
54
  }
55
55
  }, /*#__PURE__*/React__default.createElement(StrapiImage, {
56
+ id: picture.id.toString(),
56
57
  src: picture.url,
57
58
  alt: picture.alternativeText,
58
59
  width: picture.width,
@@ -31,6 +31,7 @@ import TwitterIcon from '@mui/icons-material/Twitter';
31
31
  import LocalShippingIcon from '@mui/icons-material/LocalShipping';
32
32
  import InstagramIcon from '@mui/icons-material/Instagram';
33
33
  import APIcon from './APIcon.js';
34
+ import FavoriteIcon from '@mui/icons-material/Favorite';
34
35
 
35
36
  function getIcon(icon) {
36
37
  switch (icon) {
@@ -88,6 +89,8 @@ function getIcon(icon) {
88
89
  return InstagramIcon;
89
90
  case "APIcon":
90
91
  return APIcon;
92
+ case "FavoriteIcon":
93
+ return FavoriteIcon;
91
94
  default:
92
95
  return null;
93
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.175",
3
+ "version": "0.1.177",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -10,6 +10,8 @@ import {
10
10
  } from "@mui/material";
11
11
  import getIcon from "../lib/getIcon.ts";
12
12
  import { SxProps, Theme } from "@mui/material/styles";
13
+ import { BlockRendererClient } from "./BlockRendererClient.tsx";
14
+ import { type BlocksContent } from "@strapi/blocks-react-renderer";
13
15
 
14
16
  type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
15
17
 
@@ -17,6 +19,7 @@ interface ColumnProps {
17
19
  id: number;
18
20
  heading: string;
19
21
  text: string;
22
+ textV2: BlocksContent;
20
23
  icon: string;
21
24
  }
22
25
 
@@ -70,13 +73,11 @@ export function ColumnsSection({
70
73
  )}
71
74
  {column.heading}
72
75
  </Typography>
73
- <Typography
74
- variant="body2"
75
- color="text.secondary"
76
- component="div"
77
- >
78
- {column.text}
79
- </Typography>
76
+ {column.textV2 ? (
77
+ <BlockRendererClient content={column.textV2} />
78
+ ) : (
79
+ <Typography>{column.text}</Typography>
80
+ )}
80
81
  </Paper>
81
82
  </Grid>
82
83
  );
@@ -21,14 +21,21 @@ type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
21
21
  interface ContactFormProps {
22
22
  id: number;
23
23
  __component: string;
24
- title: string;
24
+ title?: string;
25
+ subtitle?: string;
25
26
  maxWidth: MaxWidth;
26
27
  sx?: SxProps<Theme>;
27
28
  glass?: boolean;
28
29
  }
29
30
 
30
31
  function ContactForm({ data }: { readonly data: ContactFormProps }) {
31
- const { maxWidth, sx = {}, glass = false } = data;
32
+ const {
33
+ title = "Write us",
34
+ subtitle = "We're open for any suggestion or just to have a chat",
35
+ maxWidth,
36
+ sx = {},
37
+ glass = false,
38
+ } = data;
32
39
 
33
40
  type FormValues = {
34
41
  name: string;
@@ -159,10 +166,10 @@ function ContactForm({ data }: { readonly data: ContactFormProps }) {
159
166
  <Container maxWidth={maxWidth ? maxWidth : "lg"} sx={{ my: 1, ...sx }}>
160
167
  <Stack spacing={2} sx={{ width: "100%" }}>
161
168
  <Typography variant="h6" align="center">
162
- Write us
169
+ {title}
163
170
  </Typography>
164
- <Typography variant="body1" align="center">
165
- We're open for any suggestion or just to have a chat
171
+ <Typography variant="body1" align="center" sx={{ pb: 3 }}>
172
+ {subtitle}
166
173
  </Typography>
167
174
  {showSuccessMessage && (
168
175
  <Paper sx={{ p: 2 }}>
@@ -111,6 +111,7 @@ export function FleetSection({ data }: { readonly data: FleetSectionProps }) {
111
111
  >
112
112
  {airplane.floorplan !== null && (
113
113
  <StrapiImage
114
+ id={airplane.floorplan.id?.toString()}
114
115
  src={airplane.floorplan.url}
115
116
  alt={airplane.floorplan.alternativeText}
116
117
  width={airplane.floorplan.width}
@@ -58,18 +58,26 @@ interface PersonaliaSectionProps {
58
58
  sx?: SxProps<Theme>;
59
59
  }
60
60
 
61
- function needsShortening(data, maxLength) {
61
+ function needsShortening(data: BlocksContent, maxLength: number) {
62
62
  let totalLength = 0;
63
63
  for (const paragraph of data) {
64
+ if (paragraph?.children?.length === 0) continue;
65
+ if (paragraph.children[0].type !== "text") continue;
64
66
  totalLength += paragraph.children[0].text.length;
65
67
  }
66
68
  return totalLength > maxLength;
67
69
  }
68
70
 
69
- function shortenParagraphs(data, maxLength) {
71
+ function shortenParagraphs(
72
+ data: BlocksContent,
73
+ maxLength: number
74
+ ): BlocksContent {
70
75
  let totalLength = 0;
71
- const shortenedData = [];
76
+ const shortenedData: BlocksContent = [];
77
+
72
78
  for (const paragraph of data) {
79
+ if (paragraph?.children?.length === 0) continue;
80
+ if (paragraph.children[0].type !== "text") continue;
73
81
  const textNode = paragraph.children[0];
74
82
  const textLength = textNode.text.length;
75
83
  const remainingLength = maxLength - totalLength;
@@ -97,7 +105,15 @@ function shortenParagraphs(data, maxLength) {
97
105
  return shortenedData;
98
106
  }
99
107
 
100
- function PartnerDialog({ partner, open, onClose }) {
108
+ function PartnerDialog({
109
+ partner,
110
+ open,
111
+ onClose,
112
+ }: {
113
+ partner: PartnerProps;
114
+ open: boolean;
115
+ onClose: () => void;
116
+ }) {
101
117
  const theme = useTheme();
102
118
 
103
119
  return (
@@ -143,7 +159,7 @@ function PartnerDialog({ partner, open, onClose }) {
143
159
  />
144
160
  )}
145
161
  {partner.links?.length > 0 &&
146
- partner.links.map((link) => {
162
+ partner.links.map((link: LinkProps) => {
147
163
  return (
148
164
  <MuiLink
149
165
  href={link.url}
@@ -61,6 +61,7 @@ export function PictureBarSection({
61
61
  pictures.data.map((picture) => (
62
62
  <Box key={picture.id} sx={{ flex: "1 1 0" }}>
63
63
  <StrapiImage
64
+ id={picture.id.toString()}
64
65
  src={picture.url}
65
66
  alt={picture.alternativeText}
66
67
  width={picture.width}
@@ -25,6 +25,7 @@ import TwitterIcon from "@mui/icons-material/Twitter";
25
25
  import LocalShippingIcon from "@mui/icons-material/LocalShipping";
26
26
  import InstagramIcon from "@mui/icons-material/Instagram";
27
27
  import APIcon from "./APIcon.tsx";
28
+ import FavoriteIcon from "@mui/icons-material/Favorite";
28
29
 
29
30
  export default function getIcon(icon: string): React.ElementType | null {
30
31
  switch (icon) {
@@ -82,6 +83,8 @@ export default function getIcon(icon: string): React.ElementType | null {
82
83
  return InstagramIcon;
83
84
  case "APIcon":
84
85
  return APIcon;
86
+ case "FavoriteIcon":
87
+ return FavoriteIcon;
85
88
  default:
86
89
  return null;
87
90
  }