Skip to content

Commit

Permalink
#121 Fix showing title when no channels are available
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed May 28, 2021
1 parent 72016f4 commit 0fb2451
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions resources/js/Pages/Platforms/Show.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,22 @@ export default function Show({ app, platforms, platform, channels, releases, pac
<p className="mb-0 mt-1">{platform.description}</p>
</div>

<div className="col-12">
<h2 className="h5 mb-3 fw-bold">Channels</h2>
<div className="row g-1">
{channels.map((channel, key) => (
<Channel
key={key}
channel={{ color: channel.color, name: channel.name }}
build={channel.flights.length > 0 ? channel.flights[0].version : ''}
date={channel.flights.length > 0 ? format(parseISO(channel.flights[0].date), 'd MMMM yyyy') : ''}
url={channel.flights.length > 0 ? channel.flights[0].url : undefined}
/>
))}
{channels.length >= 1 &&
<div className="col-12">
<h2 className="h5 mb-3 fw-bold">Channels</h2>
<div className="row g-1">
{channels.map((channel, key) => (
<Channel
key={key}
channel={{ color: channel.color, name: channel.name }}
build={channel.flights.length > 0 ? channel.flights[0].version : ''}
date={channel.flights.length > 0 ? format(parseISO(channel.flights[0].date), 'd MMMM yyyy') : ''}
url={channel.flights.length > 0 ? channel.flights[0].url : undefined}
/>
))}
</div>
</div>
</div>
}
<div className="col-12">
<div className="row">
{currentReleases.length > 0 &&
Expand Down

0 comments on commit 0fb2451

Please sign in to comment.