Skip to content

Commit

Permalink
fix: Add return
Browse files Browse the repository at this point in the history
  • Loading branch information
wd7bxscience committed May 17, 2024
1 parent e97b8ce commit 6aa75cb
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions app/components/Bulletin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,33 @@ export function Bulletin(props: { routes: Record<string, Route>; stop: Stop; wal
return vehicle.minutes_until_arrival > props.walk_time / 2;
});

{
times.length > 0 ? (
<div
className="flex min-h-29 flex-row items-center rounded-lg bg-slate-200 text-black"
key={Math.random()}
>
<div className="flex min-h-full w-5/6 flex-row items-center rounded-lg bg-slate-100 shadow-2xl">
<div className="flex min-h-full w-4/5 flex-row items-center justify-start gap-2 px-2">
<Bullet route={props.routes[times[0].route_id]} size={72} />
<h1 className="line-clamp-2 text-wrap font-bold 2xl:text-4xl">{times[0].destination_name}</h1>
</div>
<div className="flex min-h-full w-1/5 flex-col items-center justify-center">
<h1 className="font-black 2xl:text-6xl">{times[0].minutes_until_arrival}</h1>
<h1 className="font-semibold 2xl:text-2xl">min</h1>
</div>
return times.length > 0 ? (
<div className="flex min-h-29 flex-row items-center rounded-lg bg-slate-200 text-black" key={Math.random()}>
<div className="flex min-h-full w-5/6 flex-row items-center rounded-lg bg-slate-100 shadow-2xl">
<div className="flex min-h-full w-4/5 flex-row items-center justify-start gap-2 px-2">
<Bullet route={props.routes[times[0].route_id]} size={72} />
<h1 className="line-clamp-2 text-wrap font-bold 2xl:text-4xl">{times[0].destination_name}</h1>
</div>

<div className="flex min-h-full w-1/6 flex-col items-center justify-center">
{times[1] ? (
<React.Fragment>
<h1 className="font-black 2xl:text-6xl">{times[1].minutes_until_arrival}</h1>
<h1 className="font-semibold 2xl:text-2xl ">min</h1>
</React.Fragment>
) : undefined}
<div className="flex min-h-full w-1/5 flex-col items-center justify-center">
<h1 className="font-black 2xl:text-6xl">{times[0].minutes_until_arrival}</h1>
<h1 className="font-semibold 2xl:text-2xl">min</h1>
</div>
</div>
) : (
<div className="flex min-h-29 flex-row items-center rounded-lg bg-slate-100">
<h1 className="flex-1 text-center font-bold text-black 2xl:text-5xl">No scheduled vehicles</h1>

<div className="flex min-h-full w-1/6 flex-col items-center justify-center">
{times[1] ? (
<React.Fragment>
<h1 className="font-black 2xl:text-6xl">{times[1].minutes_until_arrival}</h1>
<h1 className="font-semibold 2xl:text-2xl ">min</h1>
</React.Fragment>
) : undefined}
</div>
);
}
</div>
) : (
<div className="flex min-h-29 flex-row items-center rounded-lg bg-slate-100">
<h1 className="flex-1 text-center font-bold text-black 2xl:text-5xl">No scheduled vehicles</h1>
</div>
);
});
})}
</React.Fragment>
Expand Down

0 comments on commit 6aa75cb

Please sign in to comment.