Skip to content

Commit 8216692

Browse files
authored
style: chat issues (#436)
1 parent acbce56 commit 8216692

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

platforms/blabsy/src/components/sidebar/sidebar.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from 'next/link';
2+
import { useRouter } from 'next/router';
23
import { useAuth } from '@lib/context/auth-context';
34
import { useWindow } from '@lib/context/window-context';
45
import { useModal } from '@lib/hooks/useModal';
@@ -61,10 +62,12 @@ const navLinks: Readonly<NavLink[]> = [
6162
export function Sidebar(): JSX.Element {
6263
const { user } = useAuth();
6364
const { isMobile } = useWindow();
65+
const { pathname } = useRouter();
6466

6567
const { open, openModal, closeModal } = useModal();
6668

6769
const username = user?.username as string;
70+
const isOnChatPage = pathname.startsWith('/chat');
6871

6972
return (
7073
<header
@@ -113,18 +116,20 @@ export function Sidebar(): JSX.Element {
113116
)}
114117
{!isMobile && <MoreSettings />}
115118
</nav>
116-
<Button
117-
className='accent-tab absolute right-4 -translate-y-[72px] bg-main-accent text-lg font-bold text-white
118-
outline-none transition hover:brightness-90 active:brightness-75 xs:static xs:translate-y-0
119-
xs:hover:bg-main-accent/90 xs:active:bg-main-accent/75 xl:w-11/12'
120-
onClick={openModal}
121-
>
122-
<CustomIcon
123-
className='block h-6 w-6 xl:hidden'
124-
iconName='FeatherIcon'
125-
/>
126-
<p className='hidden xl:block'>Blab</p>
127-
</Button>
119+
{!(isMobile && isOnChatPage) && (
120+
<Button
121+
className='accent-tab absolute right-4 -translate-y-[72px] bg-main-accent text-lg font-bold text-white
122+
outline-none transition hover:brightness-90 active:brightness-75 xs:static xs:translate-y-0
123+
xs:hover:bg-main-accent/90 xs:active:bg-main-accent/75 xl:w-11/12'
124+
onClick={openModal}
125+
>
126+
<CustomIcon
127+
className='block h-6 w-6 xl:hidden'
128+
iconName='FeatherIcon'
129+
/>
130+
<p className='hidden xl:block'>Blab</p>
131+
</Button>
132+
)}
128133
</section>
129134
{!isMobile && <SidebarProfile />}
130135
</div>

platforms/pictique/src/lib/fragments/ChatMessage/ChatMessage.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
</div>
7575

7676
<div class={cn(`max-w-[50%] ${isHeadNeeded ? 'mt-4' : 'mt-0'}`)}>
77-
{#if isHeadNeeded && !isOwn && sender}
78-
<p class="text-black-400 mb-1 px-1 text-xs font-medium">
77+
{#if isHeadNeeded && sender}
78+
<p class="text-black-800 mb-1 px-1 text-xs font-semibold">
7979
{sender.name}
8080
</p>
8181
{/if}

platforms/pictique/src/routes/(protected)/messages/[id]/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
};
9797
}
9898
99-
// Handle regular user messages
100-
const sender = m.sender as Record<string, string>;
101-
const isOwn = sender.id !== userId;
99+
// Handle regular user messages
100+
const sender = m.sender as Record<string, string>;
101+
const isOwn = sender.id !== userId;
102102
103-
console.log('Message sender ID:', sender.id, 'User ID:', userId, 'IsOwn:', isOwn);
103+
console.log('Message sender ID:', sender.id, 'User ID:', userId, 'IsOwn:', isOwn);
104104
105105
return {
106106
id: m.id,

0 commit comments

Comments
 (0)