@rileybathurst/paddle 1.9.8 → 1.9.11
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 +1 -1
- package/src/index.tsx +6 -3
- package/src/paddle-location-deck.tsx +5 -5
- package/src/paddle-location.tsx +224 -0
- package/src/paddle-purchase.tsx +23 -22
- package/src/paddle-texture-backgrounds.tsx +8 -8
- package/src/types/paddle-location-deck-types.ts +2 -2
- package/src/types/{paddle-location-card-types.ts → paddle-location-types.ts} +2 -3
- package/src/types/paddle-purchase-image-types.ts +11 -0
- package/src/types/paddle-purchase-types.ts +16 -7
- package/src/paddle-location-card.tsx +0 -399
package/package.json
CHANGED
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
|
|
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,11 @@ export * from "./paddle-seo";
|
|
|
34
34
|
|
|
35
35
|
// Types
|
|
36
36
|
export * from "./types/paddle-ticket-types";
|
|
37
|
-
export * from "./types/paddle-location-
|
|
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-
|
|
41
|
+
export * from "./types/paddle-purchase-image-types";
|
|
42
|
+
export * from "./types/paddle-brand-types";
|
|
43
|
+
export * from "./types/paddle-book-now-types";
|
|
44
|
+
export * from "./types/paddle-testimonial-types";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
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,12 +11,12 @@ export const PaddleLocationDeck = ({
|
|
|
11
11
|
}: PaddleLocationDeckTypes) => {
|
|
12
12
|
return (
|
|
13
13
|
<section className="location-deck">
|
|
14
|
-
{nodes.map((location:
|
|
15
|
-
<
|
|
14
|
+
{nodes.map((location: PaddleLocationTypes) => (
|
|
15
|
+
<PaddleLocation
|
|
16
16
|
key={location.id}
|
|
17
17
|
season_start={season_start}
|
|
18
18
|
season_end={season_end}
|
|
19
|
-
|
|
19
|
+
phone={phone}
|
|
20
20
|
{...location}
|
|
21
21
|
/>
|
|
22
22
|
))}
|
|
@@ -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} /> </>
|
|
49
|
+
) : null}
|
|
50
|
+
{weatherPermitting ? "Weather Permitting" : null}
|
|
51
|
+
</p>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
<p>We'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'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}, </>) : 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
|
+
};
|
package/src/paddle-purchase.tsx
CHANGED
|
@@ -4,6 +4,8 @@ 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";
|
|
8
|
+
import { PaddlePurchaseAndImageTypes } from "./types/paddle-purchase-image-types";
|
|
7
9
|
|
|
8
10
|
// TODO: I'm not sure if this is needed or I can loop it easier
|
|
9
11
|
interface NameTypes {
|
|
@@ -45,28 +47,27 @@ const Badges = ({ inflatable, demo, discount }: BadgeTypes) => {
|
|
|
45
47
|
return null;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
export const PaddlePurchase = ({ id, title, slug, excerpt, length, width, inflatable, capacity, demo, discount, cutout, sportSlug, brandSlug, baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: purchaseTypes) => {
|
|
50
|
+
|
|
51
|
+
export const PaddlePurchase = ({
|
|
52
|
+
id,
|
|
53
|
+
title,
|
|
54
|
+
slug,
|
|
55
|
+
excerpt,
|
|
56
|
+
length,
|
|
57
|
+
width,
|
|
58
|
+
inflatable,
|
|
59
|
+
capacity,
|
|
60
|
+
demo,
|
|
61
|
+
discount,
|
|
62
|
+
cutout,
|
|
63
|
+
sportSlug,
|
|
64
|
+
brandSlug,
|
|
65
|
+
baseOne,
|
|
66
|
+
baseTwo,
|
|
67
|
+
baseThree,
|
|
68
|
+
topOne,
|
|
69
|
+
topTwo,
|
|
70
|
+
topThree }: PaddlePurchaseAndImageTypes) => {
|
|
70
71
|
|
|
71
72
|
return (
|
|
72
73
|
<article key={id} className="purchase">
|
|
@@ -3,12 +3,12 @@ import { GatsbyImage } from "gatsby-plugin-image";
|
|
|
3
3
|
import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type";
|
|
4
4
|
|
|
5
5
|
type textureTypes = {
|
|
6
|
-
baseOne:
|
|
7
|
-
baseTwo:
|
|
8
|
-
baseThree:
|
|
9
|
-
topOne:
|
|
10
|
-
topTwo:
|
|
11
|
-
topThree:
|
|
6
|
+
baseOne: PaddleGatsbyImageType;
|
|
7
|
+
baseTwo: PaddleGatsbyImageType;
|
|
8
|
+
baseThree: PaddleGatsbyImageType;
|
|
9
|
+
topOne: PaddleGatsbyImageType;
|
|
10
|
+
topTwo: PaddleGatsbyImageType;
|
|
11
|
+
topThree: PaddleGatsbyImageType;
|
|
12
12
|
};
|
|
13
13
|
export const PaddleTextureBackgrounds = ({ baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: textureTypes) => {
|
|
14
14
|
const baseTextures = [
|
|
@@ -30,13 +30,13 @@ export const PaddleTextureBackgrounds = ({ baseOne, baseTwo, baseThree, topOne,
|
|
|
30
30
|
return (
|
|
31
31
|
<>
|
|
32
32
|
<GatsbyImage
|
|
33
|
-
image={baseTextures[baseRandom].
|
|
33
|
+
image={baseTextures[baseRandom].localFile.childImageSharp.gatsbyImageData}
|
|
34
34
|
alt="splash texture"
|
|
35
35
|
className="texture-slice"
|
|
36
36
|
objectFit="contain"
|
|
37
37
|
/>
|
|
38
38
|
<GatsbyImage
|
|
39
|
-
image={topTextures[topRandom].
|
|
39
|
+
image={topTextures[topRandom].localFile.childImageSharp.gatsbyImageData}
|
|
40
40
|
alt="sand texture"
|
|
41
41
|
className="texture-slice crop"
|
|
42
42
|
objectFit="contain"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
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:
|
|
8
|
+
nodes: PaddleLocationTypes[];
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PaddleLocationTypes {
|
|
2
2
|
id: React.Key;
|
|
3
3
|
svg: string;
|
|
4
4
|
name: string;
|
|
@@ -25,9 +25,8 @@ export interface PaddleLocationCardTypes {
|
|
|
25
25
|
|
|
26
26
|
season_start?: string;
|
|
27
27
|
season_end?: string;
|
|
28
|
-
|
|
28
|
+
phone?: string;
|
|
29
29
|
|
|
30
30
|
offSeasonDetails?: string;
|
|
31
|
-
phone?: boolean;
|
|
32
31
|
weatherPermitting?: boolean;
|
|
33
32
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
|
|
2
|
+
import type { PaddlePurchaseTypes } from "./paddle-purchase-types";
|
|
3
|
+
|
|
4
|
+
export type PaddlePurchaseAndImageTypes = PaddlePurchaseTypes & {
|
|
5
|
+
baseOne: { image: PaddleGatsbyImageType };
|
|
6
|
+
baseTwo: { image: PaddleGatsbyImageType };
|
|
7
|
+
baseThree: { image: PaddleGatsbyImageType };
|
|
8
|
+
topOne: { image: PaddleGatsbyImageType };
|
|
9
|
+
topTwo: { image: PaddleGatsbyImageType };
|
|
10
|
+
topThree: { image: PaddleGatsbyImageType };
|
|
11
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type BasePaddlePurchaseTypes = {
|
|
4
4
|
id: React.Key;
|
|
5
5
|
title: string;
|
|
6
6
|
slug: string;
|
|
@@ -12,10 +12,19 @@ export type PaddlePurchaseTypes = {
|
|
|
12
12
|
demo: boolean;
|
|
13
13
|
discount?: number;
|
|
14
14
|
cutout: PaddleGatsbyImageType;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
15
|
+
|
|
16
|
+
baseOne: { image: PaddleGatsbyImageType };
|
|
17
|
+
baseTwo: { image: PaddleGatsbyImageType };
|
|
18
|
+
baseThree: { image: PaddleGatsbyImageType };
|
|
19
|
+
topOne: { image: PaddleGatsbyImageType };
|
|
20
|
+
topTwo: { image: PaddleGatsbyImageType };
|
|
21
|
+
topThree: { image: PaddleGatsbyImageType };
|
|
21
22
|
};
|
|
23
|
+
|
|
24
|
+
export type PaddlePurchaseTypes = BasePaddlePurchaseTypes & (
|
|
25
|
+
| { sport: { slug: string }; sportSlug?: string }
|
|
26
|
+
| { sportSlug: string; sport?: { slug: string } }
|
|
27
|
+
) & (
|
|
28
|
+
| { brand: { slug: string }; brandSlug?: string }
|
|
29
|
+
| { brandSlug: string; brand?: { slug: string } }
|
|
30
|
+
);
|
|
@@ -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}, </>) : null}
|
|
23
|
-
{streetAddress ? (<>{streetAddress}, </>) : null}
|
|
24
|
-
{addressLocality ? (<>{addressLocality}, </>) : null}
|
|
25
|
-
{addressRegion ? (<>{addressRegion}, </>) : null}
|
|
26
|
-
{postalCode ? (<>{postalCode}, </>) : 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} /> </>
|
|
70
|
-
) : null}
|
|
71
|
-
{weatherPermitting ? "Weather Permitting" : null}
|
|
72
|
-
</p>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// * outside of season
|
|
77
|
-
return (
|
|
78
|
-
<div>
|
|
79
|
-
<p>We'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'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
|
-
};
|