2018-12-22 22:09:27 +01:00
|
|
|
<script>
|
2023-05-14 07:50:43 +02:00
|
|
|
import Comment from './Comment.svelte';
|
2018-12-22 22:09:27 +01:00
|
|
|
|
|
|
|
export let item;
|
2019-04-15 15:10:17 +02:00
|
|
|
export let returnTo;
|
2020-04-07 15:30:33 +02:00
|
|
|
|
|
|
|
$: url = !item.domain ? `https://news.ycombinator.com/${item.url}` : item.url;
|
2018-12-22 22:09:27 +01:00
|
|
|
</script>
|
|
|
|
|
2019-04-15 15:10:17 +02:00
|
|
|
<a href={returnTo}>« back</a>
|
2018-12-22 22:09:27 +01:00
|
|
|
|
|
|
|
<article>
|
2023-05-14 07:50:43 +02:00
|
|
|
<a href={url}>
|
2018-12-22 22:09:27 +01:00
|
|
|
<h1>{item.title}</h1>
|
2020-04-07 15:30:48 +02:00
|
|
|
{#if item.domain}
|
|
|
|
<small>{item.domain}</small>
|
|
|
|
{/if}
|
2018-12-22 22:09:27 +01:00
|
|
|
</a>
|
|
|
|
|
2023-05-14 07:50:43 +02:00
|
|
|
<p class="meta">submitted by {item.user} {item.time_ago}</p>
|
2018-12-22 22:09:27 +01:00
|
|
|
</article>
|
|
|
|
|
|
|
|
<div class="comments">
|
|
|
|
{#each item.comments as comment}
|
2023-05-14 07:50:43 +02:00
|
|
|
<Comment {comment} />
|
2018-12-22 22:09:27 +01:00
|
|
|
{/each}
|
2020-04-07 15:30:33 +02:00
|
|
|
</div>
|
2021-04-22 18:05:13 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
article {
|
|
|
|
margin: 0 0 1em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
display: block;
|
|
|
|
margin: 0 0 1em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 1.4em;
|
|
|
|
margin: 0;
|
|
|
|
}
|
2023-05-14 07:50:43 +02:00
|
|
|
</style>
|