Skip to content

Commit

Permalink
Change spacing in schedule and border position
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmx committed May 14, 2024
1 parent fe1bfcb commit 057bcc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ function PeriodTable({ period }:{period:TimetablePeriod & { period_names: string
});
return (
<div>
<div className='flex flex-wrap gap-1'>
<div className='flex flex-wrap gap-1 border-b border-b-black pb-1 mb-2'>
{period.period_names.map((name, i) => <>
{i != 0 && <div className='text-slate-400 leading-none'>|</div>}
<div key={i} className='text-base font-semibold leading-none'>{name}</div>
</>)}
</div>
{/* <h2 className='text-base font-semibold'>{period.period_names.join('|')}</h2> */}
<div className='flex flex-col gap-2'>
<div className='flex flex-col gap-1'>
{(toRender.length > 0 ?
toRender.map(([title, times], i) => <SubTable key={i} title={title} times={times}/>) :
<div className='font-semibold text-[8pt]'>Não há horários de passagem neste período</div>)}
Expand All @@ -111,7 +111,6 @@ function SubTable({ title, times }:{title:string, times:TimetableEntry[]}) {
}
// console.log(times);
return <div className=''>
<div className='bg-black h-px w-full my-2'></div>
<h3 className='text-sm font-medium mb-0.5'>{title}</h3>
<div className='flex text-[3mm]'>
<div className='flex flex-col '>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default async function Page({ params }:{params:{line_id:string, stop_id:s
// console.log(JSON.stringify(timetable, null, 2));
const patternURL = `${API_URL}/patterns/${timetable.patternForDisplay}`;
const patternRes = fetch(patternURL).then(patternRes => patternRes.json());
if (!timetable.secondaryPatterns) {
console.error('timetable.secondaryPatterns is undefined', timetable);
return;
}
const secondaryPatternsPromise = Promise.all(timetable.secondaryPatterns.map(patternId => fetch(`${API_URL}/patterns/${patternId}`).then(patternRes => patternRes.json())));
// console.log(patternURL, timetable.secondaryPatterns.map(patternId => `${API_URL}/patterns/${patternId}`));

Expand Down

0 comments on commit 057bcc5

Please sign in to comment.