@rileybathurst/paddle 1.9.8 → 1.9.10

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.9.8",
4
+ "version": "1.9.10",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "tsc --noEmit && stay-gold && vite",
package/src/index.tsx CHANGED
@@ -8,7 +8,7 @@ export * from "./paddle-featured-sort";
8
8
  // Molecules
9
9
  export * from "./paddle-composition";
10
10
  export * from "./paddle-socials";
11
- export * from "./paddle-location-card";
11
+ export * from "./paddle-location";
12
12
  export * from "./paddle-testimonials";
13
13
  export * from "./paddle-ticket";
14
14
  export * from "./paddle-sunset-tour-times";
@@ -34,8 +34,10 @@ export * from "./paddle-seo";
34
34
 
35
35
  // Types
36
36
  export * from "./types/paddle-ticket-types";
37
- export * from "./types/paddle-location-card-types";
37
+ export * from "./types/paddle-location-types";
38
38
  export * from "./types/paddle-location-deck-types";
39
39
  export * from "./types/paddle-gatsby-image-type";
40
40
  export * from "./types/paddle-purchase-types";
41
- export * from "./types/paddle-brand-types";
41
+ export * from "./types/paddle-brand-types";
42
+ export * from "./types/paddle-book-now-types";
43
+ export * from "./types/paddle-testimonial-types";
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { PaddleLocationCard } from "./paddle-location-card";
3
- import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
2
+ import { PaddleLocation } from "./paddle-location";
3
+ import type { PaddleLocationTypes } from "./types/paddle-location-types";
4
4
  import type { PaddleLocationDeckTypes } from "./types/paddle-location-deck-types";
5
5
 
