fix: improve small screen support

This commit is contained in:
Xylight committed 2024-06-28 11:44:24 -07:00
1 parent ed33e9d59b
commit ae1a3bffc0
9 files changed
+76 -58

No files matched your search

@@ -13,7 +13,7 @@
<a
{...$$restProps}
class="items-center flex flex-row gap-2 hover:underline flex-shrink-0 {$$props.class ||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {$$props.class ||
''}"
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
>
@@ -27,18 +27,25 @@
{/if}
{#if name}
<span class="flex gap-0 items-center">
<span class="flex gap-0 items-center max-w-full min-w-0 flex-shrink">
<span class="font-medium">{community.title}</span>
{#if showInstance}
<span class="font-medium">{community.title}</span>
<span
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ||
''}"
class="text-slate-500 dark:text-zinc-500 font-normal
instance-text flex-shrink {$$props.instanceClass || ''}"
>
@{new URL(community.actor_id).hostname}
</span>
{:else}
{community.title}
{/if}
</span>
{/if}
</a>
<style>
.instance-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
</style>
+22 -22
View File
@@ -124,30 +124,30 @@
combinedPosts = combinedPosts.toSpliced(index, 1)
}}
>
<button
slot="badges"
class:hidden={!post.withCrossposts}
on:click={() => {
if (viewPost == post.post.id) viewPost = -1
else viewPost = post.post.id
}}
>
<svelte:fragment slot="badges">
{#if post.withCrossposts}
<Badge
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
color="gray-subtle"
<button
on:click={() => {
if (viewPost == post.post.id) viewPost = -1
else viewPost = post.post.id
}}
>
{#if viewPost == post.post.id}
<Icon mini src={Minus} size="14" />
{:else}
<Icon mini src={Plus} size="14" />
{/if}
{post.crossposts.length} crosspost{post.crossposts.length == 1
? ''
: 's'}
</Badge>
{/if}
</button>
<Badge
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
color="gray-subtle"
>
{#if viewPost == post.post.id}
<Icon mini src={Minus} size="14" />
{:else}
<Icon mini src={Plus} size="14" />
{/if}
{post.crossposts.length} crosspost{post.crossposts.length ==
1
? ''
: 's'}
</Badge>
</button>{/if}
</svelte:fragment>
</Post>
{#if post.withCrossposts && viewPost == post.post.id}
<div
+14 -6
View File
@@ -60,13 +60,14 @@
subscribed =
subscribed == 'NotSubscribed' ? 'Subscribed' : 'NotSubscribed'
}}
class="relative cursor-pointer pr-2 row-span-2"
class="relative cursor-pointer pr-2 row-span-2 flex-shrink-0"
>
<Avatar
url={community.icon}
width={28}
alt={community.name}
style="grid-area: avatar; height: 100%;"
class="flex-shrink-0"
/>
{#if subscribed != undefined && $profile?.jwt}
<div
@@ -87,10 +88,14 @@
</Subscribe>
{/if}
{#if community}
<CommunityLink {community} style="grid-area: community;" />
<CommunityLink
{community}
style="grid-area: community;"
class="flex-shrink"
/>
{/if}
<span
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 flex-wrap items-center"
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 items-center"
style="grid-area: stats;"
>
{#if user}
@@ -106,12 +111,11 @@
</UserLink>
{/if}
{#if published}
<RelativeDate date={published} />
<RelativeDate date={published} class="flex-shrink-0" />
{/if}
</span>
<div
class="flex flex-row items-center self-center flex-wrap gap-2 [&>*]:flex-shrink-0
{Object.values(badges).some(Boolean) ? 'pt-2' : ''}"
class="flex flex-row items-center self-center flex-wrap gap-2 [&>*]:flex-shrink-0 badges"
style="grid-area: badges;"
>
{#if badges.nsfw}
@@ -192,4 +196,8 @@
grid-template-rows: auto auto auto;
grid-template-columns: auto 1fr;
}
.badges:not(:empty) {
padding-top: 0.5rem;
}
</style>
+21 -4
View File
@@ -16,20 +16,28 @@
</script>
<a
class="items-center inline-flex flex-row gap-1 hover:underline {$$props.class ??
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {$$props.class ??
''}"
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
>
{#if avatar}
<Avatar url={user.avatar} alt={user.name} width={avatarSize} />
<Avatar
url={user.avatar}
alt={user.name}
width={avatarSize}
class="flex-shrink-0"
/>
{/if}
<span class="flex flex-wrap gap-0 items-center" class:ml-0.5={avatar}>
<span
class="flex gap-0 items-center flex-shrink max-w-full min-w-0"
class:ml-0.5={avatar}
>
<span class:font-medium={showInstance}>
{$userSettings.displayNames ? user.display_name || user.name : user.name}
</span>
{#if showInstance}
<span
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ??
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {$$props.instanceClass ??
''}"
>
@{new URL(user.actor_id).hostname}
@@ -48,3 +56,12 @@
<slot name="badges" />
{/if}
</a>
<style>
.instance-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
</style>
+3 -1
View File
@@ -100,7 +100,9 @@
</SearchBar>
</div>
{/if}
<div class="flex flex-row gap-2 py-2 px-2 items-center w-full">
<div
class="flex flex-row gap-2 py-2 px-2 items-center w-full rounded-full overflow-auto"
>
<div class="ml-auto" />
{#if $profile?.user && isAdmin($profile.user)}
<NavButton