Skip to content

Commit

Permalink
fix hours styling
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Dec 11, 2023
1 parent f2d2e94 commit e4c7cd3
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions packages/ui/components/data-display/Hours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ const useStyles = createStyles(() => ({
dow: {
verticalAlign: 'baseline',
paddingRight: rem(4),
borderTopStyle: 'none !important' as 'none',
paddingTop: '0 !important',
paddingBottom: '0 !important',
},
hours: {
borderTopStyle: 'none !important' as 'none',
paddingTop: '0 !important',
paddingBottom: '0 !important',
},
}))

Expand All @@ -34,19 +42,23 @@ export const Hours = ({ parentId, label = 'regular' }: HoursProps) => {
const hourTable = Object.entries(data).map(([dayIdx, data]) => {
return (
<tr key={dayIdx}>
<td className={classes.dow}>{dayMap.get(parseInt(dayIdx))}</td>
<td>
<td className={classes.dow}>
<Text>{dayMap.get(parseInt(dayIdx))}</Text>
</td>
<td className={classes.hours}>
<List listStyleType='none'>
{data.map(({ id, interval: intervalISO, closed }) => {
const interval = Interval.fromISO(intervalISO)

return (
<List.Item key={id}>
{closed
? t('hours.closed')
: interval.toDuration('hours').valueOf() === OPEN_24_MILLISECONDS
? t('hours.open24')
: interval.toFormat('hh:mm a')}
<Text>
{closed
? t('hours.closed')
: interval.toDuration('hours').valueOf() === OPEN_24_MILLISECONDS
? t('hours.open24')
: interval.toFormat('hh:mm a')}
</Text>
</List.Item>
)
})}
Expand Down

0 comments on commit e4c7cd3

Please sign in to comment.