style(chat): update chat button to match nav button style

Changed JKSessionChatButton from bare icon to proper Button component:
- Uses Button from reactstrap with btn-custom-outline class
- Matches other nav buttons (Invite, Volume, Video, etc.)
- Icon sized at 16x16px with 0.2rem right margin
- "Chat" text label added
- Unread badge repositioned for button layout
- Reduced opacity when window is open (visual feedback)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nuwan 2026-02-06 18:23:59 +05:30
parent 8cf0b661a7
commit 85fd4916e2
1 changed files with 19 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { Button } from 'reactstrap';
import { import {
openChatWindow, openChatWindow,
setActiveChannel, setActiveChannel,
@ -38,29 +39,30 @@ const JKSessionChatButton = ({ sessionId }) => {
return ( return (
<div style={{ position: 'relative', display: 'inline-block' }}> <div style={{ position: 'relative', display: 'inline-block' }}>
<img <Button
src={chatIcon} className='btn-custom-outline'
alt="Chat" outline
size="md"
onClick={handleClick} onClick={handleClick}
role="button"
tabIndex={0}
aria-label={`Open chat${unreadCount > 0 ? ` (${unreadCount} unread)` : ''}`} aria-label={`Open chat${unreadCount > 0 ? ` (${unreadCount} unread)` : ''}`}
aria-pressed={isWindowOpen} aria-pressed={isWindowOpen}
style={{
cursor: 'pointer',
width: '24px',
height: '24px',
opacity: isWindowOpen ? 0.6 : 1
}}
title="Open session chat" title="Open session chat"
/> style={{ opacity: isWindowOpen ? 0.6 : 1 }}
>
<img
src={chatIcon}
alt="Chat"
style={{ width: '16px', height: '16px', marginRight: '0.2rem' }}
/>
Chat
</Button>
{unreadCount > 0 && ( {unreadCount > 0 && (
<div <div
style={{ style={{
position: 'absolute', position: 'absolute',
top: '-6px', top: '-8px',
right: '-6px', right: '-8px',
backgroundColor: '#dc3545', // Bootstrap danger red backgroundColor: '#dc3545',
color: 'white', color: 'white',
borderRadius: '10px', borderRadius: '10px',
padding: '2px 6px', padding: '2px 6px',
@ -69,7 +71,8 @@ const JKSessionChatButton = ({ sessionId }) => {
lineHeight: '1', lineHeight: '1',
minWidth: '18px', minWidth: '18px',
textAlign: 'center', textAlign: 'center',
boxShadow: '0 1px 3px rgba(0,0,0,0.3)' boxShadow: '0 1px 3px rgba(0,0,0,0.3)',
zIndex: 1
}} }}
> >
{getBadgeText()} {getBadgeText()}