@rileybathurst/paddle 1.9.42 → 1.9.44
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
|
+
image: TourType["image"] | 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
|
+
image,
|
|
35
38
|
link,
|
|
36
39
|
sport,
|
|
37
40
|
duration,
|
|
@@ -57,9 +60,6 @@ const CompareDetails = ({
|
|
|
57
60
|
timeframe: timeframe,
|
|
58
61
|
});
|
|
59
62
|
|
|
60
|
-
// TODO: testing
|
|
61
|
-
console.log(breadcrumb, link);
|
|
62
|
-
|
|
63
63
|
return (
|
|
64
64
|
<section>
|
|
65
65
|
<select
|
|
@@ -80,8 +80,16 @@ const CompareDetails = ({
|
|
|
80
80
|
))}
|
|
81
81
|
</select>
|
|
82
82
|
|
|
83
|
+
{image ? (
|
|
84
|
+
<GatsbyImage
|
|
85
|
+
image={image.localFile.childImageSharp.gatsbyImageData}
|
|
86
|
+
alt={image.alternativeText || name}
|
|
87
|
+
className="comparesheet_image"
|
|
88
|
+
/>
|
|
89
|
+
) : null}
|
|
90
|
+
|
|
83
91
|
<h2 className="kilimanjaro">
|
|
84
|
-
<Link to={`/${breadcrumb}
|
|
92
|
+
<Link to={`/${breadcrumb}/${link}`}>
|
|
85
93
|
{name}
|
|
86
94
|
</Link>
|
|
87
95
|
</h2>
|
|
@@ -119,13 +127,13 @@ const CompareDetails = ({
|
|
|
119
127
|
|
|
120
128
|
export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }: PaddleCompareTypes) => {
|
|
121
129
|
|
|
122
|
-
console.log(tours);
|
|
123
|
-
|
|
124
130
|
let id1 = tours[0].id;
|
|
125
131
|
let id2 = tours[1].id;
|
|
126
132
|
|
|
127
133
|
let [tour1, setTour1] = useState(tours[0].name || "Tour 1");
|
|
128
134
|
let [tour2, setTour2] = useState(tours[1].name || "Tour 2");
|
|
135
|
+
let [image1, setImage1] = useState(tours[0].image || null);
|
|
136
|
+
let [image2, setImage2] = useState(tours[1].image || null);
|
|
129
137
|
let [link1, setLink1] = useState(tours[0].slug || "not set");
|
|
130
138
|
let [link2, setLink2] = useState(tours[1].slug || "not set");
|
|
131
139
|
let [sport1, setSport1] = useState(tours[0].sport || "not set");
|
|
@@ -156,6 +164,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
156
164
|
if (!selectedTour) return;
|
|
157
165
|
|
|
158
166
|
setTour1(selectedTour.name);
|
|
167
|
+
setImage1(selectedTour.image || null);
|
|
159
168
|
setLink1(selectedTour.slug || "not set");
|
|
160
169
|
setSport1(selectedTour.sport || "not set");
|
|
161
170
|
setDuration1(selectedTour.duration || 0);
|
|
@@ -175,6 +184,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
175
184
|
if (!selectedTour) return;
|
|
176
185
|
|
|
177
186
|
setTour2(selectedTour.name);
|
|
187
|
+
setImage2(selectedTour.image || null);
|
|
178
188
|
setLink2(selectedTour.slug || "not set");
|
|
179
189
|
setSport2(selectedTour.sport || "not set");
|
|
180
190
|
setDuration2(selectedTour.duration || 0);
|
|
@@ -198,6 +208,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
198
208
|
Tour or<br />
|
|
199
209
|
Lesson
|
|
200
210
|
</h3>
|
|
211
|
+
<p>Image</p>
|
|
201
212
|
<p>Sport</p>
|
|
202
213
|
<p>Time</p>
|
|
203
214
|
<p>Fitness</p>
|
|
@@ -211,6 +222,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
211
222
|
<CompareDetails
|
|
212
223
|
id={id1}
|
|
213
224
|
name={tour1}
|
|
225
|
+
image={image1}
|
|
214
226
|
onTourChange={updateTour1}
|
|
215
227
|
link={link1}
|
|
216
228
|
sport={sport1}
|
|
@@ -234,6 +246,7 @@ export const PaddleCompare = ({ tours, breadcrumb, strapiBranchName, peek_base }
|
|
|
234
246
|
<CompareDetails
|
|
235
247
|
id={id2}
|
|
236
248
|
name={tour2}
|
|
249
|
+
image={image2}
|
|
237
250
|
onTourChange={updateTour2}
|
|
238
251
|
link={link2}
|
|
239
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
|
+
image: PaddleGatsbyImageType;
|
|
7
9
|
slug: string;
|
|
8
10
|
sport: string;
|
|
9
11
|
duration?: number;
|