Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Display keyboard shortcut in UserDropdown chat menu items (#4414)

Copilot4b41564312a2
diff --git a/web/components/common/UserDropdown/UserDropdown.stories.tsx b/web/components/common/UserDropdown/UserDropdown.stories.tsx
index 6c907f295c..dfd282377b 100644
--- a/web/components/common/UserDropdown/UserDropdown.stories.tsx
+++ b/web/components/common/UserDropdown/UserDropdown.stories.tsx
@@ -3,7 +3,12 @@ import { StoryFn, Meta } from '@storybook/react';
import { RecoilRoot, useSetRecoilState } from 'recoil';
import { UserDropdown } from './UserDropdown';
import { CurrentUser } from '../../../interfaces/current-user';
-import { currentUserAtom } from '../../stores/ClientConfigStore';
+import {
+ currentUserAtom,
+ appStateAtom,
+ chatStateAtom,
+ ChatState,
+} from '../../stores/ClientConfigStore';
const meta = {
title: 'owncast/Components/User settings menu',
@@ -16,17 +21,26 @@ export default meta;
// This component uses Recoil internally so wrap it in a RecoilRoot.
const Example = args => {
const setCurrentUser = useSetRecoilState<CurrentUser>(currentUserAtom);
-
- useEffect(
- () =>
- setCurrentUser({
- id: '1',
- displayName: 'Test User',
- displayColor: 3,
- isModerator: false,
- }),
- [],
- );
+ const setAppState = useSetRecoilState(appStateAtom);
+ const setChatState = useSetRecoilState(chatStateAtom);
+
+ useEffect(() => {
+ setCurrentUser({
+ id: '1',
+ displayName: 'Test User',
+ displayColor: 3,
+ isModerator: false,
+ });
+
+ setAppState({
+ chatAvailable: true,
+ chatLoading: false,
+ videoAvailable: true,
+ appLoading: false,
+ });
+
+ setChatState(ChatState.VISIBLE);
+ }, []);
return <UserDropdown id="user-menu" {...args} />;
};
diff --git a/web/components/common/UserDropdown/UserDropdown.tsx b/web/components/common/UserDropdown/UserDropdown.tsx
index ff05aa1060..4fe2270787 100644
--- a/web/components/common/UserDropdown/UserDropdown.tsx
+++ b/web/components/common/UserDropdown/UserDropdown.tsx
@@ -166,7 +166,7 @@ export const UserDropdown: FC<UserDropdownProps> = ({
'aria-expanded': chatState === ChatState.VISIBLE,
className: styles.chatToggle, // TODO why do we hide this button on tablets?
icon: <MessageOutlined />,
- label: chatState === ChatState.VISIBLE ? 'Hide Chat' : 'Show Chat',
+ label: chatState === ChatState.VISIBLE ? 'Hide Chat (c)' : 'Show Chat (c)',
onClick: toggleChatVisibility,
} as MenuProps['items'][0]);
if (canShowChatPopup)