@rileybathurst/paddle 0.0.54 → 0.0.55

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/PaddleSEO.tsx +28 -23
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "0.0.54",
4
+ "version": "0.0.55",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
package/src/PaddleSEO.tsx CHANGED
@@ -64,19 +64,21 @@ type SEOtypes = {
64
64
  ogImagedescription: string;
65
65
  };
66
66
 
67
- strapiLocation: {
68
- streetAddress: string;
69
- addressLocality: string;
70
- addressRegion: string;
71
- postalCode: string;
72
- paymentAccepted: string;
73
- phone: string;
74
- opening_time: string;
75
- closing_time: string;
67
+ allStrapiLocation: {
68
+ nodes: {
69
+ streetAddress: string;
70
+ addressLocality: string;
71
+ addressRegion: string;
72
+ postalCode: string;
73
+ paymentAccepted: string;
74
+ phone: string;
75
+ opening_time: string;
76
+ closing_time: string;
77
+ }[];
76
78
  };
77
79
  }
78
80
 
79
- export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, breadcrumbs, strapiLocale, strapiLocation }: SEOtypes) => {
81
+ export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, breadcrumbs, strapiLocale, allStrapiLocation }: SEOtypes) => {
80
82
 
81
83
  const businessName = `${strapiLocale.name} Kayak & Paddleboard rentals and tours`;
82
84
 
@@ -91,9 +93,11 @@ export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, bre
91
93
  // const formatted = query.split('\n').map((item) => item.trim().replace('- ', '')).join(', ');
92
94
  // console.log(formatted);
93
95
 
96
+ // TODO: this is now allStrapiLocation.nodes
97
+ // TODO: I think this will be a keylocation piece
94
98
  // console.log(strapiLocation.paymentAccepted);
95
- const paymentAcceptedQuery = strapiLocation.paymentAccepted ? strapiLocation.paymentAccepted : '';
96
- const paymentAcceptedFormatted = paymentAcceptedQuery.split('\n').map((payment: string) => payment.trim().replace('- ', '')).join(', ');
99
+ // const paymentAcceptedQuery = strapiLocation.paymentAccepted ? strapiLocation.paymentAccepted : '';
100
+ // const paymentAcceptedFormatted = paymentAcceptedQuery.split('\n').map((payment: string) => payment.trim().replace('- ', '')).join(', ');
97
101
  // console.log(paymentAcceptedFormatted);
98
102
 
99
103
  return (
@@ -118,13 +122,18 @@ export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, bre
118
122
  "url": "${strapiLocale.url}",
119
123
  "description": "${strapiLocale.name}",
120
124
  "image": "${PaddleImage}",
121
- "address": {
122
- "@type": "PostalAddress",
123
- "streetAddress": "${strapiLocation.streetAddress}",
124
- "addressLocality": "${strapiLocation.addressLocality}",
125
- "addressRegion": "${strapiLocation.addressRegion}",
126
- "postalCode": "${strapiLocation.postalCode}"
127
- },
125
+
126
+ ${allStrapiLocation.nodes.map((location) => {
127
+ return `{
128
+ "address": {
129
+ "@type": "PostalAddress",
130
+ "streetAddress": "${location.streetAddress}",
131
+ "addressLocality": "${location.addressLocality}",
132
+ "addressRegion": "${location.addressRegion}",
133
+ "postalCode": "${location.postalCode}"
134
+ },
135
+ }`
136
+ })},
128
137
  "geo": {
129
138
  "@type": "GeoCoordinates",
130
139
  "latitude": "${strapiLocale.latitude}",
@@ -139,11 +148,7 @@ export const PaddleSEO = ({ title, description, ogImage, ogImagedescription, bre
139
148
  },
140
149
  "geoRadius": "${strapiLocale.geoRadius}"
141
150
  },
142
- "paymentAccepted": "${paymentAcceptedFormatted}",
143
151
  "telephone": "${strapiLocale.phone}",
144
- "numberOfEmployees": "10",
145
- "openingHours": "Mo, Tu, We, Th, Fr, Sa, Su ${strapiLocation.opening_time}-${strapiLocation.closing_time}",
146
- "priceRange": "$30-$375"
147
152
  }
148
153
  `}
149
154
  </Script>