Skip to content

Commit

Permalink
Merge pull request #633 from SnowCait/hide-action-menu-on-thread
Browse files Browse the repository at this point in the history
Hide action menu on thread
  • Loading branch information
SnowCait authored Sep 30, 2023
2 parents d16ae10 + b29c322 commit bc21ace
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion web/src/routes/TimelineView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
export let load: () => Promise<void>;
export let showLoading = true;
export let createdAtFormat: 'auto' | 'time' = 'auto';
export let full = false;
export let transitionable = true;
let loading = false;
Expand Down Expand Up @@ -97,7 +98,7 @@
class:related={$author?.isNotified(item.event)}
on:mouseup={(e) => viewDetail(e, item.event)}
>
<EventComponent {item} {readonly} {createdAtFormat} />
<EventComponent {item} {readonly} {createdAtFormat} {full} />
</li>
{/if}
{/each}
Expand Down
7 changes: 2 additions & 5 deletions web/src/routes/[note=note]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import Counter from './Counter.svelte';
import ProfileIconList from './ProfileIconList.svelte';
import { chronologicalItem } from '$lib/Constants';
import { setContext, tick } from 'svelte';
import { tick } from 'svelte';
import MuteButton from '../action/MuteButton.svelte';
let focusedElement: HTMLDivElement | undefined;
Expand Down Expand Up @@ -41,10 +41,6 @@
? reactionEvents.map((x) => x.metadata).filter((x): x is Metadata => x !== undefined)
: [];
setContext('timeline-config', {
fullMenu: true
});
afterNavigate(async () => {
console.log('[note page]');
Expand Down Expand Up @@ -164,6 +160,7 @@
readonly={false}
load={async () => console.debug()}
showLoading={false}
full={true}
transitionable={false}
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion web/src/routes/timeline/EventComponent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export let item: Item;
export let readonly: boolean;
export let createdAtFormat: 'auto' | 'time' = 'auto';
export let full = false;
</script>

{#if item.event.kind === Kind.Metadata}
Expand All @@ -27,5 +28,5 @@
{:else if Number(item.event.kind) === 30030}
<CustomEmojiList tags={item.event.tags} />
{:else}
<Note {item} {readonly} {createdAtFormat} />
<Note {item} {readonly} {createdAtFormat} {full} />
{/if}
7 changes: 3 additions & 4 deletions web/src/routes/timeline/Note.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
export let item: Item;
export let readonly: boolean;
export let createdAtFormat: 'auto' | 'time' = 'auto';
export let full = false;
$: metadata = (item as EventItem).metadata;
Expand Down Expand Up @@ -63,8 +64,6 @@
jsonDisplay = !jsonDisplay;
};
const timelineConfig: { fullMenu: boolean } | undefined = getContext('timeline-config');
const fullMenu = timelineConfig?.fullMenu ?? false;
let showMenu = false;
function reply(item: Item) {
Expand Down Expand Up @@ -379,11 +378,11 @@
<span class:hidden={item.event.kind === Kind.EncryptedDirectMessage}>
<EmojiPicker on:pick={({ detail }) => emojiReaction(item.event, detail)} />
</span>
<button class:hidden={fullMenu} on:click={() => (showMenu = !showMenu)}>
<button class:hidden={full} on:click={() => (showMenu = !showMenu)}>
<IconDots size={iconSize} />
</button>
</div>
{#if fullMenu || showMenu}
{#if full || showMenu}
<div class="action-menu">
<!-- instead of margin -->
<button class:hidden={true} on:click={console.debug}>
Expand Down

1 comment on commit bc21ace

@vercel
Copy link

@vercel vercel bot commented on bc21ace Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nostter – ./

nostter-git-main-snowcait.vercel.app
nostter-snowcait.vercel.app
nostter.vercel.app

Please sign in to comment.