Skip to content

Commit

Permalink
style: improve responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
Mecrano committed Jun 7, 2024
1 parent 3e623aa commit 3574e1c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions react/StoreHours.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import React, { FC } from 'react'
import { defineMessages, WrappedComponentProps, injectIntl } from 'react-intl'
import type { FC } from 'react'
import React from 'react'
import type { WrappedComponentProps } from 'react-intl'
import { defineMessages, injectIntl } from 'react-intl'
import PropTypes from 'prop-types'
import { useCssHandles } from 'vtex.css-handles'

Expand Down Expand Up @@ -54,6 +56,7 @@ const messages = defineMessages({
})

const CSS_HANDLES = [
'hoursMainContainer',
'hoursContainer',
'hoursLabel',
'groceryHoursLabel',
Expand Down Expand Up @@ -94,10 +97,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
}

const instructionsParsed = JSON.parse(group.instructions)
const groceryBusinessHours = instructionsParsed.groceryBusinessHours

console.log("LEONE GROUP", group)
console.log("LEONE GROCERYBUSINESSHOURS", groceryBusinessHours)
const { groceryBusinessHours } = instructionsParsed

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

return (
<div className="container">
<div className={`${handles.hoursContainer} box`}>
<div
className={`${handles.hoursMainContainer} container flex justify-around flex-wrap flex-nowrap-l`}
>
<div className={`${handles.hoursContainer} w-100 w-50-l mh3 box`}>
<span className={`b ${handles.hoursLabel}`}>
{label ?? intl.formatMessage(messages.hoursLabel)}
</span>
Expand All @@ -170,7 +172,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 flex flex-wrap`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{item.dayOfWeek}
Expand All @@ -187,7 +189,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 flex flex-wrap`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
Expand All @@ -205,14 +207,14 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
group.pickupHolidays.map((item: any, i: number) => (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 flex flex-wrap`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
{displayHolidayDay(item)}
{displayHolidayHours(item)}
</div>
))}
</div>
<div className={`${handles.hoursContainer} box`}>
<div className={`${handles.hoursContainer} w-100 w-50-l mh3 box`}>
<span className={`b ${handles.groceryHoursLabel}`}>
{intl.formatMessage(messages.groceryHoursLabel)}
</span>
Expand All @@ -222,7 +224,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
return (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 flex flex-wrap`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
<div className={`${handles.dayOfWeek} w-30`}>
{intl.formatMessage(messages[item.dayOfWeek])}
Expand All @@ -240,7 +242,7 @@ const StoreHours: FC<WrappedComponentProps & StoreHoursProps> = ({
group.pickupHolidays.map((item: any, i: number) => (
<div
key={`hour_${i}`}
className={`${handles.hourRow} mv1 flex flex-wrap`}
className={`${handles.hourRow} mv1 ph2 flex flex-wrap`}
>
{displayHolidayDay(item)}
{displayHolidayHours(item)}
Expand Down

0 comments on commit 3574e1c

Please sign in to comment.