@rileybathurst/paddle 1.2.8 → 1.3.1

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/index.tsx +23 -20
  3. package/src/paddle-book-now.tsx +16 -0
  4. package/src/{PaddleBrandList.tsx → paddle-brand-list.tsx} +1 -3
  5. package/src/{PaddleComposition.tsx → paddle-composition.tsx} +8 -8
  6. package/src/paddle-format-phone-number.tsx +11 -0
  7. package/src/{PaddleLocationCard.tsx → paddle-location-card.tsx} +1 -1
  8. package/src/{PaddleLocationDeck.tsx → paddle-location-deck.tsx} +3 -2
  9. package/src/{PaddleMoonlightTourDatesTimes.tsx → paddle-moonlight-tour-dates-times.tsx} +1 -1
  10. package/src/paddle-pricing-chart.tsx +64 -0
  11. package/src/{PaddlePurchase.tsx → paddle-purchase.tsx} +11 -11
  12. package/src/{PaddleSEO.tsx → paddle-seo.tsx} +6 -7
  13. package/src/{PaddleSunsetTourTimes.tsx → paddle-sunset-tour-times.tsx} +1 -1
  14. package/src/{PaddleTestimonial.tsx → paddle-testimonial.tsx} +1 -1
  15. package/src/{PaddleTestimonials.tsx → paddle-testimonials.tsx} +2 -2
  16. package/src/{PaddleTextureBackgrounds.tsx → paddle-texture-backgrounds.tsx} +7 -8
  17. package/src/{PaddleTicket.tsx → paddle-ticket.tsx} +3 -3
  18. package/src/types/paddle-book-now-types.ts +6 -0
  19. package/src/types/paddle-brand-types.ts +1 -1
  20. package/src/types/{gatsby-image-type.ts → paddle-gatsby-image-type.ts} +1 -1
  21. package/src/types/paddle-location-deck-types.ts +1 -1
  22. package/src/types/paddle-pricing-chart-types.ts +25 -0
  23. package/src/types/paddle-purchase-types.ts +3 -3
  24. package/src/types/paddle-testimonial-types.ts +7 -0
  25. package/src/types/{ticket-types.ts → paddle-ticket-types.ts} +3 -5
  26. package/src/PaddleBookNow.tsx +0 -18
  27. package/src/types/testimonial-types.ts +0 -7
  28. /package/src/{PaddleInchesRemainder.tsx → paddle-inches-remainder.tsx} +0 -0
  29. /package/src/{PaddleSocials.tsx → paddle-socials.tsx} +0 -0
  30. /package/src/{PaddleSpecs.tsx → paddle-specs.tsx} +0 -0
  31. /package/src/{PaddleTime.tsx → paddle-time.tsx} +0 -0
  32. /package/src/{PaddleTopBar.tsx → paddle-top-bar.tsx} +0 -0
  33. /package/src/types/{location-card-types.ts → paddle-location-card-types.ts} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.2.8",
4
+ "version": "1.3.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
package/src/index.tsx CHANGED
@@ -1,37 +1,40 @@
1
1
  // Atoms
2
- export * from "./PaddleBookNow";
3
- export * from "./PaddleTime";
2
+ export * from "./paddle-book-now";
3
+ export * from "./paddle-time";
4
4
  export * from "./paddle-remainder";
5
+ export * from "./paddle-format-phone-number";
5
6
 
6
7
  // Molecules
7
- export * from "./PaddleComposition";
8
- export * from "./PaddleSocials";
9
- export * from "./PaddleLocationCard";
10
- export * from "./PaddleTestimonials";
11
- export * from "./PaddleTicket";
12
- export * from "./PaddleSunsetTourTimes";
13
- export * from "./PaddleTopBar";
14
- export * from "./PaddleSpecs";
15
- export * from "./PaddleTestimonial";
16
- export * from "./PaddlePurchase";
8
+ export * from "./paddle-composition";
9
+ export * from "./paddle-socials";
10
+ export * from "./paddle-location-card";
11
+ export * from "./paddle-testimonials";
12
+ export * from "./paddle-ticket";
13
+ export * from "./paddle-sunset-tour-times";
14
+ export * from "./paddle-top-bar";
15
+ export * from "./paddle-specs";
16
+ export * from "./paddle-testimonial";
17
+ export * from "./paddle-purchase";
18
+ export * from "./paddle-pricing-chart";
19
+ export * from "./paddle-texture-backgrounds";
17
20
 
