@rileybathurst/paddle 0.0.82 → 0.0.84

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": "0.0.82",
4
+ "version": "0.0.84",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -0,0 +1,75 @@
1
+ import * as React from "react"
2
+ import PaddleRemainder from "./paddle-remainder.tsx"
3
+
4
+ interface SpecsTypes {
5
+ [key: string]: string | number | {
6
+ [key: string]: string | number[];
7
+ };
8
+ }
9
+ // * moving the section tag to the parent component means you can loop yourself
10
+ const PaddleSpecs = (specs: SpecsTypes) => {
11
+ return (
12
+ // <section className='specs'>
13
+ Object.entries(specs).map(([key, value]) => {
14
+
15
+ // console.log(key, value);
16
+
17
+ if (!value) {
18
+ return null;
19
+ }
20
+
21
+ /* I didnt know you could call yourself like this */
22
+ /* I guess its not a infinite loop as its not calling an object */
23
+ if (key === 'weight' && typeof value === 'object') {
24
+ return (
25
+ <PaddleSpecs {...value} />
26
+ );
27
+ }
28
+
29
+ if (key === 'cost' && typeof value === 'object' && value.discount) {
30
+
31
+ const amount = Number(value.price) - (Number(value.discount) * (Number(value.price) / 100)) as number;
32
+
33
+ return (
34
+ <>
35
+ {/* // TODO: add color */}
36
+ <div className="spec">
37
+ <h2><del>Original Price</del></h2>
38
+ <h3>
39
+ <del>
40
+ ${value.price}
41
+ </del>
42
+ </h3>
43
+ </div>
44
+ <div className="spec mullen">
45
+ <h2>Sale Price</h2>
46
+ {value.discount}% off
47
+ <h3>${amount}</h3>
48
+ </div>
49
+ </>
50
+ );
51
+ }
52
+
53
+ if (typeof value === 'object') {
54
+ return (
55
+ <PaddleSpecs {...value} />
56
+ );
57
+ }
58
+
59
+ return (
60
+ <div key={key} className="spec">
61
+ <h2>{key}</h2>
62
+ <h3>
63
+ {key === 'price' ? <span className="spec__unit">$</span> : null}
64
+ {key === 'length' && typeof value === 'number' ? <PaddleRemainder inches={value} /> : value}
65
+ {key === 'hullweight' || key === 'riggedweight' ? <span className="spec__unit">lbs</span> : null}
66
+ {key === 'width' || key === 'length' || key === 'capacity' ? <span className="spec__unit">"</span> : null}
67
+ </h3>
68
+ </div>
69
+ )
70
+ })
71
+ // </section>
72
+ )
73
+ }
74
+
75
+ export default PaddleSpecs;
package/src/index.tsx CHANGED
@@ -7,6 +7,7 @@
7
7
  // Atoms
8
8
  export * from "./PaddleBookNow";
9
9
  export * from "./PaddleTime";
10
+ export * from "./paddle-remainder";
10
11
 
11
12
  // Molecules
12
13
  export * from "./PaddleComposition";
@@ -16,6 +17,7 @@ export * from "./PaddleTestimonials";
16
17
  export * from "./PaddleTicket";
17
18
  export * from "./PaddleSunsetTourTimes";
18
19
  export * from "./PaddleTopBar";
20
+ export * from "./PaddleSpecs";
19
21
 
20
22
  // Organisms
21
23
  export * from "./PaddleLocationDeck";
@@ -0,0 +1,20 @@
1
+ // name this better
2
+ import * as React from "react"
3
+
4
+ type PaddleRemainderTypes = {
5
+ inches: number;
6
+ }
7
+ const PaddleRemainder = ({ inches }: PaddleRemainderTypes) => {
8
+
9
+ const feet = Math.floor(inches / 12);
10
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
11
+ const leftover = inches % 12;
12
+
13
+ return (
14
+ <>
15
+ {feet}'&thinsp;{leftover !== 0 ? `${leftover}"` : null}
16
+ </>
17
+ )
18
+ }
19
+
20
+ export default PaddleRemainder
@@ -103,7 +103,7 @@ footer > * {
103
103
  /* this isnt a direct nested its always down another layer */
104
104
  .albatross .pelican,
105
105
  /* ! deck * needs to be removed its maybe only the image that needs it */
106
- .deck *:not(p, hr) {
106
+ .deck > *:not(h4, p, hr) {
107
107
  /* ? margin-inline: 0; ? should this be centered */
108
108
  /* TODO: this needs a :not for a few things */
109
109
  width: 100%; /* resets the padding */
@@ -203,3 +203,30 @@ ol {
203
203
  }
204
204
  }
205
205
  }
206
+
207
+ /*------------------------------------*/
208
+ /* #PADDLE SUNSET TOUR TIMES */
209
+ /*------------------------------------*/
210
+
211
+ .paddle-sunset-tour-times div {
212
+ border-block-start: 1px solid;
213
+ padding-block-start: var(--vinson);
214
+ }
215
+
216
+ .date-time {
217
+ display: flex;
218
+ flex-flow: column;
219
+ gap: 0.5rem;
220
+ justify-items: center;
221
+ text-align: center;
222
+
223
+ .date {
224
+ width: max-content;
225
+ }
226
+
227
+ .time {
228
+ padding: 0.5rem;
229
+ border-radius: var(--border-radius);
230
+ width: max-content;
231
+ }
232
+ }