@rileybathurst/paddle 1.9.43 → 1.9.45
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/package.json
CHANGED
package/src/paddle-compare.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Link } from "gatsby";
|
|
|
4
4
|
import { PaddleTime } from './paddle-time';
|
|
5
5
|
import { PaddleBookNow } from './paddle-book-now';
|
|
6
6
|
import type { PaddleCompareTypes } from './types/paddle-compare-types';
|
|
7
|
+
import { GatsbyImage } from "gatsby-plugin-image";
|
|
7
8
|
|
|
8
9
|
type TourType = PaddleCompareTypes["tours"][number];
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ type CompareDetailsTypes = {
|
|
|
11
12
|
id: React.Key;
|
|
12
13
|
name: TourType["name"];
|
|
13
14
|
onTourChange: (value: TourType["name"]) => void;
|
|
15
|
+
compositionImage: TourType["compositionImage"] | null;
|
|
14
16
|
link: TourType["slug"];
|
|
15
17
|
sport: TourType["sport"];
|
|
16
18
|
duration?: TourType["duration"];
|
|
@@ -32,6 +34,7 @@ type CompareDetailsTypes = {
|
|
|
32
34
|
const CompareDetails = ({
|
|
33
35
|
name,
|
|
34
36
|
onTourChange,
|
|
37
|
+
compositionImage,
|
|
35
38
|
link,
|
|
36
39
|
sport,
|
|
37
40
|
duration,
|
|
@@ -77,6 +80,14 @@ const CompareDetails = ({
|
|
|
77
80
|
))}
|
|
78
81
|
</select>
|
|
79
82
|
|
|
83
|
+
{compositionImage ? (
|
|
84
|
+
<GatsbyImage
|
|
85
|
+
image={compositionImage.localFile.childImageSharp.gatsbyImageData}
|
|
86
|
+
alt={compositionImage.alternativeText || name}
|
|
87
|
+
className="comparesheet_image"
|
|
88
|
+
/>
|
|
89
|
+
) : <React.Fragment> </React.Fragment>}
|
|
90
|
+
|
|
80
91
|
<h2 className="kilimanjaro">
|
|
81
92
|
<Link to={`/${breadcrumb}/${link}`}>
|
|
82
93
|
{name}
|
|
@@ -116,13 +127,13 @@ const CompareDetails = ({
|
|
|
116
127
|
|
|
117
128
|
export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }: PaddleCompareTypes) => {
|
|
118
129
|
|
|
119
|
-
console.log(tours);
|
|
120
|
-
|
|
121
130
|
let id1 = tours[0].id;
|
|
122
131
|
let id2 = tours[1].id;
|
|
123
132
|
|
|
124
133
|
let [tour1, setTour1] = useState(tours[0].name || "Tour 1");
|
|
125
134
|
let [tour2, setTour2] = useState(tours[1].name || "Tour 2");
|
|
135
|
+
let [image1, setImage1] = useState(tours[0].compositionImage || null);
|
|
136
|
+
let [image2, setImage2] = useState(tours[1].compositionImage || null);
|
|
126
137
|
let [link1, setLink1] = useState(tours[0].slug || "not set");
|
|
127
138
|
let [link2, setLink2] = useState(tours[1].slug || "not set");
|
|
128
139
|
let [sport1, setSport1] = useState(tours[0].sport || "not set");
|
|
@@ -153,6 +164,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
153
164
|
if (!selectedTour) return;
|
|
154
165
|
|
|
155
166
|
setTour1(selectedTour.name);
|
|
167
|
+
setImage1(selectedTour.compositionImage || null);
|
|
156
168
|
setLink1(selectedTour.slug || "not set");
|
|
157
169
|
setSport1(selectedTour.sport || "not set");
|
|
158
170
|
setDuration1(selectedTour.duration || 0);
|
|
@@ -172,6 +184,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
172
184
|
if (!selectedTour) return;
|
|
173
185
|
|
|
174
186
|
setTour2(selectedTour.name);
|
|
187
|
+
setImage2(selectedTour.compositionImage || null);
|
|
175
188
|
setLink2(selectedTour.slug || "not set");
|
|
176
189
|
setSport2(selectedTour.sport || "not set");
|
|
177
190
|
setDuration2(selectedTour.duration || 0);
|
|
@@ -195,6 +208,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
195
208
|
Tour or<br />
|
|
196
209
|
Lesson
|
|
197
210
|
</h3>
|
|
211
|
+
<p>Image</p>
|
|
198
212
|
<p>Sport</p>
|
|
199
213
|
<p>Time</p>
|
|
200
214
|
<p>Fitness</p>
|
|
@@ -208,6 +222,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
208
222
|
<CompareDetails
|
|
209
223
|
id={id1}
|
|
210
224
|
name={tour1}
|
|
225
|
+
compositionImage={image1}
|
|
211
226
|
onTourChange={updateTour1}
|
|
212
227
|
link={link1}
|
|
213
228
|
sport={sport1}
|
|
@@ -231,6 +246,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
231
246
|
<CompareDetails
|
|
232
247
|
id={id2}
|
|
233
248
|
name={tour2}
|
|
249
|
+
compositionImage={image2}
|
|
234
250
|
onTourChange={updateTour2}
|
|
235
251
|
link={link2}
|
|
236
252
|
sport={sport2}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
|
|
2
3
|
|
|
3
4
|
export type PaddleCompareTypes = {
|
|
4
5
|
tours: {
|
|
5
6
|
id: React.Key;
|
|
6
7
|
name: string;
|
|
8
|
+
compositionImage: PaddleGatsbyImageType;
|
|
7
9
|
slug: string;
|
|
8
10
|
sport: string;
|
|
9
11
|
duration?: number;
|