@rileybathurst/paddle 1.9.7 → 1.9.10

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,16 +1,15 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.9.7",
4
+ "version": "1.9.10",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "tsc --noEmit && stay-gold && vite",
8
8
  "dirty": "vite",
9
- "build": "tsc && vite build",
9
+ "build": "tsc --noEmit && vite build",
10
10
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11
11
  "preview": "vite preview",
12
- "start": "storybook dev -p 6006",
13
- "storybook": "storybook dev -p 6006",
12
+ "storybook": "tsc --noEmit && stay-gold && storybook dev -p 6006",
14
13
  "build-storybook": "storybook build",
15
14
  "release": "npm version patch && npm login && npm publish"
16
15
  },
@@ -28,13 +27,13 @@
28
27
  },
29
28
  "devDependencies": {
30
29
  "@biomejs/biome": "2.0.2",
31
- "@chromatic-com/storybook": "^4.0.1",
30
+ "@chromatic-com/storybook": "^5.0.1",
32
31
  "@faker-js/faker": "^9.8.0",
33
- "@storybook/addon-a11y": "^9.1.0",
34
- "@storybook/addon-docs": "^9.1.0",
35
- "@storybook/addon-links": "^9.1.0",
36
- "@storybook/addon-themes": "^9.1.0",
37
- "@storybook/react-vite": "^9.1.0",
32
+ "@storybook/addon-a11y": "^10.2.16",
33
+ "@storybook/addon-docs": "^10.2.16",
34
+ "@storybook/addon-links": "^10.2.16",
35
+ "@storybook/addon-themes": "^10.2.16",
36
+ "@storybook/react-vite": "^10.2.16",
38
37
  "@types/react": "^19.1.6",
39
38
  "@types/react-dom": "^19.1.6",
40
39
  "@typescript-eslint/eslint-plugin": "^8.33.1",
@@ -43,8 +42,8 @@
43
42
  "eslint": "^9.28.0",
44
43
  "eslint-plugin-react-hooks": "^5.2.0",
45
44
  "eslint-plugin-react-refresh": "^0.4.20",
46
- "eslint-plugin-storybook": "^9.1.0",
47
- "storybook": "^9.1.0",
45
+ "eslint-plugin-storybook": "^10.2.16",
46
+ "storybook": "^10.2.16",
48
47
  "typescript": "^5.8.3",
49
48
  "vite": "^6.3.5"
50
49
  },
package/src/index.tsx CHANGED
@@ -8,7 +8,7 @@ export * from "./paddle-featured-sort";
8
8
  // Molecules
9
9
  export * from "./paddle-composition";
10
10
  export * from "./paddle-socials";
11
- export * from "./paddle-location-card";
11
+ export * from "./paddle-location";
12
12
  export * from "./paddle-testimonials";
13
13
  export * from "./paddle-ticket";
14
14
  export * from "./paddle-sunset-tour-times";
@@ -34,8 +34,10 @@ export * from "./paddle-seo";
34
34
 
35
35
  // Types
36
36
  export * from "./types/paddle-ticket-types";
37
- export * from "./types/paddle-location-card-types";
37
+ export * from "./types/paddle-location-types";
38
38
  export * from "./types/paddle-location-deck-types";
39
39
  export * from "./types/paddle-gatsby-image-type";
40
40
  export * from "./types/paddle-purchase-types";
41
- export * from "./types/paddle-brand-types";
41
+ export * from "./types/paddle-brand-types";
42
+ export * from "./types/paddle-book-now-types";
43
+ export * from "./types/paddle-testimonial-types";
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { PaddleLocationCard } from "./paddle-location-card";
3
- import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
2
+ import { PaddleLocation } from "./paddle-location";
3
+ import type { PaddleLocationTypes } from "./types/paddle-location-types";
4
4
  import type { PaddleLocationDeckTypes } from "./types/paddle-location-deck-types";
5
5
 
