mirror of
https://github.com/owncast/owncast.git
synced 2024-12-28 03:58:32 +03:00
69f217f758
* feat(mobile): refactor mobile chat into modal - Make page always scrollable - Move mobile chat into a standalone modal * fix(test): split out mobile browser test specs * fix(mobile): force chat button to render on top of footer * fix: some small updates from review * fix: hide/show hide chat menu option based on width * fix: chat button icon getting cut off * chore(tests): add browser tests for mobile chat modal * chore(tests): add story for ChatModal component * fix(test): quiet shellcheck * fix: remove unused import * fix(tests): silence storybook linting warning * fix(ui): reposition chat modal button icon with transform
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import React, { useEffect } from 'react';
|
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
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',
|
|
component: UserDropdown,
|
|
parameters: {},
|
|
} as ComponentMeta<typeof UserDropdown>;
|
|
|
|
// 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,
|
|
}),
|
|
[],
|
|
);
|
|
|
|
return <UserDropdown id="user-menu" {...args} />;
|
|
};
|
|
|
|
const Template: ComponentStory<typeof UserDropdown> = args => (
|
|
<RecoilRoot>
|
|
<Example {...args} />
|
|
</RecoilRoot>
|
|
);
|
|
|
|
export const ChatEnabled = Template.bind({});
|
|
ChatEnabled.args = {
|
|
username: 'test-user',
|
|
};
|