@rileybathurst/paddle 1.9.4 → 1.9.6

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.4",
4
+ "version": "1.9.6",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "tsc --noEmit && stay-gold && vite",
@@ -23,7 +23,8 @@
23
23
  "react-dom": "^18.3.1",
24
24
  "react-inlinesvg": "^4.2.0",
25
25
  "react-markdown": "^10.1.0",
26
- "stay-gold": "^1.1.8"
26
+ "stay-gold": "^1.1.8",
27
+ "publish": "npm version patch && npm login && npm publish"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@biomejs/biome": "2.0.2",
package/src/App.tsx CHANGED
@@ -1,6 +1,9 @@
1
+ // * this is the opening vite page to test functions with
2
+
1
3
  import { useState } from 'react'
2
4
  import reactLogo from './assets/react.svg'
3
5
  import viteLogo from '/vite.svg'
6
+ import { PaddlePricingChart } from './paddle-pricing-chart'
4
7
 
5
8
  function App() {
6
9
  const [count, setCount] = useState(0)
@@ -27,6 +30,70 @@ function App() {
27
30
  <p className="read-the-docs">
28
31
  Click on the Vite and React logos to learn more
29
32
  </p>
33
+
34
+ {/* testing */}
35
+ <PaddlePricingChart
36
+ rentalRates={{
37
+ nodes: [
38
+ {
39
+ "id": "0bcc4411-43e9-55a4-9a61-313a27198c23",
40
+ "item": "Single Kayak",
41
+ "oneHour": 32,
42
+ "threeHour": 64,
43
+ "fullDay": 96,
44
+ "pedalAdd": 10,
45
+ "branches": [],
46
+ "retail": null
47
+ },
48
+ {
49
+ "id": "dad19f3d-3381-573a-b37d-6c4970e60c61",
50
+ "item": "Double Kayak",
51
+ "oneHour": 48,
52
+ "threeHour": 96,
53
+ "fullDay": 110,
54
+ "pedalAdd": 20,
55
+ "branches": [],
56
+ "retail": null
57
+ },
58
+ {
59
+ "id": "531d03f2-2348-564f-b4e5-d00fc2810f6b",
60
+ "item": "Paddle board",
61
+ "oneHour": 32,
62
+ "threeHour": 64,
63
+ "fullDay": 96,
64
+ "pedalAdd": null,
65
+ "branches": [],
66
+ "retail": null
67
+ },
68
+ {
69
+ "id": "cc6bb238-1c66-56d7-89ae-3cd3d99e5502",
70
+ "item": "Inflatable Paddle Board*",
71
+ "oneHour": null,
72
+ "threeHour": null,
73
+ "fullDay": 96,
74
+ "pedalAdd": null,
75
+ "branches": [
76
+ {
77
+ "slug": "tahoe-city"
78
+ }
79
+ ],
80
+ "retail": {
81
+ "slug": "breeze-wing",
82
+ "sport": {
83
+ "slug": "paddleboard"
84
+ },
85
+ "brand": {
86
+ "slug": "tahe"
87
+ }
88
+ }
89
+ }
90
+ ]
91
+ }}
92
+ branches={{
93
+ // slug: 'south-tahoe'
94
+ slug: 'tahoe-city'
95
+ }}
96
+ />
30
97
  </>
31
98
  )
32
99
  }
@@ -36,14 +36,12 @@ const LineBreaker = ({ text }: { text: string; }) => {
36
36
  }
37
37
 
38
38
  export const PaddlePricingChart = ({ rentalRates, branches }: paddlePricingChartTypes) => {
39
+
40
+ // console.log(branches);
39
41
 
40
- console.log('paddle pricing chart testing');
41
- console.log('🦄');
42
- console.log(rentalRates);
43
- console.log(branches);
44
- console.log('🦖');
45
-
46
- console.log(rentalRates.nodes.map(rate => rate.branches?.map(branch => branch.slug)));
42
+ /* console.log(rentalRates.nodes.map(rate => rate.branches?.map(
43
+ branch => branch.slug
44
+ ).flat().some(slug => slug === branches?.slug) && console.log("found a match"))); */
47
45
 
48
46
  return (
49
47
  <div className="pricing-chart">
@@ -59,7 +57,7 @@ export const PaddlePricingChart = ({ rentalRates, branches }: paddlePricingChart
59
57
 
60
58
  {rentalRates.nodes.map((rate) => (
61
59
  <div key={rate.id} className="column">
62
- {rate.retail && rate.branches?.some(branch => branch.slug === branches?.slug) ? (
60
+ {rate.retail && rate.branches?.flat().some(branch => branch.slug === branches?.slug) ? (
63
61
  <Link to={`/retail/${rate.retail.sport.slug}/${rate.retail.brand.slug}/${rate.retail.slug}`}>
64
62
  <LineBreaker text={rate.item} />
65
63
  </Link>
@@ -60,7 +60,7 @@ h4,
60
60
 
61
61
  h5,
62
62
  .elbrus {
63
- font-size: var(--kosciuszko); /* 20px */
63
+ font-size: var(--elbrus); /* 20px */
64
64
  margin-bottom: 0.625rem; /* 10px */
65
65
  }
66
66
 
@@ -5,10 +5,10 @@ export type paddlePricingChartTypes = {
5
5
  nodes: {
6
6
  id: React.Key;
7
7
  item: string;
8
- oneHour: number;
9
- threeHour: number;
10
- fullDay: number;
11
- pedalAdd?: number;
8
+ oneHour?: number | null;
9
+ threeHour?: number | null;
10
+ fullDay?: number | null;
11
+ pedalAdd?: number | null;
12
12
 
13
13
  branches?: {
14
14
  slug: string;
@@ -22,10 +22,10 @@ export type paddlePricingChartTypes = {
22
22
  brand: {
23
23
  slug: string;
24
24
  };
25
- };
25
+ } | null;
26
26
  }[];
27
27
  };
28
28
  branches?: {
29
29
  slug: string;
30
- }
30
+ } | null;
31
31
  };