@rileybathurst/paddle 1.9.15 → 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.9.15",
4
+ "version": "1.9.16",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "tsc --noEmit && stay-gold && vite",
@@ -184,8 +184,6 @@ export const PaddleLocation = ({
184
184
  weatherPermitting
185
185
  }: PaddleLocationTypes) => {
186
186
 
187
- const phoneDidgits = Number(phone);
188
-
189
187
 
190
188
  // TODO: testing
191
189
  console.log("PaddleLocation phone", phone);
@@ -221,7 +219,7 @@ export const PaddleLocation = ({
221
219
  {content}
222
220
  </a>
223
221
  {phone && (
224
- <Phone phone={phoneDidgits} />
222
+ <Phone phone={phone} />
225
223
  )}
226
224
  </div>
227
225
  ) : (
@@ -230,7 +228,7 @@ export const PaddleLocation = ({
230
228
  {content}
231
229
  </Link>
232
230
  {phone && (
233
- <Phone phone={phoneDidgits} />
231
+ <Phone phone={phone} />
234
232
  )}
235
233
  </div>
236
234
  );
package/src/phone.tsx CHANGED
@@ -1,13 +1,19 @@
1
1
  import * as React from "react";
2
2
 
3
3
  interface FormatPhoneNumberTypes {
4
- phoneNumberString: number;
4
+ phone: number;
5
5
  }
6
- const FormatPhoneNumber = ({ phoneNumberString }: FormatPhoneNumberTypes) => {
7
- const phoneNumber = String(phoneNumberString);
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;
@@ -19,7 +25,6 @@ type PhoneTypes = {
19
25
 
20
26
  const Phone = ({ phone }: PhoneTypes) => {
21
27
 
22
-
23
28
  // TODO: testing
24
29
  console.log("phone", phone);
25
30
 
@@ -28,7 +33,7 @@ const Phone = ({ phone }: PhoneTypes) => {
28
33
  rel="noopener noreferrer"
29
34
  className="button location-phone"
30
35
  >
31
- Phone: <FormatPhoneNumber phoneNumberString={phone} />
36
+ Phone: <FormatPhoneNumber phone={phone} />
32
37
  </a>
33
38
  );
34
39
  };
@@ -1,9 +1,8 @@
1
1
  import type { PaddleLocationTypes } from "./paddle-location-types";
2
2
 
3
3
  export type PaddleLocationDeckTypes = {
4
- background?: string;
5
- season_start?: string; // ? should this be optional? it created a problem with tours
6
- season_end?: string;
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?: string;
27
- season_end?: string;
28
- phone?: string;
25
+ season_start: string;
26
+ season_end: string;
27
+ phone: number;
29
28
 
30
29
  offSeasonDetails?: string;
31
30
  weatherPermitting?: boolean;