@rileybathurst/paddle 1.0.1 → 1.0.3

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.1",
4
+ "version": "1.0.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -0,0 +1,57 @@
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
+
27
+ nodes.map((brand) => {
28
+ brand.retail.map((retail) => {
29
+ if (retail.sport.slug === sport) {
30
+ BrandSet.add(brand);
31
+ }
32
+ })
33
+ });
34
+
35
+ const BrandArray = (Array.from(BrandSet));
36
+
37
+ // TODO: if I only want a specific sport
38
+
39
+ return (
40
+ <ul className='brand_list'>
41
+ {BrandArray.map((brand: any) => (
42
+ <li key={brand.id}>
43
+ <Link to={`/retail/${sport}/${brand.slug}`}>
44
+ {brand.svg ?
45
+ <div
46
+ dangerouslySetInnerHTML={{ __html: brand.svg }}
47
+ />
48
+ : null}
49
+ {brand.name}
50
+ </Link>
51
+ </li>
52
+ ))}
53
+ </ul>
54
+ )
55
+ }
56
+
57
+ 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}
@@ -0,0 +1,16 @@
1
+ import * as React from "react"
2
+ import { TestimonialTypes } from "./types/testimonial-types"
3
+
4
+ export function PaddleTestimonial({ id, testimonial, customer, sign, location }: TestimonialTypes) {
5
+ return (
6
+ <li key={id}>
7
+ <p className='elbrus'>
8
+ <span className='denali font-serif'>&ldquo;</span>
9
+ {testimonial}
10
+ <span className='denali font-serif'>&rdquo;</span>
11
+ </p>
12
+ <p>{sign} {customer}</p>
13
+ <p className='kosciuszko'>{location}</p>
14
+ </li>
15
+ )
16
+ }
@@ -1,23 +1,15 @@
1
1
  import * as React from "react"
2
+ import { PaddleTestimonial } from "./PaddleTestimonial"
3
+ import { type TestimonialTypes } from "./types/testimonial-types"
2
4
 
3
5
  interface TestimonialsTypes {
4
- nodes: {
5
- id: string;
6
- testimonial: string;
7
- sign: string;
8
- customer: string;
9
- location: string;
10
- }[];
6
+ nodes: TestimonialTypes[];
11
7
  }
12
8
  export function PaddleTestimonials({ nodes }: TestimonialsTypes) {
13
9
  return (
14
10
  <ul className='testimonials condor'>
15
11
  {nodes.map((testimonial) => (
16
- <li key={testimonial.id}>
17
- <p className='elbrus'><span className='denali font-serif'>&ldquo;</span>{testimonial.testimonial}<span className='denali font-serif'>&rdquo;</span></p>
18
- <p>{testimonial.sign} {testimonial.customer}</p>
19
- <p className='kosciuszko'>{testimonial.location}</p>
20
- </li>
12
+ <PaddleTestimonial key={testimonial.id} {...testimonial} />
21
13
  ))}
22
14
  </ul>
23
15
  )
@@ -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
@@ -12,12 +12,12 @@ export * from "./PaddleTicket";
12
12
  export * from "./PaddleSunsetTourTimes";
13
13
  export * from "./PaddleTopBar";
14
14
  export * from "./PaddleSpecs";
15
+ export * from "./PaddleTestimonial";
15
16
 
16
17
  // Organisms
17
18
  export * from "./PaddleLocationDeck";
18
-
19
- // Test a function
20
19
  export * from "./PaddleTestimonials";
20
+ export * from "./PaddleBrandList";
21
21
 
22
22
  // Templates
23
23
 
@@ -26,7 +26,6 @@ export * from "./PaddleTestimonials";
26
26
  // SEO
27
27
  export * from "./PaddleSEO";
28
28
 
29
- // TODO: test v.1.1
30
29
  // Types
31
30
  export * from "./types/ticket-types";
32
31
  export * from "./types/location-card-types";
@@ -2,6 +2,8 @@
2
2
  /* #NAV */
3
3
  /*------------------------------------*/
4
4
 
5
+ /* TODO: variables */
6
+
5
7
  header {
6
8
  z-index: var(--floor);
7
9
  position: relative;
@@ -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;
@@ -0,0 +1,7 @@
1
+ export type TestimonialTypes = {
2
+ id: string;
3
+ testimonial: string;
4
+ sign: string;
5
+ customer: string;
6
+ location: string;
7
+ }
@@ -28,4 +28,6 @@ export interface PaddleTicketTypes {
28
28
  endTime: string;
29
29
  }[];
30
30
  };
31
+
32
+ strapiLocaleName: string;
31
33
  }