@rileybathurst/paddle 1.0.2 → 1.0.4

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.0.2",
4
+ "version": "1.0.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -0,0 +1,64 @@
1
+ import * as React from "react"
2
+ import { Link } from 'gatsby';
3
+
4
+ // * additional work is done here to split kayak and paddleboard
5
+
6
+ type BrandListTypes = {
7
+ nodes: {
8
+ id: string;
9
+ slug: string;
10
+ svg: string;
11
+ name: string;
12
+ retail: {
13
+ title: string;
14
+ slug: string;
15
+ sport: {
16
+ slug: string;
17
+ }
18
+ }[]
19
+ }[];
20
+ sport?: string;
21
+ }
22
+
23
+ const PaddleBrandList = ({ nodes, sport }: BrandListTypes) => {
24
+
25
+ const BrandSet = new Set();
26
+ let BrandArray = [];
27
+
28
+ if (sport) {
29
+ nodes.map((brand) => {
30
+ brand.retail.map((retail) => {
31
+
32
+ if (retail.sport.slug === sport) {
33
+ BrandSet.add(brand);
34
+ }
35
+
36
+ return BrandSet;
37
+ })
38
+ });
39
+
40
+ BrandArray = (Array.from(BrandSet));
41
+ } else {
42
+ // TODO: this needs a check if anything is published in the brand if no sport is passed
43
+ BrandArray = (Array.from(nodes));
44
+ }
45
+
46
+ return (
47
+ <ul className='brand_list'>
48
+ {BrandArray.map((brand: any) => (
49
+ <li key={brand.id}>
50
+ <Link to={`/retail/${sport}/${brand.slug}`}>
51
+ {brand.svg ?
52
+ <div
53
+ dangerouslySetInnerHTML={{ __html: brand.svg }}
54
+ />
55
+ : null}
56
+ {brand.name}
57
+ </Link>
58
+ </li>
59
+ ))}
60
+ </ul>
61
+ )
62
+ }
63
+
64
+ export default PaddleBrandList
@@ -1,19 +1,19 @@
1
1
  import * as React from "react"
2
2
  import { PaddleLocationCard } from "./PaddleLocationCard";
3
- import type { LocationCardTypes } from "./types/location-card-types";
3
+ import type { PaddleLocationCardTypes } from "./types/location-card-types";
4
4
 
5
5
  interface LocationDeckTypes {
6
6
  background?: string;
7
7
  season_start?: string; // ? should this be optional? it created a problem with tours
8
8
  season_end?: string;
9
9
  phone?: string;
10
- nodes: LocationCardTypes[];
10
+ nodes: PaddleLocationCardTypes[];
11
11
  }
12
12
  export function PaddleLocationDeck({ nodes, season_start, season_end, phone, background }: LocationDeckTypes) {
13
13
 
14
14
  return (
15
15
  <section className="location-deck">
16
- {nodes.map((location: LocationCardTypes) => (
16
+ {nodes.map((location: PaddleLocationCardTypes) => (
17
17
  <PaddleLocationCard
18
18
  key={location.id}
19
19
  {...location}
@@ -3,8 +3,9 @@ import { Link } from "gatsby"
3
3
  import { GatsbyImage } from "gatsby-plugin-image"
4
4
  import type { PaddleTicketTypes } from "./types/ticket-types"
5
5
  import { PaddleTime } from "./PaddleTime"
6
+ import { PaddleBookNow } from "./PaddleBookNow"
6
7
 
7
- export function PaddleTicket({ ogimage, slug, name, start, finish, duration, timeframe, fitness, excerpt, price, peek, peek_tours_fall_back, tour_page, allStrapiSunsetTourTime }: PaddleTicketTypes) {
8
+ export function PaddleTicket({ ogimage, slug, name, start, finish, duration, timeframe, fitness, excerpt, price, peek, peek_tours_fall_back, tour_page, allStrapiSunsetTourTime, strapiLocaleName }: PaddleTicketTypes) {
8
9
 
9
10
  const time = PaddleTime({
10
11
  start: start,
@@ -16,7 +17,6 @@ export function PaddleTicket({ ogimage, slug, name, start, finish, duration, tim
16
17
  slug: slug
17
18
  });
18
19
 
19
-
20
20
  return (
21
21
  <section className="ticket">
22
22
  <Link to={`/${tour_page}/${slug}`}>
@@ -27,33 +27,33 @@ export function PaddleTicket({ ogimage, slug, name, start, finish, duration, tim
27
27
  className="card__image"
28
28
  />
29
29
  </Link>
30
- <h4 className="card__title">
31
- <Link to={`/${tour_page}/${slug}`}>
32
- {name}
33
- </Link>
34
- </h4>
35
-
36
- {/* // * heavy handed but once the backup is there we can work on this */}
37
- {slug !== '2hour' && slug !== '3hour' ?
38
- <div className="card__specs">
39
- <h4>{time.entry}</h4>
40
- {/* // TODO: I'd like a spec backup here */}
41
- {fitness ? <h4 className="capitalize">{fitness} <span>Fitness</span></h4> : null}
30
+ <div className='ticket__header'>
31
+ <h4 className="card__title">
32
+ <Link to={`/${tour_page}/${slug}`}>
33
+ {name}
34
+ </Link>
35
+ </h4>
36
+
37
+ <div className='ticket__money'>
38
+ <h5>${price}</h5>
39
+ <PaddleBookNow
40
+ peek_base={peek || peek_tours_fall_back}
41
+ strapiLocaleName={strapiLocaleName}
42
+ />
42
43
  </div>
43
- : null}
44
- <hr />
44
+ </div>
45
+
46
+ <div className="ticket__specs">
47
+ {/* // TODO: heavy handed but once the backup is there we can work on this */}
48
+ {/* // TODO: I'd like a spec backup here */}
49
+
50
+ {slug !== '2hour' && slug !== '3hour' ? (
51
+ <>
52
+ <h4>{time.entry}</h4>
53
+ {fitness ? <h4 className="capitalize">{fitness} <span>Fitness</span></h4> : null}
54
+ </>
55
+ ) : null }
45
56
  <p>{excerpt}</p>
46
- <hr />
47
- <div className="card__details">
48
- <h5>${price}</h5>
49
- <a
50
- href={peek ? peek : peek_tours_fall_back}
51
- target="_blank"
52
- rel="noopener noreferrer"
53
- className="book-now"
54
- >
55
- BOOK NOW
56
- </a>
57
57
  </div>
58
58
 
59
59
  </section>
package/src/index.tsx CHANGED
@@ -17,6 +17,7 @@ export * from "./PaddleTestimonial";
17
17
  // Organisms
18
18
  export * from "./PaddleLocationDeck";
19
19
  export * from "./PaddleTestimonials";
20
+ export * from "./PaddleBrandList";
20
21
 
21
22
  // Templates
22
23
 
@@ -25,7 +26,6 @@ export * from "./PaddleTestimonials";
25
26
  // SEO
26
27
  export * from "./PaddleSEO";
27
28
 
28
- // TODO: test v.1.1
29
29
  // Types
30
30
  export * from "./types/ticket-types";
31
31
  export * from "./types/location-card-types";
@@ -1,4 +1,4 @@
1
- export interface LocationCardTypes {
1
+ export interface PaddleLocationCardTypes {
2
2
  id: React.Key;
3
3
  svg: string;
4
4
  name: string;
@@ -28,4 +28,6 @@ export interface PaddleTicketTypes {
28
28
  endTime: string;
29
29
  }[];
30
30
  };
31
+
32
+ strapiLocaleName: string;
31
33
  }