18
21
  // Organisms
19
- export * from "./PaddleLocationDeck";
20
- export * from "./PaddleTestimonials";
21
- export * from "./PaddleBrandList";
22
- export * from "./PaddleMoonlightTourDatesTimes"
22
+ export * from "./paddle-location-deck";
23
+ export * from "./paddle-testimonials";
24
+ export * from "./paddle-brand-list";
25
+ export * from "./paddle-moonlight-tour-dates-times"
23
26
 
24
27
  // Templates
25
28
 
26
29
  // Pages
27
30
 
28
31
  // SEO
29
- export * from "./PaddleSEO";
32
+ export * from "./paddle-seo";
30
33
 
31
34
  // Types
32
- export * from "./types/ticket-types";
33
- export * from "./types/location-card-types";
35
+ export * from "./types/paddle-ticket-types";
36
+ export * from "./types/paddle-location-card-types";
34
37
  export * from "./types/paddle-location-deck-types";
35
- export * from "./types/gatsby-image-type";
38
+ export * from "./types/paddle-gatsby-image-type";
36
39
  export * from "./types/paddle-purchase-types";
37
40
  export * from "./types/paddle-brand-types";
@@ -0,0 +1,16 @@
1
+ import * as React from "react"
2
+ import type { PaddleBookNowTypes } from "./types/paddle-book-now-types";
3
+
4
+ export const PaddleBookNow = ({ peek_base, strapiLocaleName, specificName, specificLink }: PaddleBookNowTypes) => {
5
+ return (
6
+ <a
7
+ href={specificLink || peek_base}
8
+ rel="noopener noreferrer"
9
+ className="book-now"
10
+ title={`Book now ${specificLink && <> {specificLink} </>} with ${strapiLocaleName} kayak and paddleboard`}
11
+ >
12
+ {specificName && (<>{specificName} <br /></>)}
13
+ BOOK NOW
14
+ </a>
15
+ );
16
+ };
@@ -5,7 +5,7 @@ import type { PaddleBrandType } from "./types/paddle-brand-types";
5
5
 
6
6
  // * additional work is done here to split kayak and paddleboard
7
7
 
