Skip to content

Commit

Permalink
Get the artists as individual images on the single events page and fi…
Browse files Browse the repository at this point in the history
…x the image url to work with the ArtistItem component
  • Loading branch information
moekify committed Mar 29, 2020
1 parent 0dbe677 commit e2c8119
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/routes/events/[slug].json.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function get(req, res, next) {
artists: e.artists.map(artist => ({
id: artist.artists_id.id,
name: artist.artists_id.artist_name,
imageUrls: artist.artists_id.image.data
imageUrls: artist.artists_id.image ? artist.artists_id.image.data.thumbnails[3].url : "placeholder_artists.jpeg"
}))
})

Expand Down
16 changes: 13 additions & 3 deletions src/routes/events/[slug].svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

<script>
import HeroModule from "../../components/UI/ContentModules/HeroModule.svelte";
import ArtistItem from "../../components/UI/ArtistItem.svelte";
export let event;
let heroContent = {};
Expand Down Expand Up @@ -43,6 +45,10 @@
align-items: center;
position: relative;
}
h2 {
text-align: center
}
</style>

<svelte:head>
Expand Down Expand Up @@ -71,9 +77,13 @@
<h2>Time: {event.endtime}</h2>
</div>
<div class="column is-4">
{#each event.artists as artist}
<a rel="prefetch" href={`/artists/${artist.id}`}>{artist.name}</a>
{/each}

</div>
</div>
</div>
<h2>Artists that supported this event</h2>
<div class="columns is-multiline">
{#each event.artists as artist}
<ArtistItem {artist} />
{/each}
</div>
2 changes: 1 addition & 1 deletion static/global.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e2c8119

Please # to comment.