@rileybathurst/paddle 1.9.16 → 1.9.18
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/paddle-location-deck.tsx +1 -4
- package/src/paddle-location.tsx +18 -24
- package/src/paddle-purchase.tsx +1 -5
- package/src/phone.tsx +0 -8
- package/src/types/paddle-location-deck-types.ts +1 -1
- package/src/types/paddle-location-types.ts +5 -3
- package/src/types/paddle-purchase-types.ts +9 -10
package/package.json
CHANGED
|
@@ -9,19 +9,16 @@ export const PaddleLocationDeck = ({
|
|
|
9
9
|
season_end,
|
|
10
10
|
phone
|
|
11
11
|
}: PaddleLocationDeckTypes) => {
|
|
12
|
-
|
|
13
|
-
// TODO: testing
|
|
14
|
-
console.log("PaddleLocationDeck phone", phone);
|
|
15
12
|
|
|
16
13
|
return (
|
|
17
14
|
<section className="location-deck">
|
|
18
15
|
{nodes.map((location: PaddleLocationTypes) => (
|
|
19
16
|
<PaddleLocation
|
|
20
17
|
key={location.id}
|
|
18
|
+
{...location}
|
|
21
19
|
season_start={season_start}
|
|
22
20
|
season_end={season_end}
|
|
23
21
|
phone={phone}
|
|
24
|
-
{...location}
|
|
25
22
|
/>
|
|
26
23
|
))}
|
|
27
24
|
</section>
|
package/src/paddle-location.tsx
CHANGED
|
@@ -54,13 +54,17 @@ const Season = ({
|
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<div>
|
|
57
|
-
|
|
57
|
+
{offSeasonDetails ? (
|
|
58
|
+
<p>{offSeasonDetails}</p>
|
|
59
|
+
) : (
|
|
60
|
+
<p>We're closed for the season</p>
|
|
61
|
+
)}
|
|
58
62
|
|
|
59
63
|
{currentDay < seasonStartDate ? (
|
|
60
64
|
<p>We will reopen {season_start}, Weather Permitting</p>
|
|
61
65
|
) : null}
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
|
|
64
68
|
</div>
|
|
65
69
|
);
|
|
66
70
|
}
|
|
@@ -68,7 +72,6 @@ const Season = ({
|
|
|
68
72
|
console.warn(`No season start or end date provided for ${name}. Defaulting to off season.`);
|
|
69
73
|
return (
|
|
70
74
|
<div>
|
|
71
|
-
<p>We're closed for the season</p>
|
|
72
75
|
{offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
|
|
73
76
|
</div>
|
|
74
77
|
);
|
|
@@ -87,11 +90,10 @@ type ContentTypes = {
|
|
|
87
90
|
opening_time: string;
|
|
88
91
|
closing_time: string;
|
|
89
92
|
|
|
90
|
-
season_start
|
|
91
|
-
season_end
|
|
93
|
+
season_start: string;
|
|
94
|
+
season_end: string;
|
|
92
95
|
|
|
93
96
|
offSeasonDetails?: string;
|
|
94
|
-
phone?: number;
|
|
95
97
|
weatherPermitting?: boolean;
|
|
96
98
|
|
|
97
99
|
streetAddress?: string;
|
|
@@ -116,7 +118,6 @@ const Content = ({
|
|
|
116
118
|
season_start,
|
|
117
119
|
season_end,
|
|
118
120
|
offSeasonDetails,
|
|
119
|
-
phone,
|
|
120
121
|
}: ContentTypes) => {
|
|
121
122
|
return (
|
|
122
123
|
<React.Fragment>
|
|
@@ -156,10 +157,6 @@ const Content = ({
|
|
|
156
157
|
<Markdown>{description.data.description}</Markdown>
|
|
157
158
|
</div>
|
|
158
159
|
)}
|
|
159
|
-
|
|
160
|
-
{phone && (
|
|
161
|
-
<Phone phone={phone} />
|
|
162
|
-
)}
|
|
163
160
|
</div>
|
|
164
161
|
</React.Fragment>
|
|
165
162
|
);
|
|
@@ -177,17 +174,14 @@ export const PaddleLocation = ({
|
|
|
177
174
|
addressRegion,
|
|
178
175
|
postalCode,
|
|
179
176
|
commonName,
|
|
180
|
-
season_start,
|
|
181
|
-
season_end,
|
|
182
|
-
phone,
|
|
183
177
|
offSeasonDetails,
|
|
184
|
-
weatherPermitting
|
|
178
|
+
weatherPermitting,
|
|
179
|
+
showThePhone,
|
|
180
|
+
phone,
|
|
181
|
+
season_start,
|
|
182
|
+
season_end
|
|
185
183
|
}: PaddleLocationTypes) => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// TODO: testing
|
|
189
|
-
console.log("PaddleLocation phone", phone);
|
|
190
|
-
|
|
184
|
+
|
|
191
185
|
const content = (
|
|
192
186
|
<Content
|
|
193
187
|
svg={svg}
|
|
@@ -208,7 +202,7 @@ export const PaddleLocation = ({
|
|
|
208
202
|
);
|
|
209
203
|
|
|
210
204
|
return link.includes("http") ? (
|
|
211
|
-
<div className={`location-wrapper ${
|
|
205
|
+
<div className={`location-wrapper ${showThePhone ? 'phone-spacer' : ''}`}>
|
|
212
206
|
<a
|
|
213
207
|
href={link}
|
|
214
208
|
className="location"
|
|
@@ -218,16 +212,16 @@ export const PaddleLocation = ({
|
|
|
218
212
|
>
|
|
219
213
|
{content}
|
|
220
214
|
</a>
|
|
221
|
-
{phone && (
|
|
215
|
+
{showThePhone && phone && (
|
|
222
216
|
<Phone phone={phone} />
|
|
223
217
|
)}
|
|
224
218
|
</div>
|
|
225
219
|
) : (
|
|
226
|
-
<div className={`location-wrapper ${
|
|
220
|
+
<div className={`location-wrapper ${showThePhone ? 'phone-spacer' : ''}`}>
|
|
227
221
|
<Link to={link} className="location">
|
|
228
222
|
{content}
|
|
229
223
|
</Link>
|
|
230
|
-
{phone && (
|
|
224
|
+
{showThePhone && phone && (
|
|
231
225
|
<Phone phone={phone} />
|
|
232
226
|
)}
|
|
233
227
|
</div>
|
package/src/paddle-purchase.tsx
CHANGED
|
@@ -5,11 +5,7 @@ import { PaddleInchesRemainder } from "./paddle-inches-remainder";
|
|
|
5
5
|
import { PaddleTextureBackgrounds } from "./paddle-texture-backgrounds";
|
|
6
6
|
import { PaddlePurchaseAndImageTypes } from "./types/paddle-purchase-image-types";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
interface NameTypes {
|
|
10
|
-
name: string;
|
|
11
|
-
}
|
|
12
|
-
function Name({ name }: NameTypes) {
|
|
8
|
+
function Name({ name }: { name: string }) {
|
|
13
9
|
return (
|
|
14
10
|
<div className="badge">
|
|
15
11
|
<h5 className="capitalize">{name}</h5>
|
package/src/phone.tsx
CHANGED
|
@@ -6,14 +6,9 @@ interface FormatPhoneNumberTypes {
|
|
|
6
6
|
const FormatPhoneNumber = ({ phone }: FormatPhoneNumberTypes) => {
|
|
7
7
|
const phoneNumber = String(phone);
|
|
8
8
|
|
|
9
|
-
// TODO: testing
|
|
10
|
-
console.log("FormatPhoneNumber phone", phone);
|
|
11
9
|
const cleaned = `${phoneNumber}`.replace(/\D/g, "");
|
|
12
10
|
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
13
11
|
if (match) {
|
|
14
|
-
|
|
15
|
-
// TODO: testing
|
|
16
|
-
console.log("match", match);
|
|
17
12
|
return `(${match[1]}) ${match[2]}-${match[3]}`;
|
|
18
13
|
}
|
|
19
14
|
return null;
|
|
@@ -25,9 +20,6 @@ type PhoneTypes = {
|
|
|
25
20
|
|
|
26
21
|
const Phone = ({ phone }: PhoneTypes) => {
|
|
27
22
|
|
|
28
|
-
// TODO: testing
|
|
29
|
-
console.log("phone", phone);
|
|
30
|
-
|
|
31
23
|
return (
|
|
32
24
|
<a href={`tel:${phone}`}
|
|
33
25
|
rel="noopener noreferrer"
|
|
@@ -22,10 +22,12 @@ export interface PaddleLocationTypes {
|
|
|
22
22
|
postalCode?: string;
|
|
23
23
|
commonName?: string;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
season_end: string;
|
|
27
|
-
phone: number;
|
|
25
|
+
showThePhone: boolean;
|
|
28
26
|
|
|
29
27
|
offSeasonDetails?: string;
|
|
30
28
|
weatherPermitting?: boolean;
|
|
29
|
+
|
|
30
|
+
phone: number;
|
|
31
|
+
season_start: string;
|
|
32
|
+
season_end: string;
|
|
31
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
export type PaddlePurchaseTypes = {
|
|
4
4
|
id: React.Key;
|
|
5
5
|
title: string;
|
|
6
6
|
slug: string;
|
|
@@ -13,18 +13,17 @@ type BasePaddlePurchaseTypes = {
|
|
|
13
13
|
discount?: number;
|
|
14
14
|
cutout: PaddleGatsbyImageType;
|
|
15
15
|
|
|
16
|
+
sport: {
|
|
17
|
+
slug: string
|
|
18
|
+
};
|
|
19
|
+
brand: {
|
|
20
|
+
slug: string
|
|
21
|
+
};
|
|
22
|
+
|
|
16
23
|
baseOne: { image: PaddleGatsbyImageType };
|
|
17
24
|
baseTwo: { image: PaddleGatsbyImageType };
|
|
18
25
|
baseThree: { image: PaddleGatsbyImageType };
|
|
19
26
|
topOne: { image: PaddleGatsbyImageType };
|
|
20
27
|
topTwo: { image: PaddleGatsbyImageType };
|
|
21
28
|
topThree: { image: PaddleGatsbyImageType };
|
|
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
|
-
);
|
|
29
|
+
};
|