Skip to content

Commit

Permalink
Adding bank holidays list
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonfnasc12 committed Jun 17, 2024
1 parent 1e5548c commit 2ed0ef2
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 64 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "store-locator",
"version": "0.11.1",
"version": "0.11.2-hkignore.4",
"title": "Store Locator",
"description": "Integrates with the logistics module to provide Store Locator pages",
"builders": {
Expand Down
2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@types/co-body": "0.0.3",
"@types/node": "^12.0.0",
"@types/ramda": "types/npm-ramda#dist",
"@vtex/api": "6.46.1",
"@vtex/api": "6.47.0",
"@vtex/prettier-config": "^0.3.1",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.18.0",
Expand Down
10 changes: 5 additions & 5 deletions node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@
"@types/mime" "*"
"@types/node" "*"

"@vtex/api@6.46.1":
version "6.46.1"
resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.46.1.tgz#55a8755ae48f5400e7f1ed1921cd547950bb7a2a"
integrity sha512-geoxVvyWoQpOQ70Zmx3M8SBkRoGOS/bp9Gy26M+iCue63jofVSwmFz1zf66EaHA1PKOJNRgQPFwY+oeDE1U2lQ==
"@vtex/api@6.47.0":
version "6.47.0"
resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.47.0.tgz#6910455d593d8bb76f1f4f2b7660023853fda35e"
integrity sha512-t9gt7Q89EMbSj3rLhho+49Fv+/lQgiy8EPVRgtmmXFp1J4v8hIAZF7GPjCPie111KVs4eG0gfZFpmhA5dafKNA==
dependencies:
"@types/koa" "^2.11.0"
"@types/koa-compose" "^3.2.3"
Expand Down Expand Up @@ -1389,7 +1389,7 @@ sprintf-js@~1.0.2:
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==

stats-lite@vtex/node-stats-lite#dist:
"stats-lite@github:vtex/node-stats-lite#dist":
version "2.2.0"
resolved "https://codeload.github.com/vtex/node-stats-lite/tar.gz/1b0d39cc41ef7aaecfd541191f877887a2044797"
dependencies:
Expand Down
117 changes: 60 additions & 57 deletions react/StoreHours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const CSS_HANDLES = [
'dayOfWeek',
'divider',
'businessHours',
'hourHolidayRow'
] as const

const timeFormat = (time: string, format?: string) => {
Expand Down Expand Up @@ -106,8 +107,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
const validJSON = isValidJSON(group.instructions)
const instructionsParsed = validJSON ? JSON.parse(group.instructions) : null
const groceryBusinessHours = instructionsParsed ? instructionsParsed.groceryBusinessHours : null

console.log("GROCERY", groceryBusinessHours)
const groceryTitle = instructionsParsed ? instructionsParsed.groceryTitle : null

const displayHours = (item) => {
const open = timeFormat(item.openingTime, format)
Expand Down Expand Up @@ -137,7 +137,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({

return (
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[dayOfWeek])}, {month}
Bank Holiday {intl.formatMessage(messages[dayOfWeek])}, {month}
</div>
)
}
Expand Down Expand Up @@ -170,86 +170,89 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
}

return (
<div
className={`${handles.hoursMainContainer} container flex justify-around flex-wrap flex-nowrap-l`}
>
<div className={`${handles.hoursContainer} w-100 ${groceryBusinessHours ? 'w-50-l' : 'w-100-l'} mh3 box`}>
<span className={`b ${handles.hoursLabel}`}>
{label ?? intl.formatMessage(messages.hoursLabel)}
</span>
<br />
{businessHours?.map((item: any, i: number) => {
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{item.dayOfWeek}
<span className={handles.divider}>:</span>
</div>
<div className={`${handles.businessHours} tc w-50`}>
{item.openingTime} - {item.closingTime}
</div>
</div>
)
})}
{!businessHours &&
group.businessHours.map((item: any, i: number) => {
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
<span className={handles.divider}>:</span>
</div>
<div className={`${handles.businessHours} tc w-50`}>
{displayHours(item)}
</div>
</div>
)
})}
<br />
<b>{intl.formatMessage(messages.holidayLabel)}</b>
<>
<div className={`container mt6`}>
{!pickupHolidays &&
group.pickupHolidays.map((item: any, i: number) => (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
className={`${handles.hourHolidayRow} mv1 ph2 flex flex-wrap`}
>
{displayHolidayDay(item)}
{displayHolidayHours(item)}
</div>
))}
</div>
{groceryBusinessHours &&
(<div className={`${handles.hoursContainer} w-100 w-50-l mh3 box`}>
<span className={`b ${handles.groceryHoursLabel}`}>
{intl.formatMessage(messages.groceryHoursLabel)}
<div
className={`${handles.hoursMainContainer} container flex justify-around flex-wrap flex-nowrap-l`}
>
<div className={`${handles.hoursContainer} w-100 ${groceryBusinessHours ? 'w-50-l' : 'w-100-l'} mh3 box`}>
<span className={`b ${handles.hoursLabel}`}>
{label ?? intl.formatMessage(messages.hoursLabel)}
</span>
<br />
{groceryBusinessHours.map((item: any, i: number) => {
{businessHours?.map((item: any, i: number) => {
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
{item.dayOfWeek}
<span className={handles.divider}>:</span>
</div>
<div className={`${handles.businessHours} tc w-50`}>
{displayHours(item)}
{item.openingTime} - {item.closingTime}
</div>
</div>
)
})}
{!businessHours &&
group.businessHours.map((item: any, i: number) => {
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
<span className={handles.divider}>:</span>
</div>
<div className={`${handles.businessHours} tc w-50`}>
{displayHours(item)}
</div>
</div>
)
})}
<br />
</div>)}

</div>
<b>{intl.formatMessage(messages.holidayLabel)}</b>
</div>
{groceryBusinessHours &&
(<div className={`${handles.hoursContainer} w-100 w-50-l mh3 box`}>
<span className={`b ${handles.groceryHoursLabel}`}>
{groceryTitle ? groceryTitle : intl.formatMessage(messages.groceryHoursLabel)}
</span>
<br />
{groceryBusinessHours.map((item: any, i: number) => {
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
<span className={handles.divider}>:</span>
</div>
<div className={`${handles.businessHours} tc w-50`}>
{displayHours(item)}
</div>
</div>
)
})}
<br />
</div>)}
</div>
</>
)
}

Expand Down

0 comments on commit 2ed0ef2

Please sign in to comment.