@rileybathurst/paddle 1.9.14 → 1.9.16
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
|
@@ -9,6 +9,10 @@ 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
|
return (
|
|
13
17
|
<section className="location-deck">
|
|
14
18
|
{nodes.map((location: PaddleLocationTypes) => (
|
package/src/paddle-location.tsx
CHANGED
|
@@ -184,7 +184,9 @@ export const PaddleLocation = ({
|
|
|
184
184
|
weatherPermitting
|
|
185
185
|
}: PaddleLocationTypes) => {
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
|
|
188
|
+
// TODO: testing
|
|
189
|
+
console.log("PaddleLocation phone", phone);
|
|
188
190
|
|
|
189
191
|
const content = (
|
|
190
192
|
<Content
|
|
@@ -217,7 +219,7 @@ export const PaddleLocation = ({
|
|
|
217
219
|
{content}
|
|
218
220
|
</a>
|
|
219
221
|
{phone && (
|
|
220
|
-
<Phone phone={
|
|
222
|
+
<Phone phone={phone} />
|
|
221
223
|
)}
|
|
222
224
|
</div>
|
|
223
225
|
) : (
|
|
@@ -226,7 +228,7 @@ export const PaddleLocation = ({
|
|
|
226
228
|
{content}
|
|
227
229
|
</Link>
|
|
228
230
|
{phone && (
|
|
229
|
-
<Phone phone={
|
|
231
|
+
<Phone phone={phone} />
|
|
230
232
|
)}
|
|
231
233
|
</div>
|
|
232
234
|
);
|
package/src/phone.tsx
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
interface FormatPhoneNumberTypes {
|
|
4
|
-
|
|
4
|
+
phone: number;
|
|
5
5
|
}
|
|
6
|
-
const FormatPhoneNumber = ({
|
|
7
|
-
const phoneNumber = String(
|
|
6
|
+
const FormatPhoneNumber = ({ phone }: FormatPhoneNumberTypes) => {
|
|
7
|
+
const phoneNumber = String(phone);
|
|
8
|
+
|
|
9
|
+
// TODO: testing
|
|
10
|
+
console.log("FormatPhoneNumber phone", phone);
|
|
8
11
|
const cleaned = `${phoneNumber}`.replace(/\D/g, "");
|
|
9
12
|
const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
|
|
10
13
|
if (match) {
|
|
14
|
+
|
|
15
|
+
// TODO: testing
|
|
16
|
+
console.log("match", match);
|
|
11
17
|
return `(${match[1]}) ${match[2]}-${match[3]}`;
|
|
12
18
|
}
|
|
13
19
|
return null;
|
|
@@ -18,12 +24,16 @@ type PhoneTypes = {
|
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
const Phone = ({ phone }: PhoneTypes) => {
|
|
27
|
+
|
|
28
|
+
// TODO: testing
|
|
29
|
+
console.log("phone", phone);
|
|
30
|
+
|
|
21
31
|
return (
|
|
22
32
|
<a href={`tel:${phone}`}
|
|
23
33
|
rel="noopener noreferrer"
|
|
24
34
|
className="button location-phone"
|
|
25
35
|
>
|
|
26
|
-
Phone: <FormatPhoneNumber
|
|
36
|
+
Phone: <FormatPhoneNumber phone={phone} />
|
|
27
37
|
</a>
|
|
28
38
|
);
|
|
29
39
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { PaddleLocationTypes } from "./paddle-location-types";
|
|
2
2
|
|
|
3
3
|
export type PaddleLocationDeckTypes = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
phone?: string;
|
|
4
|
+
season_start: string;
|
|
5
|
+
season_end: string;
|
|
6
|
+
phone?: number;
|
|
8
7
|
nodes: PaddleLocationTypes[];
|
|
9
8
|
};
|
|
@@ -15,7 +15,6 @@ export interface PaddleLocationTypes {
|
|
|
15
15
|
season_start: string;
|
|
16
16
|
season_end: string;
|
|
17
17
|
};
|
|
18
|
-
background?: string;
|
|
19
18
|
|
|
20
19
|
streetAddress?: string;
|
|
21
20
|
addressLocality?: string;
|
|
@@ -23,9 +22,9 @@ export interface PaddleLocationTypes {
|
|
|
23
22
|
postalCode?: string;
|
|
24
23
|
commonName?: string;
|
|
25
24
|
|
|
26
|
-
season_start
|
|
27
|
-
season_end
|
|
28
|
-
phone
|
|
25
|
+
season_start: string;
|
|
26
|
+
season_end: string;
|
|
27
|
+
phone: number;
|
|
29
28
|
|
|
30
29
|
offSeasonDetails?: string;
|
|
31
30
|
weatherPermitting?: boolean;
|