@rileybathurst/paddle 1.9.23 → 1.9.25
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
package/src/index.tsx
CHANGED
|
@@ -39,6 +39,6 @@ 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
41
|
export * from "./types/paddle-purchase-image-types";
|
|
42
|
-
export * from "./types/paddle-
|
|
42
|
+
export * from "./types/paddle-branded-types";
|
|
43
43
|
export * from "./types/paddle-book-now-types";
|
|
44
44
|
export * from "./types/paddle-testimonial-types";
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { Link } from 'gatsby';
|
|
3
3
|
import SVG from 'react-inlinesvg';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PaddlePurchaseTypes } from "./types/paddle-purchase-types";
|
|
5
5
|
|
|
6
|
-
export const PaddleBrandList = ({ nodes, sport }: { nodes:
|
|
6
|
+
export const PaddleBrandList = ({ nodes, sport }: { nodes: PaddlePurchaseTypes[]; sport?: string }) => {
|
|
7
|
+
|
|
8
|
+
// TODO: testing
|
|
9
|
+
console.log(nodes);
|
|
10
|
+
nodes.map((node: PaddlePurchaseTypes) => {
|
|
11
|
+
console.log(node);
|
|
12
|
+
});
|
|
7
13
|
|
|
8
14
|
return (
|
|
9
15
|
<ul className='brand_list'>
|
|
10
|
-
{nodes.map((
|
|
11
|
-
<li key={brand.id}>
|
|
12
|
-
<Link to={`/retail/${sport}/${brand.slug}`}>
|
|
13
|
-
{brand.svg ?
|
|
16
|
+
{nodes.map((node: PaddlePurchaseTypes) => (
|
|
17
|
+
<li key={node.brand.id}>
|
|
18
|
+
<Link to={`/retail/${sport}/${node.brand.slug}`}>
|
|
19
|
+
{node.brand.svg ?
|
|
14
20
|
<SVG
|
|
15
|
-
src={brand.svg}
|
|
21
|
+
src={node.brand.svg}
|
|
16
22
|
/>
|
|
17
23
|
: null}
|
|
18
|
-
{brand.name}
|
|
24
|
+
{node.brand.name}
|
|
19
25
|
</Link>
|
|
20
26
|
</li>
|
|
21
27
|
))}
|
package/src/paddle-specs.tsx
CHANGED
|
@@ -20,9 +20,10 @@ type SpecsTypes = {
|
|
|
20
20
|
}
|
|
21
21
|
// * moving the section tag to the parent component means you can loop yourself
|
|
22
22
|
export const PaddleSpecs = (specs: SpecsTypes) =>
|
|
23
|
-
// <section className='specs'>
|
|
24
23
|
Object.entries(specs).map(([key, value]) => {
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
console.log(key);
|
|
26
|
+
console.log(value);
|
|
26
27
|
|
|
27
28
|
if (!value) {
|
|
28
29
|
console.warn(`Missing value for ${key}`);
|
|
@@ -41,15 +42,6 @@ export const PaddleSpecs = (specs: SpecsTypes) =>
|
|
|
41
42
|
// * I cant remeber others yet
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
45
|
if (key === "cost" && typeof value === "object" && value.discount) {
|
|
54
46
|
const amount = (Number(value.price) -
|
|
55
47
|
Number(value.discount) * (Number(value.price) / 100)) as number;
|
|
@@ -74,8 +66,8 @@ export const PaddleSpecs = (specs: SpecsTypes) =>
|
|
|
74
66
|
);
|
|
75
67
|
}
|
|
76
68
|
|
|
77
|
-
/*
|
|
78
|
-
|
|
69
|
+
/* // * this should be working for weight */
|
|
70
|
+
// The key kinda seems like its being thrown awaywhich is fine
|
|
79
71
|
if (typeof value === "object") {
|
|
80
72
|
return <PaddleSpecs {...value} />;
|
|
81
73
|
}
|