diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-04-15 23:06:26 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-04-15 23:06:26 +0200 |
| commit | 58f7d52150456713d3132408668a92d0f6f3d084 (patch) | |
| tree | 4b346042a684e416e53c4f4ac779060b832ad227 /src/components/topic_summary | |
| parent | 63c3da2af27fcfb1a9893ade03543e3a30949c8d (diff) | |
Port to sveltekit
Diffstat (limited to 'src/components/topic_summary')
| -rw-r--r-- | src/components/topic_summary/topic_summary.svelte | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/components/topic_summary/topic_summary.svelte b/src/components/topic_summary/topic_summary.svelte index 88b2b83..5f2678b 100644 --- a/src/components/topic_summary/topic_summary.svelte +++ b/src/components/topic_summary/topic_summary.svelte @@ -1,16 +1,24 @@ <script> - export let topic; + export let topic; - import { _ } from 'svelte-i18n'; - import { readableTime } from '$/utils/readable_time.js'; + import { _ } from 'svelte-i18n'; + import { readableTime } from '$/utils/readable_time.js'; - $: remainingTime = (topic.updated_at + topic.ttl) - Date.now(); - $: remaining = readableTime(remainingTime); + $: remainingTime = topic.updated_at + topic.ttl - Date.now(); + $: remaining = readableTime(remainingTime); </script> -<li class="h-entry" title="{$_('topic.title')}"> - <span class="p-name"><a class="u-url u-uid" title="{$_('topic.permalink_title')}" href="/t/{topic.id}">{topic.title}</a></span> - <span class="topic-ttl">({$_('topic.remaining_time', { values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) } })})</span> +<li class="h-entry" title={$_('topic.title')}> + <span class="p-name" + ><a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}" + >{topic.title}</a + ></span + > + <span class="topic-ttl" + >({$_('topic.remaining_time', { + values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) } + })})</span + > </li> <style> |