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.
- package/dist/cjs/components/ColumnsSection.js +4 -5
- package/dist/cjs/components/ContactForm.js +8 -3
- package/dist/cjs/components/FleetSection.js +81 -77
- package/dist/cjs/components/PersonaliaSection.js +6 -0
- package/dist/cjs/components/PictureBarSection.js +1 -0
- package/dist/cjs/lib/getIcon.js +3 -0
- package/dist/esm/components/ColumnsSection.js +4 -5
- package/dist/esm/components/ContactForm.js +8 -3
- package/dist/esm/components/FleetSection.js +81 -77
- package/dist/esm/components/PersonaliaSection.js +6 -0
- package/dist/esm/components/PictureBarSection.js +1 -0
- package/dist/esm/lib/getIcon.js +3 -0
- package/package.json +1 -1
- package/src/components/ColumnsSection.tsx +8 -7
- package/src/components/ContactForm.tsx +12 -5
- package/src/components/FleetSection.tsx +1 -0
- package/src/components/PersonaliaSection.tsx +21 -5
- package/src/components/PictureBarSection.tsx +1 -0
- package/src/lib/getIcon.ts +3 -0
|
@@ -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(
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
},
|
|
150
|
+
}, title), /*#__PURE__*/React.createElement(material.Typography, {
|
|
149
151
|
variant: "body1",
|
|
150
|
-
align: "center"
|
|
151
|
-
|
|
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 =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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;
|
package/dist/cjs/lib/getIcon.js
CHANGED
|
@@ -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(
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
},
|
|
146
|
+
}, title), /*#__PURE__*/React__default.createElement(Typography, {
|
|
145
147
|
variant: "body1",
|
|
146
|
-
align: "center"
|
|
147
|
-
|
|
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 =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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;
|
package/dist/esm/lib/getIcon.js
CHANGED
|
@@ -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
|
@@ -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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
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 {
|
|
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
|
-
|
|
169
|
+
{title}
|
|
163
170
|
</Typography>
|
|
164
|
-
<Typography variant="body1" align="center">
|
|
165
|
-
|
|
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(
|
|
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({
|
|
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}
|
package/src/lib/getIcon.ts
CHANGED
|
@@ -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
|
}
|