8
- const PaddleBrandList = ({ nodes, sport }: { nodes: PaddleBrandType[]; sport?: string }) => {
8
+ export const PaddleBrandList = ({ nodes, sport }: { nodes: PaddleBrandType[]; sport?: string }) => {
9
9
 
10
10
  const BrandSet = new Set<PaddleBrandType>();
11
11
  let BrandArray: PaddleBrandType[] = [];
@@ -45,5 +45,3 @@ const PaddleBrandList = ({ nodes, sport }: { nodes: PaddleBrandType[]; sport?: s
45
45
  </ul>
46
46
  )
47
47
  }
48
-
49
- export default PaddleBrandList
@@ -2,15 +2,15 @@
2
2
 
3
3
  import * as React from "react"
4
4
  import { GatsbyImage } from "gatsby-plugin-image"
5
- import type { GatsbyImageType } from "./types/gatsby-image-type"
5
+ import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type"
6
6
 
7
7
  type defaultPaddlerTypes = {
8
8
  sport?: string;
9
9
  defaultKayaker: {
10
- image: GatsbyImageType;
10
+ image: PaddleGatsbyImageType;
11
11
  };
12
12
  defaultPaddleboarder: {
13
- image: GatsbyImageType;
13
+ image: PaddleGatsbyImageType;
14
14
  };
15
15
  }
16
16
  const DefaultPaddler = ({ sport, defaultKayaker, defaultPaddleboarder }: defaultPaddlerTypes) => {
@@ -34,18 +34,18 @@ const DefaultPaddler = ({ sport, defaultKayaker, defaultPaddleboarder }: default
34
34
 
35
35
  interface CompositionTypes {
36
36
  sport?: string;
37
- image?: GatsbyImageType;
37
+ image?: PaddleGatsbyImageType;
38
38
  defaultKayaker: {
39
- image: GatsbyImageType;
39
+ image: PaddleGatsbyImageType;
40
40
  }
41
41
  defaultPaddleboarder: {
42
- image: GatsbyImageType;
42
+ image: PaddleGatsbyImageType;
43
43
  }
44
44
  sandTexture: {
45
- image: GatsbyImageType;
45
+ image: PaddleGatsbyImageType;
46
46
  };
47
47
  waterTexture: {
48
- image: GatsbyImageType;
48
+ image: PaddleGatsbyImageType;
49
49
  };
50
50
  }
51
51
  export const PaddleComposition = ({ sport, image, defaultKayaker, defaultPaddleboarder, sandTexture, waterTexture }: CompositionTypes) => {
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+
3
+ export const PaddleFormatPhoneNumber = ({ phoneNumberString }: { phoneNumberString: number }) => {
4
+ const cleaned = (`${phoneNumberString}`).replace(/\D/g, '');
5
+ const match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
6
+ if (match) {
7
+ return <>({match[1]}) {match[2]}-{match[3]}</>;
8
+ }
9
+ console.warn(`Invalid phone number format: ${phoneNumberString}`);
10
+ return null;
11
+ }
@@ -4,7 +4,7 @@ import Markdown from "react-markdown";
4
4
 
5
5
  import HourMin from "./hour-min";
6
6
  import Phone from "./phone";
7
- import type { PaddleLocationCardTypes } from "./types/location-card-types";
7
+ import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
8
8
  import SVG from 'react-inlinesvg';
9
9
 
10
10
  // merged types are possible to dry this up but its also a lot
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
- import { PaddleLocationCard } from "./PaddleLocationCard";
3
- import type { PaddleLocationCardTypes } from "./types/location-card-types";
2
+ import { PaddleLocationCard } from "./paddle-location-card";
3
+ import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
4
+ import type { PaddleLocationDeckTypes } from "./types/paddle-location-deck-types";
4
5
 
5
6
  export const PaddleLocationDeck = ({
6
7
  nodes,
@@ -5,7 +5,7 @@ type PaddleMoonlightTourDatesTimesTypes = {
5
5
  seasonStart: string
6
6
  seasonEnd: string
7
7
  nodes: {
8
- id: string;
8
+ id: React.Key;
9
9
  date: string;
10
10
  start: string;
11
11
  finish: string;
@@ -0,0 +1,64 @@
1
+ import * as React from "react"
2
+ import SVG from 'react-inlinesvg';
3
+ import { PaddleBookNow } from "./paddle-book-now"
4
+ import { Link } from "gatsby"
5
+ import type { paddlePricingChartTypes } from "./types/paddle-pricing-chart-types";
6
+
7
+ const LineBreaker = ({ text }: { text: string; }) => {
8
+ const regex = /[- ]/g;
9
+ const newStr = text.replace(regex, "<br />$&");
10
+ // console.log(newStr);
11
+
12
+ return (
13
+ <h4>
14
+ <SVG src={newStr} />
15
+ </h4>
16
+ );
17
+ }
18
+
19
+ export const PaddlePricingChart = ({ rentalRates, rentalAddons, book, peek_base, strapiLocaleName }: paddlePricingChartTypes) => {
20
+ return (
21
+ <>
22
+ <div className="charts">
23
+ <div className="pricing-chart">
24
+ <div className="row row-header">
25
+ <h2 className="kilimanjaro"><Link to="/rentals">Rental<br />Rates</Link></h2>
26
+ <p>1 Hour</p>
27
+ <p><span>3 Hours</span></p>
28
+ <p><span>Full Day</span></p>
29
+ </div>
30
+
31
+ {rentalRates.nodes.map((rate) => (
32
+ <div key={rate.id} className="row">
33
+ {/* <h4>{rate.item}</h4> */}
34
+ <LineBreaker text={rate.item} />
35
+ <p>{rate.oneHour}</p>
36
+ <p>{rate.threeHour}</p>
37
+ <p>{rate.fullDay}</p>
38
+ </div>
39
+ ))}
40
+ </div>
41
+
42
+ {rentalAddons.nodes.length > 0 ? (
43
+ <div className="pricing-chart">
44
+ {rentalAddons.nodes.map((addon) => (
45
+ <React.Fragment key={addon.id}>
46
+ <p>{addon.name}</p>
47
+ <p>+{addon.single}</p>
48
+ <p>+{addon.double}</p>
49
+ <p>+{addon.sup}</p>
50
+ </React.Fragment>
51
+ ))}
52
+ </div>
53
+ ) : null}
54
+ </div>
55
+
56
+ {book ? (
57
+ <PaddleBookNow
58
+ peek_base={peek_base}
59
+ strapiLocaleName={strapiLocaleName}
60
+ />
61
+ ) : null}
62
+ </>
63
+ )
64
+ }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { Link } from "gatsby";
3
3
  import { GatsbyImage } from "gatsby-plugin-image";
4
- import type { GatsbyImageType } from "./types/gatsby-image-type";
5
- import { PaddleInchesRemainder } from "./PaddleInchesRemainder";
6
- import { PaddleTextureBackgrounds } from "./PaddleTextureBackgrounds";
4
+ import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type";
5
+ import { PaddleInchesRemainder } from "./paddle-inches-remainder";
6
+ import { PaddleTextureBackgrounds } from "./paddle-texture-backgrounds";
7
7
 
8
8
  // TODO: I'm not sure if this is needed or I can loop it easier
9
9
  interface NameTypes {
@@ -44,7 +44,7 @@ const Badges = ({ inflatable, demo, discount }: BadgeTypes) => {
44
44
  }
45
45
 
46
46
  type purchaseTypes = {
47
- id: string;
47
+ id: React.Key;
48
48
  title: string;
49
49
  slug: string;
50
50
  excerpt: string;
@@ -54,15 +54,15 @@ type purchaseTypes = {
54
54
  capacity: number;
55
55
  demo: boolean;
56
56
  discount?: number;
57
- cutout: GatsbyImageType;
57
+ cutout: PaddleGatsbyImageType;
58
58
  sportSlug: string;
59
59
  brandSlug: string;
60
- baseOne: { image: GatsbyImageType };
61
- baseTwo: { image: GatsbyImageType };
62
- baseThree: { image: GatsbyImageType };
63
- topOne: { image: GatsbyImageType };
64
- topTwo: { image: GatsbyImageType };
65
- topThree: { image: GatsbyImageType };
60
+ baseOne: { image: PaddleGatsbyImageType };
61
+ baseTwo: { image: PaddleGatsbyImageType };
62
+ baseThree: { image: PaddleGatsbyImageType };
63
+ topOne: { image: PaddleGatsbyImageType };
64
+ topTwo: { image: PaddleGatsbyImageType };
65
+ topThree: { image: PaddleGatsbyImageType };
66
66
  };
67
67
  export const PaddlePurchase = ({ id, title, slug, excerpt, length, width, inflatable, capacity, demo, discount, cutout, sportSlug, brandSlug, baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: purchaseTypes) => {
68
68
 
@@ -27,13 +27,13 @@ const Breadcrumbs = (breadcrumbs: BreadcrumbsTypes) => {
27
27
  "@type": "BreadcrumbList",
28
28
  "itemListElement": [
29
29
  ${Object.entries(rest).map(([key, breadcrumb]) => {
30
- return `{
30
+ return `{
31
31
  "@type": "ListItem",
32
32
  "position": ${Number.parseInt(key) + 1},
33
33
  "name": "${breadcrumb.name}",
34
34
  "item": "${url}/${breadcrumb.item}"
35
35
  }`;
36
- })}
36
+ })}
37
37
  ]
38
38
  }
39
39
  `}
@@ -167,9 +167,8 @@ export const PaddleSEO = ({
167
167
  "postalCode": "${strapiLocation?.postalCode}",
168
168
  "addressCountry": "US"
169
169
  },
170
- ${
171
- allStrapiLocation
172
- ? `
170
+ ${allStrapiLocation
171
+ ? `
173
172
  "department": [
174
173
  ${allStrapiLocation.nodes.map((location) => {
175
174
  return `{
@@ -187,8 +186,8 @@ export const PaddleSEO = ({
187
186
  })}
188
187
  ],
189
188
  `
190
- : ""
191
- }
189
+ : ""
190
+ }
192
191
  "areaServed": {
193
192
  "@type": "GeoCircle",
194
193
  "geoMidpoint": {
@@ -2,7 +2,7 @@ import * as React from "react"
2
2
 
3
3
  type PaddleSunsetTourTimesTypes = {
4
4
  nodes: {
5
- id: string;
5
+ id: React.Key;
6
6
  startDate: string;
7
7
  endDate: string;
8
8
  startTime: string;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { TestimonialTypes } from "./types/testimonial-types";
2
+ import { TestimonialTypes } from "./types/paddle-testimonial-types";
3
3
 
4
4
  export const PaddleTestimonial = ({
5
5
  id,
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { PaddleTestimonial } from "./PaddleTestimonial";
3
- import { type TestimonialTypes } from "./types/testimonial-types";
2
+ import { PaddleTestimonial } from "./paddle-testimonial";
3
+ import { type TestimonialTypes } from "./types/paddle-testimonial-types";
4
4
 
5
5
  interface TestimonialsTypes {
6
6
  nodes: TestimonialTypes[];
@@ -1,17 +1,16 @@
1
1
  import * as React from "react";
2
2
  import { GatsbyImage } from "gatsby-plugin-image";
3
- import type { GatsbyImageType } from "./types/gatsby-image-type";
3
+ import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type";
4
4
 
5
5
  type textureTypes = {
6
- baseOne: { image: GatsbyImageType };
7
- baseTwo: { image: GatsbyImageType };
8
- baseThree: { image: GatsbyImageType };
9
- topOne: { image: GatsbyImageType };
10
- topTwo: { image: GatsbyImageType };
11
- topThree: { image: GatsbyImageType };
6
+ baseOne: { image: PaddleGatsbyImageType };
7
+ baseTwo: { image: PaddleGatsbyImageType };
8
+ baseThree: { image: PaddleGatsbyImageType };
9
+ topOne: { image: PaddleGatsbyImageType };
10
+ topTwo: { image: PaddleGatsbyImageType };
11
+ topThree: { image: PaddleGatsbyImageType };
12
12
  };
13
13
  export const PaddleTextureBackgrounds = ({ baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: textureTypes) => {
14
-
15
14
  const baseTextures = [
16
15
  baseOne,
17
16
  baseTwo,
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { Link } from "gatsby";
3
3
  import { GatsbyImage } from "gatsby-plugin-image";
4
- import type { PaddleTicketTypes } from "./types/ticket-types";
5
- import { PaddleTime } from "./PaddleTime";
6
- import { PaddleBookNow } from "./PaddleBookNow";
4
+ import type { PaddleTicketTypes } from "./types/paddle-ticket-types";
5
+ import { PaddleTime } from "./paddle-time";
6
+ import { PaddleBookNow } from "./paddle-book-now";
7
7
 
8
8
  export const PaddleTicket = ({
9
9
  ogimage,
@@ -0,0 +1,6 @@
1
+ export type PaddleBookNowTypes = {
2
+ peek_base: string;
3
+ strapiLocaleName: string;
4
+ specificName?: string;
5
+ specificLink?: string;
6
+ };
@@ -1,5 +1,5 @@
1
1
  export type PaddleBrandType = {
2
- id: string;
2
+ id: React.Key;
3
3
  slug: string;
4
4
  svg: string;
5
5
  name: string;
@@ -1,6 +1,6 @@
1
1
  import type { IGatsbyImageData } from "gatsby-plugin-image";
2
2
 
3
- export interface GatsbyImageType {
3
+ export interface PaddleGatsbyImageType {
4
4
  localFile: {
5
5
  childImageSharp: {
6
6
  gatsbyImageData: IGatsbyImageData;
@@ -1,4 +1,4 @@
1
- import type { PaddleLocationCardTypes } from "./location-card-types";
1
+ import type { PaddleLocationCardTypes } from "./paddle-location-card-types";
2
2
 
3
3
  export type PaddleLocationDeckTypes = {
4
4
  background?: string;
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+
3
+ export type paddlePricingChartTypes = {
4
+ rentalRates: {
5
+ nodes: {
6
+ id: React.Key;
7
+ item: string;
8
+ oneHour: number;
9
+ threeHour: number;
10
+ fullDay: number;
11
+ }[];
12
+ };
13
+ rentalAddons: {
14
+ nodes: {
15
+ id: React.Key;
16
+ name: string;
17
+ single: number;
18
+ double: number;
19
+ sup: number;
20
+ }[];
21
+ };
22
+ book?: boolean;
23
+ peek_base: string;
24
+ strapiLocaleName: string;
25
+ };
@@ -1,7 +1,7 @@
1
- import type { GatsbyImageType } from "./gatsby-image-type";
1
+ import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
2
2
 
3
3
  export type PaddlePurchaseTypes = {
4
- id: string;
4
+ id: React.Key;
5
5
  title: string;
6
6
  slug: string;
7
7
  excerpt: string;
@@ -11,7 +11,7 @@ export type PaddlePurchaseTypes = {
11
11
  capacity: number;
12
12
  demo: boolean;
13
13
  discount?: number;
14
- cutout: GatsbyImageType;
14
+ cutout: PaddleGatsbyImageType;
15
15
  sport: {
16
16
  slug: string;
17
17
  };
@@ -0,0 +1,7 @@
1
+ export type PaddleTestimonialTypes = {
2
+ id: React.Key;
3
+ testimonial: string;
4
+ sign: string;
5
+ customer: string;
6
+ location: string;
7
+ };
@@ -1,11 +1,9 @@
1
- import type { IGatsbyImageData } from "gatsby-plugin-image";
1
+ import type { PaddleGatsbyImageType } from "./paddle-gatsby-image-type";
2
2
 
3
3
  export type PaddleTicketTypes = {
4
4
  id: React.Key;
5
- ogimage: {
6
- localFile: { childImageSharp: { gatsbyImageData: IGatsbyImageData } };
7
- alternativeText?: string;
8
- };
5
+ ogimage: PaddleGatsbyImageType;
6
+ image: PaddleGatsbyImageType;
9
7
  slug: string;
10
8
  name: string;
11
9
  start?: string;
@@ -1,18 +0,0 @@
1
- import * as React from "react"
2
-
3
- interface BookNowTypes {
4
- peek_base: string
5
- strapiLocaleName: string
6
- specificName?: string
7
- specificLink?: string
8
- }
9
- export const PaddleBookNow = ({ peek_base, strapiLocaleName, specificName, specificLink }: BookNowTypes) =>
10
- <a
11
- href={specificLink || peek_base}
12
- rel="noopener noreferrer"
13
- className="book-now"
14
- title={`Book now ${specificLink && <> {specificLink} </>} with ${strapiLocaleName} kayak and paddleboard`}
15
- >
16
- {specificName && (<>{specificName} <br /></>)}
17
- BOOK NOW
18
- </a>
@@ -1,7 +0,0 @@
1
- export type TestimonialTypes = {
2
- id: string;
3
- testimonial: string;
4
- sign: string;
5
- customer: string;
6
- location: string;
7
- }
File without changes
File without changes
File without changes
File without changes