Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread layout #718

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions web/src/routes/[slug=note]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
import { Api } from '$lib/Api';
import { referTags } from '$lib/EventHelper';
import { EventItem, Metadata } from '$lib/Items';
import Counter from './Counter.svelte';
import ProfileIconList from './ProfileIconList.svelte';
import { chronologicalItem } from '$lib/Constants';
import { tick } from 'svelte';
import MuteButton from '../action/MuteButton.svelte';
import IconRepeat from '@tabler/icons-svelte/dist/svelte/icons/IconRepeat.svelte';
import IconHeart from '@tabler/icons-svelte/dist/svelte/icons/IconHeart.svelte';

export let data: PageData;

Expand Down Expand Up @@ -176,10 +177,16 @@
/>
</div>

<Counter label={'Reposts'} count={repostEventItems.length} />
<ProfileIconList metadataList={repostMetadataList} />
<Counter label={'Reactions'} count={reactionEventItems.length} />
<ProfileIconList metadataList={reactionMetadataList} />
<section class="repost counter card">
<span class="icon"><IconRepeat /></span>
<span class="count">{repostEventItems.length}</span>
<ProfileIconList metadataList={repostMetadataList} />
</section>
<section class="reaction counter card">
<span class="icon"><IconHeart /></span>
<span class="count">{reactionEventItems.length}</span>
<ProfileIconList metadataList={reactionMetadataList} />
</section>
{#if $author !== undefined && item !== undefined}
<div class="mute">
<MuteButton tagName="e" tagContent={rootId === undefined ? item.event.id : rootId} />
Expand All @@ -199,6 +206,34 @@
/>

<style>
section {
margin: 0.5rem auto;
padding: 6px;
}

.counter {
display: flex;
align-items: center;
}

.icon {
margin-right: 0.5rem;
width: 24px;
height: 24px;
}

.count {
margin-right: 0.5rem;
}

.repost .icon {
color: var(--green);
}

.reaction .icon {
color: var(--red);
}

.mute {
margin-top: 16px;
display: flex;
Expand Down
6 changes: 0 additions & 6 deletions web/src/routes/[slug=note]/Counter.svelte

This file was deleted.

6 changes: 6 additions & 0 deletions web/src/routes/[slug=note]/ProfileIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
</article>

<style>
a {
display: block;
width: 30px;
height: 30px;
}

img {
width: 30px;
height: 30px;
Expand Down