6
6
  export const PaddleLocationDeck = ({
@@ -11,8 +11,8 @@ export const PaddleLocationDeck = ({
11
11
  }: PaddleLocationDeckTypes) => {
12
12
  return (
13
13
  <section className="location-deck">
14
- {nodes.map((location: PaddleLocationCardTypes) => (
15
- <PaddleLocationCard
14
+ {nodes.map((location: PaddleLocationTypes) => (
15
+ <PaddleLocation
16
16
  key={location.id}
17
17
  season_start={season_start}
18
18
  season_end={season_end}
@@ -0,0 +1,224 @@
1
+ import React from "react"
2
+ import { Link } from "gatsby";
3
+ import Markdown from "react-markdown";
4
+
5
+ import HourMin from "./hour-min";
6
+ import Phone from "./phone";
7
+ import type { PaddleLocationTypes } from "./types/paddle-location-types";
8
+ import SVG from 'react-inlinesvg';
9
+
10
+ type SeasonTypes = {
11
+ season_start?: string;
12
+ season_end?: string;
13
+
14
+ opening_time: string;
15
+ closing_time: string;
16
+ name: string;
17
+ offSeasonDetails?: string;
18
+ weatherPermitting?: boolean;
19
+ }
20
+ const Season = ({
21
+ name,
22
+ season_start,
23
+ season_end,
24
+ opening_time,
25
+ closing_time,
26
+ offSeasonDetails,
27
+ weatherPermitting
28
+ }: SeasonTypes) => {
29
+ // TODO: these need a query but thats not the most important first step
30
+ if (
31
+ name === "Free Parking Lot" ||
32
+ name === "Parking" ||
33
+ name === "Delivery"
34
+ ) {
35
+ return null;
36
+ }
37
+
38
+ if (season_start && season_end) {
39
+ const currentDay = new Date();
40
+ const seasonStartDate = new Date(season_start);
41
+ const seasonEndDate = new Date(season_end);
42
+
43
+ if (currentDay >= seasonStartDate && currentDay <= seasonEndDate) {
44
+ return (
45
+ <p>
46
+ {opening_time ? "Open Daily: " : null}
47
+ {opening_time && closing_time ? (
48
+ <><HourMin time={opening_time} /> - <HourMin time={closing_time} />&nbsp;</>
49
+ ) : null}
50
+ {weatherPermitting ? "Weather Permitting" : null}
51
+ </p>
52
+ );
53
+ }
54
+
55
+ return (
56
+ <div>
57
+ <p>We&apos;re closed for the season</p>
58
+
59
+ {currentDay < seasonStartDate ? (
60
+ <p>We will reopen {season_start}, Weather Permitting</p>
61
+ ) : null}
62
+
63
+ {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
64
+ </div>
65
+ );
66
+ }
67
+
68
+ console.warn(`No season start or end date provided for ${name}. Defaulting to off season.`);
69
+ return (
70
+ <div>
71
+ <p>We&apos;re closed for the season</p>
72
+ {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
73
+ </div>
74
+ );
75
+ };
76
+
77
+ type ContentTypes = {
78
+ link?: string;
79
+ svg: string;
80
+ name: string;
81
+
82
+ description: {
83
+ data: {
84
+ description: string;
85
+ };
86
+ };
87
+ opening_time: string;
88
+ closing_time: string;
89
+
90
+ season_start?: string;
91
+ season_end?: string;
92
+
93
+ offSeasonDetails?: string;
94
+ phone?: number;
95
+ weatherPermitting?: boolean;
96
+
97
+ streetAddress?: string;
98
+ addressLocality?: string;
99
+ addressRegion?: string;
100
+ postalCode?: string;
101
+ commonName?: string;
102
+ }
103
+
104
+ const Content = ({
105
+ svg,
106
+ name,
107
+ description,
108
+ opening_time,
109
+ closing_time,
110
+ streetAddress,
111
+ addressLocality,
112
+ addressRegion,
113
+ postalCode,
114
+ commonName,
115
+ weatherPermitting,
116
+ season_start,
117
+ season_end,
118
+ offSeasonDetails,
119
+ phone,
120
+ }: ContentTypes) => {
121
+ return (
122
+ <>
123
+ <div className="svg">
124
+ <SVG src={svg} />
125
+ </div>
126
+
127
+ <div className="location_details">
128
+ <h3>{name}</h3>
129
+
130
+ {streetAddress ||
131
+ addressLocality ||
132
+ addressRegion ||
133
+ postalCode ||
134
+ commonName ? (
135
+ <address>
136
+ {commonName ? (<>{commonName},<br /></>) : null}
137
+ {streetAddress ? (<>{streetAddress},<br /></>) : null}
138
+ {addressLocality ? (<>{addressLocality},<br /></>) : null}
139
+ {addressRegion ? (<>{addressRegion},&nbsp;</>) : null}
140
+ {postalCode ? (<>{postalCode}</>) : null}
141
+ </address>
142
+ ) : null}
143
+
144
+ {opening_time && closing_time ? (
145
+ <Season
146
+ season_start={season_start}
147
+ season_end={season_end}
148
+ opening_time={opening_time}
149
+ closing_time={closing_time}
150
+ name={name}
151
+ offSeasonDetails={offSeasonDetails}
152
+ weatherPermitting={weatherPermitting}
153
+ />
154
+ ) : (
155
+ <div className="react-markdown">
156
+ <Markdown>{description.data.description}</Markdown>
157
+ </div>
158
+ )}
159
+
160
+ {phone && (
161
+ <Phone phone={phone} />
162
+ )}
163
+ </div>
164
+ </>
165
+ );
166
+ };
167
+
168
+ export const PaddleLocation = ({
169
+ svg,
170
+ name,
171
+ link,
172
+ description,
173
+ opening_time,
174
+ closing_time,
175
+ streetAddress,
176
+ addressLocality,
177
+ addressRegion,
178
+ postalCode,
179
+ commonName,
180
+ season_start,
181
+ season_end,
182
+ phone,
183
+ offSeasonDetails,
184
+ weatherPermitting
185
+ }: PaddleLocationTypes) => {
186
+
187
+ const phoneDidgits = Number(phone);
188
+
189
+ const content = (
190
+ <Content
191
+ svg={svg}
192
+ name={name}
193
+ description={description}
194
+ opening_time={opening_time}
195
+ closing_time={closing_time}
196
+ streetAddress={streetAddress}
197
+ addressLocality={addressLocality}
198
+ addressRegion={addressRegion}
199
+ postalCode={postalCode}
200
+ commonName={commonName}
201
+ season_start={season_start}
202
+ season_end={season_end}
203
+ offSeasonDetails={offSeasonDetails}
204
+ weatherPermitting={weatherPermitting}
205
+ phone={phoneDidgits}
206
+ />
207
+ );
208
+
209
+ return link.includes("http") ? (
210
+ <a
211
+ href={link}
212
+ className="location"
213
+ target="_blank"
214
+ rel="noopener noreferrer"
215
+ title={name}
216
+ >
217
+ {content}
218
+ </a>
219
+ ) : (
220
+ <Link to={link} className="location">
221
+ {content}
222
+ </Link>
223
+ );
224
+ };
@@ -4,6 +4,7 @@ import { GatsbyImage } from "gatsby-plugin-image";
4
4
  import type { PaddleGatsbyImageType } from "./types/paddle-gatsby-image-type";
5
5
  import { PaddleInchesRemainder } from "./paddle-inches-remainder";
6
6
  import { PaddleTextureBackgrounds } from "./paddle-texture-backgrounds";
7
+ import { PaddlePurchaseTypes } from "./types/paddle-purchase-types";
7
8
 
8
9
  // TODO: I'm not sure if this is needed or I can loop it easier
9
10
  interface NameTypes {
@@ -45,18 +46,7 @@ const Badges = ({ inflatable, demo, discount }: BadgeTypes) => {
45
46
  return null;
46
47
  }
47
48
 
48
- type purchaseTypes = {
49
- id: React.Key;
50
- title: string;
51
- slug: string;
52
- excerpt: string;
53
- length: number;
54
- width: number;
55
- inflatable: boolean;
56
- capacity: number;
57
- demo: boolean;
58
- discount?: number;
59
- cutout: PaddleGatsbyImageType;
49
+ interface PurchaseTypes extends PaddlePurchaseTypes {
60
50
  sportSlug: string;
61
51
  brandSlug: string;
62
52
  baseOne: { image: PaddleGatsbyImageType };
@@ -66,7 +56,26 @@ type purchaseTypes = {
66
56
  topTwo: { image: PaddleGatsbyImageType };
67
57
  topThree: { image: PaddleGatsbyImageType };
68
58
  };
69
- export const PaddlePurchase = ({ id, title, slug, excerpt, length, width, inflatable, capacity, demo, discount, cutout, sportSlug, brandSlug, baseOne, baseTwo, baseThree, topOne, topTwo, topThree }: purchaseTypes) => {
59
+ export const PaddlePurchase = ({
60
+ id,
61
+ title,
62
+ slug,
63
+ excerpt,
64
+ length,
65
+ width,
66
+ inflatable,
67
+ capacity,
68
+ demo,
69
+ discount,
70
+ cutout,
71
+ sportSlug,
72
+ brandSlug,
73
+ baseOne,
74
+ baseTwo,
75
+ baseThree,
76
+ topOne,
77
+ topTwo,
78
+ topThree }: PurchaseTypes) => {
70
79
 
71
80
  return (
72
81
  <article key={id} className="purchase">
@@ -57,8 +57,6 @@ button:active {
57
57
 
58
58
  .book-now {
59
59
  text-transform: uppercase;
60
- /* ? why is this different than a regular button */
61
- margin-block-start: var(--kosciuszko);
62
60
  background-color: var(--neutral-800);
63
61
  border-color: var(--neutral-700);
64
62
  color: var(--neutral-300);
@@ -102,58 +100,32 @@ button:active {
102
100
 
103
101
  .tahoe-city {
104
102
  button,
105
- .button {
106
- /* * reverts to clean dark scheme */
107
- @media (prefers-color-scheme: light) {
108
- background-color: var(--sand-200);
109
- border-color: var(--sand-100);
110
- color: var(--tanager-100);
111
- }
103
+ .button, .book-now {
104
+ background-color: var(--tanager-200);
105
+ border-color: var(--tanager-100);
106
+ color: white;
112
107
  }
113
108
 
114
109
  button:hover,
115
110
  .button:hover,
111
+ .book-now:hover,
116
112
  .button__hover {
117
113
  @media (prefers-color-scheme: light) {
118
- background-color: var(--sand-300);
119
- border-color: var(--sand-200);
120
- color: var(--tanager-200);
114
+ background-color: var(--tanager-300);
115
+ border-color: var(--tanager-200);
116
+ color: var(--neutral-200);
121
117
  }
122
118
  }
123
119
 
124
120
  button:active,
125
121
  .button:active,
122
+ .book-now:active,
126
123
  .button__active {
127
124
  @media (prefers-color-scheme: light) {
128
- background-color: var(--sand-400);
129
- border-color: var(--sand-300);
130
- color: var(--tanager-300);
131
- }
132
- }
133
-
134
- /* BOOK NOW */
135
- .book-now {
136
- background-color: var(--tanager-200);
137
- border-color: var(--tanager-100);
138
- color: var(--neutral-100);
139
- }
140
-
141
- /* @media (prefers-color-scheme: dark) {
142
- } */
143
-
144
- .book-now:hover,
145
- .book-now__hover {
146
- background-color: var(--tanager-300);
147
- border-color: var(--tanager-200);
148
- color: var(--neutral-200);
149
- }
150
-
151
- .book-now:active,
152
- .book-now__active,
153
- button:active {
154
- background-color: var(--tanager-400);
125
+ background-color: var(--tanager-400);
155
126
  border-color: var(--tanager-300);
156
127
  color: var(--neutral-300);
128
+ }
157
129
  }
158
130
  }
159
131
 
@@ -234,10 +234,12 @@
234
234
  }
235
235
 
236
236
  .ticket {
237
- width: 100%;
238
- height: 100%;
239
- background-color: var(--neutral-200);
237
+ width: calc(100% - 2 * var(--kosciuszko));
238
+ height: calc(100% - 2 * var(--kosciuszko));
239
+ background-color: white;
240
240
  border: 1px solid var(--neutral-300);
241
+ border-radius: var(--card-radius);
242
+ padding: var(--kosciuszko);
241
243
 
242
244
  @media (prefers-color-scheme: dark) {
243
245
  background-color: var(--neutral-700);
@@ -269,6 +271,14 @@
269
271
  }
270
272
  }
271
273
 
274
+ .tahoe-city .ticket {
275
+ border-color: var(--sand-400);
276
+
277
+ @media (prefers-color-scheme: dark) {
278
+ border-color: var(--neutral-700);
279
+ }
280
+ }
281
+
272
282
  .south-tahoe .ticket {
273
283
  background-color: var(--lake-200);
274
284
  border: 1px solid var(--lake-300);
@@ -11,13 +11,23 @@ body {
11
11
  }
12
12
  }
13
13
 
14
+ .tahoe-city body {
15
+ background-color: var(--sand-100);
16
+ color: var(--neutral-800);
17
+
18
+ @media (prefers-color-scheme: dark) {
19
+ background-color: var(--lake-800);
20
+ color: var(--neutral-100);
21
+ }
22
+ }
23
+
14
24
  body:has(#storybook-root) {
15
25
  #storybook-root {
16
26
  min-height: 100vh;
17
27
  }
18
28
 
19
29
  #storybook-root:has(.tahoe-city) {
20
- background-color: var(--neutral-100);
30
+ background-color: var(--sand-100);
21
31
 
22
32
  @media (prefers-color-scheme: dark) {
23
33
  background-color: var(--lake-300);
@@ -51,6 +61,35 @@ hr {
51
61
  }
52
62
  }
53
63
 
64
+ .tahoe-city hr {
65
+ border-color: var(--sand-400);
66
+
67
+ @media (prefers-color-scheme: dark) {
68
+ border-color: var(--lake-500);
69
+ }
70
+ }
71
+
72
+ /*------------------------------------*/
73
+ /* #PANEL */
74
+ /*------------------------------------*/
75
+
76
+ .panel {
77
+ background-color: var(--neutral-200);
78
+
79
+ @media (prefers-color-scheme: dark) {
80
+ background-color: var(--neutral-700);
81
+ }
82
+ }
83
+
84
+ .tahoe-city .panel {
85
+ background-color: var(--sand-200);
86
+
87
+ @media (prefers-color-scheme: dark) {
88
+ background-color: var(--lake-700);
89
+ }
90
+ }
91
+
92
+
54
93
  /*------------------------------------*/
55
94
  /* #TOP-BAR */
56
95
  /*------------------------------------*/
@@ -69,9 +108,10 @@ hr {
69
108
 
70
109
  @media (prefers-color-scheme: light) {
71
110
  .tahoe-city .top-bar {
72
- background-color: var(--sand-100);
73
- box-shadow: 0 0 0 100vmax var(--sand-100);
74
- /* color: var(--sand-400); */
111
+ /* background-color: var(--neutral-100); */
112
+ /* box-shadow: 0 0 0 100vmax var(--neutral-100); */
113
+ background-color: white;
114
+ box-shadow: 0 0 0 100vmax white;
75
115
  }
76
116
 
77
117
  /* * dark back to clean theme */
@@ -95,9 +135,12 @@ hr {
95
135
  /* #LOCATION */
96
136
  /*------------------------------------*/
97
137
 
98
- .south-tahoe .location {
138
+
139
+ .location {
140
+ background-color: white;
141
+
99
142
  @media (prefers-color-scheme: dark) {
100
- color: var(--neutral-200);
143
+ background-color: var(--neutral-800);
101
144
  }
102
145
  }
103
146
 
@@ -412,7 +412,6 @@ header {
412
412
  }
413
413
 
414
414
  .location:not(:last-child) {
415
- border-block-end: 1px solid var(--neutral-400);
416
415
  margin-block-end: var(--kosciuszko);
417
416
  }
418
417
 
@@ -422,6 +421,7 @@ header {
422
421
  align-items: center;
423
422
  gap: clamp(var(--kosciuszko), 1.67vw, var(--elbrus));
424
423
  border-radius: var(--card-radius);
424
+ padding: var(--vinson);
425
425
 
426
426
  > svg,
427
427
  .svg {
@@ -45,6 +45,10 @@ a svg {
45
45
  /* #MENU LIST */
46
46
  /*------------------*/
47
47
 
48
+ .menu-list {
49
+ padding: 0;
50
+ }
51
+
48
52
  /* TODO: v1.2 a lot of this is smaller than the variables test it all */
49
53
  .menu-list a:not(.button) {
50
54
  padding: 0.25rem;
@@ -80,6 +80,7 @@ small,
80
80
 
81
81
  address {
82
82
  font-style: normal;
83
+ margin-bottom: 0.625rem;
83
84
  }
84
85
 
85
86
  p {
@@ -39,13 +39,13 @@
39
39
 
40
40
  /* Sand */
41
41
 
42
- --sand-100: oklch(0.97 0.01 50);
43
- --sand-200: oklch(0.95 0.02 50);
44
- --sand-300: oklch(0.92 0.03 50);
45
- --sand-400: oklch(0.88 0.04 50);
42
+ --sand-100: oklch(0.97 0.025 75);
43
+ --sand-200: oklch(0.95 0.035 75);
44
+ --sand-300: oklch(0.92 0.05 75);
45
+ --sand-400: oklch(0.88 0.075 75);
46
46
  /* this finishes where 500 normally would go dark */
47
47
 
48
- @supports not (color: oklch(0.97 0.01 50)) {
48
+ @supports not (color: oklch(0.97 0.02 75)) {
49
49
  --sand-100: #fbf3ef;
50
50
  --sand-200: #faebe3;
51
51
  --sand-300: #f6dfd3;
@@ -1,9 +1,9 @@
1
- import type { PaddleLocationCardTypes } from "./paddle-location-card-types";
1
+ import type { PaddleLocationTypes } from "./paddle-location-types";
2
2
 
3
3
  export type PaddleLocationDeckTypes = {
4
4
  background?: string;
5
5
  season_start?: string; // ? should this be optional? it created a problem with tours
6
6
  season_end?: string;
7
7
  phone?: string;
8
- nodes: PaddleLocationCardTypes[];
8
+ nodes: PaddleLocationTypes[];
9
9
  };
@@ -1,4 +1,4 @@
1
- export interface PaddleLocationCardTypes {
1
+ export interface PaddleLocationTypes {
2
2
  id: React.Key;
3
3
  svg: string;
4
4
  name: string;
@@ -1,399 +0,0 @@
1
- import React from "react"
2
- import { Link } from "gatsby";
3
- import Markdown from "react-markdown";
4
-
5
- import HourMin from "./hour-min";
6
- import Phone from "./phone";
7
- import type { PaddleLocationCardTypes } from "./types/paddle-location-card-types";
8
- import SVG from 'react-inlinesvg';
9
-
10
- // merged types are possible to dry this up but its also a lot
11
- // type UpdatedUser = Merge<User, Updates>;
12
- type PlaceTypes = {
13
- commonName?: string;
14
- streetAddress?: string;
15
- addressLocality?: string;
16
- addressRegion?: string;
17
- postalCode?: string;
18
- };
19
- const Place = ({ commonName, streetAddress, addressLocality, addressRegion, postalCode }: PlaceTypes) => {
20
- return (
21
- <address>
22
- {commonName ? (<>{commonName},&nbsp;</>) : null}
23
- {streetAddress ? (<>{streetAddress},&nbsp;</>) : null}
24
- {addressLocality ? (<>{addressLocality},&nbsp;</>) : null}
25
- {addressRegion ? (<>{addressRegion},&nbsp;</>) : null}
26
- {postalCode ? (<>{postalCode},&nbsp;</>) : null}
27
- </address>
28
- )
29
- }
30
-
31
- interface SeasonTypes {
32
- season_start?: string;
33
- season_end?: string;
34
-
35
- opening_time: string;
36
- closing_time: string;
37
- name: string;
38
- offSeasonDetails?: string;
39
- weatherPermitting?: boolean;
40
- }
41
- const Season = ({
42
- name,
43
- season_start,
44
- season_end,
45
- opening_time,
46
- closing_time,
47
- offSeasonDetails,
48
- weatherPermitting
49
- }: SeasonTypes) => {
50
- // TODO: these need a query but thats not the most important first step
51
- if (
52
- name === "Free Parking Lot" ||
53
- name === "Parking" ||
54
- name === "Delivery"
55
- ) {
56
- return null;
57
- }
58
-
59
- if (season_start && season_end) {
60
- const currentDay = new Date();
61
- const seasonStartDate = new Date(season_start);
62
- const seasonEndDate = new Date(season_end);
63
-
64
- if (currentDay >= seasonStartDate && currentDay <= seasonEndDate) {
65
- return (
66
- <p>
67
- {opening_time ? "Open Daily: " : null}
68
- {opening_time && closing_time ? (
69
- <><HourMin time={opening_time} /> - <HourMin time={closing_time} />&nbsp;</>
70
- ) : null}
71
- {weatherPermitting ? "Weather Permitting" : null}
72
- </p>
73
- );
74
- }
75
-
76
- // * outside of season
77
- return (
78
- <div>
79
- <p>We&apos;re closed for the season</p>
80
-
81
- {currentDay < seasonStartDate ? (
82
- <p>We will reopen {season_start}, Weather Permitting</p>
83
- ) : null}
84
-
85
- {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
86
- </div>
87
- );
88
- }
89
-
90
- // * no season defaults to off season
91
- // TODO: v1.3 add some enum error messages here for if this is allowed to not have a season
92
- return (
93
- <div>
94
- <p>We&apos;re closed for the season</p>
95
- {offSeasonDetails ? <p>{offSeasonDetails}</p> : null}
96
- </div>
97
- );
98
- };
99
-
100
- interface ContentTypes {
101
- link?: string;
102
- svg: string;
103
- name: string;
104
-
105
- description: {
106
- data: {
107
- description: string;
108
- };
109
- };
110
- opening_time: string;
111
- closing_time: string;
112
-
113
- season_start?: string;
114
- season_end?: string;
115
-
116
- offSeasonDetails?: string;
117
- phoneNumber?: number;
118
- weatherPermitting?: boolean;
119
-
120
- streetAddress?: string;
121
- addressLocality?: string;
122
- addressRegion?: string;
123
- postalCode?: string;
124
- commonName?: string;
125
- }
126
- const PhoneContent = ({
127
- link,
128
- svg,
129
- name,
130
- description,
131
- opening_time,
132
- closing_time,
133
- streetAddress,
134
- addressLocality,
135
- addressRegion,
136
- postalCode,
137
- commonName,
138
- season_start,
139
- season_end,
140
- offSeasonDetails,
141
- phoneNumber,
142
- weatherPermitting
143
- }: ContentTypes) => {
144
- return (
145
- <>
146
- {link?.includes("http") ? (
147
- <a
148
- href={link}
149
- className="svg"
150
- target="_blank"
151
- rel="noopener noreferrer"
152
- title={name}
153
- >
154
- <SVG src={svg} />
155
- </a>
156
- ) : (
157
- link && (
158
- <Link to={link} className="svg">
159
- <SVG src={svg} />
160
- </Link>
161
- )
162
- )}
163
-
164
- <div className="location_details">
165
- <div className="multi_button">
166
- {link?.includes("http") ? (
167
- <a
168
- href={link}
169
- target="_blank"
170
- rel="noopener noreferrer"
171
- title={name}
172
- >
173
- <h3>{name}</h3>
174
- </a>
175
- ) : (
176
- link && (
177
- <Link to={link} title={name}>
178
- <h3>{name}</h3>
179
- </Link>
180
- )
181
- )}
182
- {phoneNumber && (
183
- <Phone phone={phoneNumber} />
184
- )}
185
- </div>
186
-
187
- {streetAddress ||
188
- addressLocality ||
189
- addressRegion ||
190
- postalCode ||
191
- commonName ? (
192
-
193
- link?.includes("http") ? (
194
- <a
195
- href={link}
196
- target="_blank"
197
- rel="noopener noreferrer"
198
- title={name}
199
- >
200
- <Place
201
- commonName={commonName}
202
- streetAddress={streetAddress}
203
- addressLocality={addressLocality}
204
- addressRegion={addressRegion}
205
- postalCode={postalCode}
206
- />
207
- </a>
208
- ) : (
209
- link && (
210
- <Link to={link} title={name}>
211
- <Place
212
- commonName={commonName}
213
- streetAddress={streetAddress}
214
- addressLocality={addressLocality}
215
- addressRegion={addressRegion}
216
- postalCode={postalCode}
217
- />
218
- </Link>
219
- )
220
- )
221
- ) : null}
222
-
223
- {opening_time && closing_time ? (
224
- <Season
225
- season_start={season_start}
226
- season_end={season_end}
227
- opening_time={opening_time}
228
- closing_time={closing_time}
229
- name={name}
230
- offSeasonDetails={offSeasonDetails}
231
- weatherPermitting={weatherPermitting}
232
- />
233
- ) : (
234
- <div className="react-markdown">
235
- <Markdown>{description.data.description}</Markdown>
236
- </div>
237
- )}
238
- </div>
239
- </>
240
- );
241
- };
242
-
243
- const Content = ({
244
- svg,
245
- name,
246
- description,
247
- opening_time,
248
- closing_time,
249
- streetAddress,
250
- addressLocality,
251
- addressRegion,
252
- postalCode,
253
- commonName,
254
- weatherPermitting,
255
- season_start,
256
- season_end,
257
- offSeasonDetails,
258
- }: ContentTypes) => {
259
- return (
260
- <>
261
- <div className="svg">
262
- <SVG src={svg} />
263
- </div>
264
-
265
- <div className="location_details">
266
- <div className="multi_button">
267
- <h3>{name}</h3>
268
- </div>
269
-
270
- {streetAddress ||
271
- addressLocality ||
272
- addressRegion ||
273
- postalCode ||
274
- commonName ? (
275
- <Place
276
- commonName={commonName}
277
- streetAddress={streetAddress}
278
- addressLocality={addressLocality}
279
- addressRegion={addressRegion}
280
- postalCode={postalCode}
281
- />
282
- ) : null}
283
-
284
- {opening_time && closing_time ? (
285
- <Season
286
- season_start={season_start}
287
- season_end={season_end}
288
- opening_time={opening_time}
289
- closing_time={closing_time}
290
- name={name}
291
- offSeasonDetails={offSeasonDetails}
292
- weatherPermitting={weatherPermitting}
293
- />
294
- ) : (
295
- <div className="react-markdown">
296
- <Markdown>{description.data.description}</Markdown>
297
- </div>
298
- )}
299
- </div>
300
- </>
301
- );
302
- };
303
-
304
- export const PaddleLocationCard = ({
305
- svg,
306
- name,
307
- link,
308
- description,
309
- opening_time,
310
- closing_time,
311
- streetAddress,
312
- addressLocality,
313
- addressRegion,
314
- postalCode,
315
- commonName,
316
- season_start,
317
- season_end,
318
- phone,
319
- phoneNumber,
320
- offSeasonDetails,
321
- weatherPermitting
322
- }: PaddleLocationCardTypes) => {
323
-
324
- const phoneDidgits = Number(phoneNumber);
325
-
326
- if (phone) {
327
- return (
328
- <div className="location">
329
- <PhoneContent
330
- link={link}
331
- svg={svg}
332
- name={name}
333
- description={description}
334
- opening_time={opening_time}
335
- closing_time={closing_time}
336
- streetAddress={streetAddress}
337
- addressLocality={addressLocality}
338
- addressRegion={addressRegion}
339
- postalCode={postalCode}
340
- commonName={commonName}
341
- season_start={season_start}
342
- season_end={season_end}
343
- offSeasonDetails={offSeasonDetails}
344
- phoneNumber={phoneDidgits}
345
- weatherPermitting={weatherPermitting}
346
- />
347
- </div>
348
- );
349
- }
350
-
351
- if (link.includes("http")) {
352
- return (
353
- <a
354
- href={link}
355
- className="location"
356
- target="_blank"
357
- rel="noopener noreferrer"
358
- title={name}
359
- >
360
- <Content
361
- svg={svg}
362
- name={name}
363
- description={description}
364
- opening_time={opening_time}
365
- closing_time={closing_time}
366
- streetAddress={streetAddress}
367
- addressLocality={addressLocality}
368
- addressRegion={addressRegion}
369
- postalCode={postalCode}
370
- commonName={commonName}
371
- season_start={season_start}
372
- season_end={season_end}
373
- offSeasonDetails={offSeasonDetails}
374
- weatherPermitting={weatherPermitting}
375
- />
376
- </a>
377
- );
378
- }
379
- return (
380
- <Link to={link} className="location">
381
- <Content
382
- svg={svg}
383
- name={name}
384
- description={description}
385
- opening_time={opening_time}
386
- closing_time={closing_time}
387
- streetAddress={streetAddress}
388
- addressLocality={addressLocality}
389
- addressRegion={addressRegion}
390
- postalCode={postalCode}
391
- commonName={commonName}
392
- season_start={season_start}
393
- season_end={season_end}
394
- offSeasonDetails={offSeasonDetails}
395
- weatherPermitting={weatherPermitting}
396
- />
397
- </Link>
398
- );
399
- };