Skip to content

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

Fix user settings dropdown story not rendering. Closes #2350

Gabe Kangase96a2ad4b812
diff --git a/web/components/common/UserDropdown/UserDropdown.stories.tsx b/web/components/common/UserDropdown/UserDropdown.stories.tsx
index f4543d798c..df714363c0 100644
--- a/web/components/common/UserDropdown/UserDropdown.stories.tsx
+++ b/web/components/common/UserDropdown/UserDropdown.stories.tsx
@@ -1,7 +1,9 @@
-import React from 'react';
+import React, { useEffect } from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
-import { RecoilRoot } from 'recoil';
+import { RecoilRoot, useSetRecoilState } from 'recoil';
import { UserDropdown } from './UserDropdown';
+import { CurrentUser } from '../../../interfaces/current-user';
+import { currentUserAtom } from '../../stores/ClientConfigStore';
export default {
title: 'owncast/Components/User settings menu',
@@ -10,20 +12,30 @@ export default {
} as ComponentMeta<typeof UserDropdown>;
// This component uses Recoil internally so wrap it in a RecoilRoot.
-const Example = args => (
+const Example = args => {
+ const setCurrentUser = useSetRecoilState<CurrentUser>(currentUserAtom);
+
+ useEffect(
+ () =>
+ setCurrentUser({
+ id: '1',
+ displayName: 'Test User',
+ displayColor: 3,
+ isModerator: false,
+ }),
+ [],
+ );
+
+ return <UserDropdown {...args} />;
+};
+
+const Template: ComponentStory<typeof UserDropdown> = args => (
<RecoilRoot>
- <UserDropdown {...args} />
+ <Example {...args} />
</RecoilRoot>
);
-const Template: ComponentStory<typeof UserDropdown> = args => <Example {...args} />;
-
export const ChatEnabled = Template.bind({});
ChatEnabled.args = {
username: 'test-user',
};
-
-export const ChatDisabled = Template.bind({});
-ChatDisabled.args = {
- username: 'test-user',
-};