Skip to content

Commit 68713f8

Browse files
author
linzhengyu
committed
refactor: remove live chat mode and related components
1 parent 4e36141 commit 68713f8

File tree

6 files changed

+8
-1043
lines changed

6 files changed

+8
-1043
lines changed

app/components/layout/ChatModeMenu.tsx

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,27 @@ interface ChatModeMenuProps {
1010
/**
1111
* Current chat mode.
1212
*/
13-
chatMode: 'text' | 'voice' | 'live'
13+
chatMode: 'text' | 'voice'
1414
/**
1515
* Callback function called when a chat mode is selected.
1616
* @param mode The selected chat mode.
1717
*/
18-
onModeSelect: (mode: 'text' | 'voice' | 'live') => void
19-
/**
20-
* Whether live chat mode is enabled.
21-
* @default true
22-
*/
23-
enableLiveChat?: boolean
18+
onModeSelect: (mode: 'text' | 'voice' ) => void
2419
}
2520

2621
/**
2722
* ChatModeMenu
2823
*
29-
* A menu component for selecting chat modes (Text Chat, Voice Chat, Live Stream).
24+
* A menu component for selecting chat modes (Text Chat, Voice Chat).
3025
* Displays a button that opens a popup menu with mode options.
3126
*
3227
* @param chatMode Current chat mode.
3328
* @param onModeSelect Callback function called when a mode is selected.
34-
* @param enableLiveChat Whether live chat mode is enabled. Defaults to true.
3529
* @returns JSX.Element The chat mode menu UI component.
3630
*/
3731
export default function ChatModeMenu({
3832
chatMode,
39-
onModeSelect,
40-
enableLiveChat = true,
33+
onModeSelect
4134
}: ChatModeMenuProps) {
4235
const { t } = useTranslation('fronted')
4336
const [showChatModeMenu, setShowChatModeMenu] = useState(false)
@@ -79,8 +72,6 @@ export default function ChatModeMenu({
7972
return t('chat.textChat')
8073
case 'voice':
8174
return t('chat.voiceChat')
82-
case 'live':
83-
return t('chat.liveStream')
8475
default:
8576
return t('chat.voiceChat')
8677
}
@@ -94,7 +85,7 @@ export default function ChatModeMenu({
9485
* @param mode The selected chat mode.
9586
* @returns void
9687
*/
97-
const handleChatModeSelect = (mode: 'text' | 'voice' | 'live') => {
88+
const handleChatModeSelect = (mode: 'text' | 'voice' ) => {
9889
onModeSelect(mode)
9990
setShowChatModeMenu(false)
10091
}
@@ -124,22 +115,12 @@ export default function ChatModeMenu({
124115
>
125116
{t('chat.textChat')}
126117
</button>
127-
128118
<button
129119
className={`chat-mode-menu-item ${chatMode === 'voice' ? 'active' : ''}`}
130120
onClick={() => handleChatModeSelect('voice')}
131121
>
132122
{t('chat.voiceChat')}
133123
</button>
134-
135-
{enableLiveChat && (
136-
<button
137-
className={`chat-mode-menu-item ${chatMode === 'live' ? 'active' : ''}`}
138-
onClick={() => handleChatModeSelect('live')}
139-
>
140-
{t('chat.liveStream')}
141-
</button>
142-
)}
143124
</div>
144125
)}
145126
</div>

0 commit comments

Comments
 (0)