@rileybathurst/paddle 0.0.118 → 0.0.119
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 +1 -2
- package/src/PaddleTopBar.tsx +37 -31
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rileybathurst/paddle",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.119",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"@storybook/addon-essentials": "^8.0.10",
|
|
28
28
|
"@storybook/addon-interactions": "^8.0.10",
|
|
29
29
|
"@storybook/addon-links": "^8.0.10",
|
|
30
|
-
"@storybook/addon-onboarding": "^8.0.10",
|
|
31
30
|
"@storybook/blocks": "^8.0.10",
|
|
32
31
|
"@storybook/react": "^8.0.10",
|
|
33
32
|
"@storybook/react-vite": "^8.0.10",
|
package/src/PaddleTopBar.tsx
CHANGED
|
@@ -10,42 +10,48 @@ type PaddleTopBarTypes = {
|
|
|
10
10
|
topbar: string;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
startDate: string;
|
|
17
|
-
startTime: string;
|
|
18
|
-
endDate: string;
|
|
19
|
-
endTime: string;
|
|
20
|
-
closed: boolean;
|
|
21
|
-
condition: {
|
|
22
|
-
excerpt: string;
|
|
23
|
-
}
|
|
24
|
-
}[];
|
|
13
|
+
RainCheck: string;
|
|
14
|
+
RainCheckDate: Date;
|
|
15
|
+
RainCheckReason: string;
|
|
25
16
|
};
|
|
26
17
|
}
|
|
27
|
-
export const PaddleTopBar = ({ strapiLocale
|
|
28
|
-
|
|
29
|
-
let currentWeather = '';
|
|
30
|
-
let currentStatus = false;
|
|
31
|
-
const currentDate = new Date().toISOString().split('T')[0];
|
|
32
|
-
// console.log('currentDate', currentDate);
|
|
18
|
+
export const PaddleTopBar = ({ strapiLocale }: PaddleTopBarTypes) => {
|
|
33
19
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
currentWeather = date.condition.excerpt;
|
|
37
|
-
currentStatus = date.closed;
|
|
38
|
-
|
|
39
|
-
// console.log('inside the if', date.startDate);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
20
|
+
const RainCheckDate = new Date(strapiLocale.RainCheck);
|
|
21
|
+
const currently = new Date();
|
|
42
22
|
|
|
43
23
|
return (
|
|
44
|
-
<div className={
|
|
45
|
-
{
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
<div className={`${location} top-bar`}>
|
|
25
|
+
{RainCheckDate > currently ? (
|
|
26
|
+
<p className="rain-check">
|
|
27
|
+
<span className="rain-check-date">
|
|
28
|
+
{RainCheckDate.toLocaleDateString('en-US', {
|
|
29
|
+
month: '2-digit',
|
|
30
|
+
day: '2-digit',
|
|
31
|
+
year: '2-digit',
|
|
32
|
+
})}
|
|
33
|
+
</span>
|
|
34
|
+
We will be closing at
|
|
35
|
+
<span className="rain-check-time">
|
|
36
|
+
{RainCheckDate.toLocaleTimeString('en-US', {
|
|
37
|
+
hour: '2-digit',
|
|
38
|
+
minute: '2-digit',
|
|
39
|
+
hour12: true,
|
|
40
|
+
})} due to an incoming</span>
|
|
41
|
+
{strapiLocale.RainCheckReason}
|
|
42
|
+
</p>
|
|
43
|
+
) : RainCheckDate.toDateString() === currently.toDateString() ? (
|
|
44
|
+
<p className="rain-check">
|
|
45
|
+
<span className="rain-check-date">{RainCheckDate.toLocaleDateString('en-US', {
|
|
46
|
+
month: '2-digit',
|
|
47
|
+
day: '2-digit',
|
|
48
|
+
year: '2-digit',
|
|
49
|
+
})}</span>
|
|
50
|
+
<span className="rain-check-reason">We're closed today due to {strapiLocale.RainCheckReason}</span>
|
|
51
|
+
</p>
|
|
52
|
+
) : (
|
|
53
|
+
<p>We're Open for the 2024 Summer</p>
|
|
54
|
+
)
|
|
49
55
|
}
|
|
50
56
|
</div>
|
|
51
57
|
)
|