6
6
  export const PaddleLocationDeck = ({
@@ -11,8 +11,8 @@ export const PaddleLocationDeck = ({
11
11
  }: PaddleLocationDeckTypes) => {
12
12
  return (
13
13
  <section className="location-deck">
14
- {nodes.map((location: PaddleLocationCardTypes) => (
15
- <PaddleLocationCard
14
+ {nodes.map((location: PaddleLocationTypes) => (
15
+ <PaddleLocation
16
16
  key={location.id}
17
17
  season_start={season_start}
18
18
  season_end={season_end}
@@ -0,0 +1,224 @@
1
+ import React from "react"
2
+ import { Link } from "gatsby";
3
+ import Markdown from "react-markdown";
4
+
5
+ import HourMin from "./hour-min";
6
+ import Phone from "./phone";
7
+ import type { PaddleLocationTypes } from "./types/paddle-location-types";
8
+ import SVG from 'react-inlinesvg';
9
+
10
+ type SeasonTypes = {
11
+ season_start?: string;
12
+ season_end?: string;
13
+
14
+ opening_time: string;
15
+ closing_time: string;
16
+ name: string;
17
+ offSeasonDetails?: string;
18
+ weatherPermitting?: boolean;
19
+ }
20
+ const Season = ({
21
+ name,
22
+ season_start,
23
+ season_end,
24
+ opening_time,
25
+ closing_time,
26
+ offSeasonDetails,
27
+ weatherPermitting
28
+ }: SeasonTypes) => {
29
+ // TODO: these need a query but thats not the most important first step
30
+ if (
31
+ name === "Free Parking Lot" ||
32
+ name === "Parking" ||
33
+ name === "Delivery"
34
+ ) {
35
+ return null;
36
+ }
37
+
38
+ if (season_start && season_end) {
39
+ const currentDay = new Date();
40
+ const seasonStartDate = new Date(season_start);
41
+ const seasonEndDate = new Date(season_end);
42
+
43
+ if (currentDay >= seasonStartDate && currentDay <= seasonEndDate) {
44
+ return (
45
+ <p>
46
+ {opening_time ? "Open Daily: " : null}
47
+ {opening_time && closing_time ? (
48
+ <><HourMin time={opening_time} /> - <HourMin time={closing_time} />&nbsp;</>
49
+ ) : null}
50
+ {weatherPermitting ? "Weather Permitting" : null}
51
+ </p>
52
+ );
53
+ }
54
+
55
+ return (
56
+ <div>
57
+ <p>We&apos;re closed for the season</p>
58
+
59
+ {currentDay < seasonStartDate ? (
60
+ <p>We will reopen {season_start}, Weather Permitting</p>
61
+ ) : null}
62
+
63
+ {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
64
+ </div>
65
+ );
66
+ }
67
+
68
+ console.warn(`No season start or end date provided for ${name}. Defaulting to off season.`);
69
+ return (
70
+ <div>
71
+ <p>We&apos;re closed for the season</p>
72
+ {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
73
+ </div>
74
+ );
75
+ };
76
+
77
+ type ContentTypes = {
78
+ link?: string;
79
+ svg: string;
80
+ name: string;
81
+
82
+ description: {
83
+ data: {
84
+ description: string;
85
+ };
86
+ };
87
+ opening_time: string;
88
+ closing_time: string;
89
+
90
+ season_start?: string;
91
+ season_end?: string;
92
+
93
+ offSeasonDetails?: string;
94
+ phone?: number;
95
+ weatherPermitting?: boolean;
96
+
97
+ streetAddress?: string;
98
+ addressLocality?: string;
99
+ addressRegion?: string;
100
+ postalCode?: string;
101
+ commonName?: string;
102
+ }
103
+
104
+ const Content = ({
105
+ svg,
106
+ name,
107
+ description,
108
+ opening_time,
109
+ closing_time,
110
+ streetAddress,
111
+ addressLocality,
112
+ addressRegion,
113
+ postalCode,
114
+ commonName,
115
+ weatherPermitting,
116
+ season_start,
117
+ season_end,
118
+ offSeasonDetails,
119
+ phone,
120
+ }: ContentTypes) => {
121
+ return (
122
+ <>
123
+ <div className="svg">
124
+ <SVG src={svg} />
125
+ </div>
126
+
127
+ <div className="location_details">
128
+ <h3>{name}</h3>
129
+
130
+ {streetAddress ||
131
+ addressLocality ||
132
+ addressRegion ||
133
+ postalCode ||
134
+ commonName ? (
135
+ <address>
136
+ {commonName ? (<>{commonName},<br /></>) : null}
137
+ {streetAddress ? (<>{streetAddress},<br /></>) : null}
138
+ {addressLocality ? (<>{addressLocality},<br /></>) : null}
139
+ {addressRegion ? (<>{addressRegion},&nbsp;</>) : null}
140
+ {postalCode ? (<>{postalCode}</>) : null}
141
+ </address>
142
+ ) : null}
143
+
144
+ {opening_time && closing_time ? (
145
+ <Season
146
+ season_start={season_start}
147
+ season_end={season_end}
148
+ opening_time={opening_time}
149
+ closing_time={closing_time}
150
+ name={name}
151
+ offSeasonDetails={offSeasonDetails}
152
+ weatherPermitting={weatherPermitting}
153
+ />
154
+ ) : (
155
+ <div className="react-markdown">
156
+ <Markdown>{description.data.description}</Markdown>
157
+ </div>
158
+ )}
159
+
160
+ {phone && (
161
+ <Phone phone={phone} />
162
+ )}
163
+ </div>
164
+ </>
165
+ );
166
+ };
167
+
168
+ export const PaddleLocation = ({
169
+ svg,
170
+ name,
171
+ link,
172
+ description,
173
+ opening_time,
174
+ closing_time,
175
+ streetAddress,
176
+ addressLocality,
177
+ addressRegion,
178
+ postalCode,
179
+ commonName,
180
+ season_start,
181
+ season_end,
182
+ phone,
183
+ offSeasonDetails,
184
+ weatherPermitting
185
+ }: PaddleLocationTypes) => {
186
+
187
+ const phoneDidgits = Number(phone);
188
+
189
+ const content = (
190
+ <Content
191
+ svg={svg}
192
+ name={name}
193
+ description={description}
194
+ opening_time={opening_time}
195
+ closing_time={closing_time}
196
+ streetAddress={streetAddress}
197
+ addressLocality={addressLocality}
198
+ addressRegion={addressRegion}
199
+ postalCode={postalCode}
200
+ commonName={commonName}
201
+ season_start={season_start}
202
+ season_end={season_end}
203
+ offSeasonDetails={offSeasonDetails}
204
+ weatherPermitting={weatherPermitting}
205
+ phone={phoneDidgits}
206
+ />
207
+ );
208
+
209
+ return link.includes("http") ? (
210
+ <a
211
+ href={link}
212
+ className="location"
213
+ target="_blank"
214
+ rel="noopener noreferrer"
215
+ title={name}
216
+ >
217
+ {content}
218
+ </a>
219
+ ) : (
220
+ <Link to={link} className="location">
221
+ {content}
222
+ </Link>
223
+ );
224
+ };
@@ -4,6 +4,7 @@ import { GatsbyImage } from "gatsby-plugin-image";
4
4
  import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type";
5
5
  import { PaddleInchesRemainder } from "./paddle-inches-remainder";
6
6
  import { PaddleTextureBackgrounds } from "./paddle-texture-backgrounds";
7
+ import { PaddlePurchaseTypes } from "./types/paddle-purchase-types";
7
8
 
8
9
  // TODO: I'm not sure if this is needed or I can loop it easier
9
10
  interface NameTypes {
@@ -45,18 +46,7 @@ const Badges = ({ inflatable, demo, discount }: BadgeTypes) => {
45
46
  return null;
46
47
  }
47
48
 
48
- type purchaseTypes = {
49
- id: React.Key;
50
- title: string;
51
- slug: string;
52
- excerpt: string;
53
- length: number;
54
- width: number;
55
- inflatable: boolean;
56
- capacity: number;
57
- demo: boolean;
58
- discount?: number;
59
- cutout: PaddleGatsbyImageType;
49
+ interface PurchaseTypes extends PaddlePurchaseTypes {
60
50
  sportSlug: string;
61
51
  brandSlug: string;
62
52
  baseOne: { image: PaddleGatsbyImageType };
@@ -66,7 +56,26 @@ type purchaseTypes = {
66
56
  topTwo: { image: PaddleGatsbyImageType };
67
57
  topThree: { image: PaddleGatsbyImageType };
68
58
  };
69
- export const PaddlePurchase = ({ id, title, slug, excerpt, length, width, inflatable, capacity, demo, discount, cutout, sportSlug, brandSlug, baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: purchaseTypes) => {
59
+ export const PaddlePurchase = ({
60
+ id,
61
+ title,
62
+ slug,
63
+ excerpt,
64
+ length,
65
+ width,
66
+ inflatable,
67
+ capacity,
68
+ demo,
69
+ discount,
70
+ cutout,
71
+ sportSlug,
72
+ brandSlug,
73
+ baseOne,
74
+ baseTwo,
75
+ baseThree,
76
+ topOne,
77
+ topTwo,
78
+ topThree }: PurchaseTypes) => {
70
79
 
71
80
  return (
72
81
  <article key={id} className="purchase">
@@ -1,9 +1,9 @@
1
- import type { PaddleLocationCardTypes } from "./paddle-location-card-types";
1
+ import type { PaddleLocationTypes } from "./paddle-location-types";
2
2
 
3
3
  export type PaddleLocationDeckTypes = {
4
4
  background?: string;
5
5
  season_start?: string; // ? should this be optional? it created a problem with tours
6
6
  season_end?: string;
7
7
  phone?: string;
8
- nodes: PaddleLocationCardTypes[];
8
+ nodes: PaddleLocationTypes[];
9
9
  };
@@ -1,4 +1,4 @@
1
- export interface PaddleLocationCardTypes {
1
+ export interface PaddleLocationTypes {
2
2
  id: React.Key;
3
3
  svg: string;
4
4
  name: string;
@@ -1,399 +0,0 @@
1
- import React from "react"
2
- import { Link } from "gatsby";
3
- import Markdown from "react-markdown";
4
-
5
- import HourMin from "./hour-min";
6
- import Phone from "./phone";
7
- import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
8
- import SVG from 'react-inlinesvg';
9
-
10
- // merged types are possible to dry this up but its also a lot
11
- // type UpdatedUser = Merge<User, Updates>;
12
- type PlaceTypes = {
13
- commonName?: string;
14
- streetAddress?: string;
15
- addressLocality?: string;
16
- addressRegion?: string;
17
- postalCode?: string;
18
- };
19
- const Place = ({ commonName, streetAddress, addressLocality, addressRegion, postalCode }: PlaceTypes) => {
20
- return (
21
- <address>
22
- {commonName ? (<>{commonName},&nbsp;</>) : null}
23
- {streetAddress ? (<>{streetAddress},&nbsp;</>) : null}
24
- {addressLocality ? (<>{addressLocality},&nbsp;</>) : null}
25
- {addressRegion ? (<>{addressRegion},&nbsp;</>) : null}
26
- {postalCode ? (<>{postalCode},&nbsp;</>) : null}
27
- </address>
28
- )
29
- }
30
-
31
- interface SeasonTypes {
32
- season_start?: string;
33
- season_end?: string;
34
-
35
- opening_time: string;
36
- closing_time: string;
37
- name: string;
38
- offSeasonDetails?: string;
39
- weatherPermitting?: boolean;
40
- }
41
- const Season = ({
42
- name,
43
- season_start,
44
- season_end,
45
- opening_time,
46
- closing_time,
47
- offSeasonDetails,
48
- weatherPermitting
49
- }: SeasonTypes) => {
50
- // TODO: these need a query but thats not the most important first step
51
- if (
52
- name === "Free Parking Lot" ||
53
- name === "Parking" ||
54
- name === "Delivery"
55
- ) {
56
- return null;
57
- }
58
-
59
- if (season_start && season_end) {
60
- const currentDay = new Date();
61
- const seasonStartDate = new Date(season_start);
62
- const seasonEndDate = new Date(season_end);
63
-
64
- if (currentDay >= seasonStartDate && currentDay <= seasonEndDate) {
65
- return (
66
- <p>
67
- {opening_time ? "Open Daily: " : null}
68
- {opening_time && closing_time ? (
69
- <><HourMin time={opening_time} /> - <HourMin time={closing_time} />&nbsp;</>
70
- ) : null}
71
- {weatherPermitting ? "Weather Permitting" : null}
72
- </p>
73
- );
74
- }
75
-
76
- // * outside of season
77
- return (
78
- <div>
79
- <p>We&apos;re closed for the season</p>
80
-
81
- {currentDay < seasonStartDate ? (
82
- <p>We will reopen {season_start}, Weather Permitting</p>
83
- ) : null}
84
-
85
- {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
86
- </div>
87
- );
88
- }
89
-
90
- // * no season defaults to off season
91
- // TODO: v1.3 add some enum error messages here for if this is allowed to not have a season
92
- return (
93
- <div>
94
- <p>We&apos;re closed for the season</p>
95
- {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
96
- </div>
97
- );
98
- };
99
-
100
- interface ContentTypes {
101
- link?: string;
102
- svg: string;
103
- name: string;
104
-
105
- description: {
106
- data: {
107
- description: string;
108
- };
109
- };
110
- opening_time: string;
111
- closing_time: string;
112
-
113
- season_start?: string;
114
- season_end?: string;
115
-
116
- offSeasonDetails?: string;
117
- phoneNumber?: number;
118
- weatherPermitting?: boolean;
119
-
120
- streetAddress?: string;
121
- addressLocality?: string;
122
- addressRegion?: string;
123
- postalCode?: string;
124
- commonName?: string;
125
- }
126
- const PhoneContent = ({
127
- link,
128
- svg,
129
- name,
130
- description,
131
- opening_time,
132
- closing_time,
133
- streetAddress,
134
- addressLocality,
135
- addressRegion,
136
- postalCode,
137
- commonName,
138
- season_start,
139
- season_end,
140
- offSeasonDetails,
141
- phoneNumber,
142
- weatherPermitting
143
- }: ContentTypes) => {
144
- return (
145
- <>
146
- {link?.includes("http") ? (
147
- <a
148
- href={link}
149
- className="svg"
150
- target="_blank"
151
- rel="noopener noreferrer"
152
- title={name}
153
- >
154
- <SVG src={svg} />
155
- </a>
156
- ) : (
157
- link && (
158
- <Link to={link} className="svg">
159
- <SVG src={svg} />
160
- </Link>
161
- )
162
- )}
163
-
164
- <div className="location_details">
165
- <div className="multi_button">
166
- {link?.includes("http") ? (
167
- <a
168
- href={link}
169
- target="_blank"
170
- rel="noopener noreferrer"
171
- title={name}
172
- >
173
- <h3>{name}</h3>
174
- </a>
175
- ) : (
176
- link && (
177
- <Link to={link} title={name}>
178
- <h3>{name}</h3>
179
- </Link>
180
- )
181
- )}
182
- {phoneNumber && (
183
- <Phone phone={phoneNumber} />
184
- )}
185
- </div>
186
-
187
- {streetAddress ||
188
- addressLocality ||
189
- addressRegion ||
190
- postalCode ||
191
- commonName ? (
192
-
193
- link?.includes("http") ? (
194
- <a
195
- href={link}
196
- target="_blank"
197
- rel="noopener noreferrer"
198
- title={name}
199
- >
200
- <Place
201
- commonName={commonName}
202
- streetAddress={streetAddress}
203
- addressLocality={addressLocality}
204
- addressRegion={addressRegion}
205
- postalCode={postalCode}
206
- />
207
- </a>
208
- ) : (
209
- link && (
210
- <Link to={link} title={name}>
211
- <Place
212
- commonName={commonName}
213
- streetAddress={streetAddress}
214
- addressLocality={addressLocality}
215
- addressRegion={addressRegion}
216
- postalCode={postalCode}
217
- />
218
- </Link>
219
- )
220
- )
221
- ) : null}
222
-
223
- {opening_time && closing_time ? (
224
- <Season
225
- season_start={season_start}
226
- season_end={season_end}
227
- opening_time={opening_time}
228
- closing_time={closing_time}
229
- name={name}
230
- offSeasonDetails={offSeasonDetails}
231
- weatherPermitting={weatherPermitting}
232
- />
233
- ) : (
234
- <div className="react-markdown">
235
- <Markdown>{description.data.description}</Markdown>
236
- </div>
237
- )}
238
- </div>
239
- </>
240
- );
241
- };
242
-
243
- const Content = ({
244
- svg,
245
- name,
246
- description,
247
- opening_time,
248
- closing_time,
249
- streetAddress,
250
- addressLocality,
251
- addressRegion,
252
- postalCode,
253
- commonName,
254
- weatherPermitting,
255
- season_start,
256
- season_end,
257
- offSeasonDetails,
258
- }: ContentTypes) => {
259
- return (
260
- <>
261
- <div className="svg">
262
- <SVG src={svg} />
263
- </div>
264
-
265
- <div className="location_details">
266
- <div className="multi_button">
267
- <h3>{name}</h3>
268
- </div>
269
-
270
- {streetAddress ||
271
- addressLocality ||
272
- addressRegion ||
273
- postalCode ||
274
- commonName ? (
275
- <Place
276
- commonName={commonName}
277
- streetAddress={streetAddress}
278
- addressLocality={addressLocality}
279
- addressRegion={addressRegion}
280
- postalCode={postalCode}
281
- />
282
- ) : null}
283
-
284
- {opening_time && closing_time ? (
285
- <Season
286
- season_start={season_start}
287
- season_end={season_end}
288
- opening_time={opening_time}
289
- closing_time={closing_time}
290
- name={name}
291
- offSeasonDetails={offSeasonDetails}
292
- weatherPermitting={weatherPermitting}
293
- />
294
- ) : (
295
- <div className="react-markdown">
296
- <Markdown>{description.data.description}</Markdown>
297
- </div>
298
- )}
299
- </div>
300
- </>
301
- );
302
- };
303
-
304
- export const PaddleLocationCard = ({
305
- svg,
306
- name,
307
- link,
308
- description,
309
- opening_time,
310
- closing_time,
311
- streetAddress,
312
- addressLocality,
313
- addressRegion,
314
- postalCode,
315
- commonName,
316
- season_start,
317
- season_end,
318
- phone,
319
- phoneNumber,
320
- offSeasonDetails,
321
- weatherPermitting
322
- }: PaddleLocationCardTypes) => {
323
-
324
- const phoneDidgits = Number(phoneNumber);
325
-
326
- if (phone) {
327
- return (
328
- <div className="location">
329
- <PhoneContent
330
- link={link}
331
- svg={svg}
332
- name={name}
333
- description={description}
334
- opening_time={opening_time}
335
- closing_time={closing_time}
336
- streetAddress={streetAddress}
337
- addressLocality={addressLocality}
338
- addressRegion={addressRegion}
339
- postalCode={postalCode}
340
- commonName={commonName}
341
- season_start={season_start}
342
- season_end={season_end}
343
- offSeasonDetails={offSeasonDetails}
344
- phoneNumber={phoneDidgits}
345
- weatherPermitting={weatherPermitting}
346
- />
347
- </div>
348
- );
349
- }
350
-
351
- if (link.includes("http")) {
352
- return (
353
- <a
354
- href={link}
355
- className="location"
356
- target="_blank"
357
- rel="noopener noreferrer"
358
- title={name}
359
- >
360
- <Content
361
- svg={svg}
362
- name={name}
363
- description={description}
364
- opening_time={opening_time}
365
- closing_time={closing_time}
366
- streetAddress={streetAddress}
367
- addressLocality={addressLocality}
368
- addressRegion={addressRegion}
369
- postalCode={postalCode}
370
- commonName={commonName}
371
- season_start={season_start}
372
- season_end={season_end}
373
- offSeasonDetails={offSeasonDetails}
374
- weatherPermitting={weatherPermitting}
375
- />
376
- </a>
377
- );
378
- }
379
- return (
380
- <Link to={link} className="location">
381
- <Content
382
- svg={svg}
383
- name={name}
384
- description={description}
385
- opening_time={opening_time}
386
- closing_time={closing_time}
387
- streetAddress={streetAddress}
388
- addressLocality={addressLocality}
389
- addressRegion={addressRegion}
390
- postalCode={postalCode}
391
- commonName={commonName}
392
- season_start={season_start}
393
- season_end={season_end}
394
- offSeasonDetails={offSeasonDetails}
395
- weatherPermitting={weatherPermitting}
396
- />
397
- </Link>
398
- );
399
- };