Skip to content

Commit

Permalink
refactor: change table spacing to use classname instead of index
Browse files Browse the repository at this point in the history
  • Loading branch information
seandreassen committed Nov 7, 2024
1 parent 8f70617 commit 0118dd1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/[locale]/(default)/shift-schedule/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function ShiftScheduleLayout({

return (
<>
<h1 className='mb-4 text-center'>{t('title')}</h1>
<h1 className='text-center'>{t('title')}</h1>
{children}
</>
);
Expand Down
8 changes: 4 additions & 4 deletions src/app/[locale]/(default)/shift-schedule/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export default function ShiftScheduleLayout() {
return (
<>
{/* Table shown on small screens */}
<div className='sm:hidden'>
{days.map((day, index) => (
<Table key={day} className={index === 0 ? '' : 'mt-8'}>
<div className='sm:hidden [&>div]:mt-8'>
{days.map((day) => (
<Table key={day}>
<TableHeader>
<TableRow>
<TableHead className='w-2/5'>{t('time')}</TableHead>
Expand Down Expand Up @@ -94,7 +94,7 @@ export default function ShiftScheduleLayout() {
</div>

{/* Table shown on all other screens */}
<Table className='hidden sm:table'>
<Table className='mt-8 hidden sm:table'>
<TableHeader>
<TableRow>
<TableHead className='w-1/6'>{t('time')}</TableHead>
Expand Down
2 changes: 1 addition & 1 deletion src/components/shift-schedule/AdministratorMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function AdministratorMenu({ t }: AdministratorMenuProps) {
<Collapsible
open={isOpen}
onOpenChange={setIsOpen}
className='mx-auto xs:mx-8 my-8 rounded border p-3'
className='mx-auto xs:mx-8 mt-8 rounded border p-3'
>
<div className='mx-1 flex justify-between'>
<span className='my-auto font-semibold text-xl'>{t.label}</span>
Expand Down
8 changes: 4 additions & 4 deletions src/components/shift-schedule/ScheduleTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ function ScheduleTable({ week }: ScheduleTableProps) {
return (
<>
{/* Table shown on small screens */}
<div className='sm:hidden'>
{days.map((day, index) => (
<Table key={day} className={index === 0 ? '' : 'mt-8'}>
<div className='sm:hidden [&>div]:mt-8'>
{days.map((day) => (
<Table key={day}>
<TableHeader>
<TableRow>
<TableHead className='w-2/5'>{t('time')}</TableHead>
Expand Down Expand Up @@ -121,7 +121,7 @@ function ScheduleTable({ week }: ScheduleTableProps) {
</div>

{/* Table shown on all other screens */}
<Table className='hidden sm:table'>
<Table className='mt-8 hidden sm:table'>
<TableHeader>
<TableRow>
<TableHead className='w-1/6'>{t('time')}</TableHead>
Expand Down

0 comments on commit 0118dd1

Please sign in to comment.