reafctor: normalize component formatting (#2082)
* refactor: move/rename BanUserButton file * refactor: move/rename Chart file * refactor: update generic component filenames to PascalCase * refactor: update config component filenames to PascalCase * refactor: update AdminLayout component filename to PascalCase * refactor: update/move VideoJS component * chore(eslint): disable bad react/require-default-props rule * refactor: normalize ActionButton component * refactor: normalize ActionButtonRow component * refactor: normalize FollowButton component * refactor: normalize NotifyButton component * refactor: normalize ChatActionMessage component * refactor: normalize ChatContainer component * refactor: normalize ChatJoinMessage component * refactor: normalize ChatModerationActionMenu component * refactor: normalize ChatModerationDetailsModal component * refactor: normalize ChatModeratorNotification component * refactor: normalize ChatSocialMessage component * refactor: normalize ChatSystemMessage component * refactor: normalize ChatTextField component * refactor: normalize ChatUserBadge component * refactor: normalize ChatUserMessage component * refactor: normalize ContentHeader component * refactor: normalize OwncastLogo component * refactor: normalize UserDropdown component * chore(eslint): modify react/function-component-definition rule * refactor: normalize CodecSelector component * refactor: update a bunch of functional components using eslint * refactor: update a bunch of functional components using eslint, pt2 * refactor: update a bunch of functional components using eslint, pt3 * refactor: replace all component->component default imports with named imports * refactor: replace all component-stories->component default imports with named imports * refactor: remove default exports from most components * chore(eslint): add eslint config files for the components and pages dirs * fix: use-before-define error in ChatContainer * Fix ChatContainer import * Only process .tsx files in Next builds Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
import ChatModerationDetailsModal from './ChatModerationDetailsModal';
|
||||
import { ChatModerationDetailsModal } from './ChatModerationDetailsModal';
|
||||
|
||||
const mocks = {
|
||||
mocks: [
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
} as ComponentMeta<typeof ChatModerationDetailsModal>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const Template: ComponentStory<typeof ChatModerationDetailsModal> = args => (
|
||||
const Template: ComponentStory<typeof ChatModerationDetailsModal> = () => (
|
||||
<RecoilRoot>
|
||||
<ChatModerationDetailsModal userId="testuser123" accessToken="fakeaccesstoken4839" />
|
||||
</RecoilRoot>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Button, Col, Row, Spin } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import ChatModeration from '../../../services/moderation-service';
|
||||
import s from './ChatModerationDetailsModal.module.scss';
|
||||
import styles from './ChatModerationDetailsModal.module.scss';
|
||||
|
||||
interface Props {
|
||||
export type ChatModerationDetailsModalProps = {
|
||||
userId: string;
|
||||
accessToken: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface UserDetails {
|
||||
user: User;
|
||||
@@ -91,7 +91,7 @@ const UserColorBlock = ({ color }) => {
|
||||
<Row justify="space-around" align="middle">
|
||||
<Col span={12}>Color</Col>
|
||||
<Col span={12}>
|
||||
<div className={s.colorBlock} style={{ backgroundColor: bg }}>
|
||||
<div className={styles.colorBlock} style={{ backgroundColor: bg }}>
|
||||
{color}
|
||||
</div>
|
||||
</Col>
|
||||
@@ -99,8 +99,10 @@ const UserColorBlock = ({ color }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default function ChatModerationDetailsModal(props: Props) {
|
||||
const { userId, accessToken } = props;
|
||||
export const ChatModerationDetailsModal: FC<ChatModerationDetailsModalProps> = ({
|
||||
userId,
|
||||
accessToken,
|
||||
}) => {
|
||||
const [userDetails, setUserDetails] = useState<UserDetails | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
@@ -127,7 +129,7 @@ export default function ChatModerationDetailsModal(props: Props) {
|
||||
user;
|
||||
|
||||
return (
|
||||
<div className={s.modalContainer}>
|
||||
<div className={styles.modalContainer}>
|
||||
<Spin spinning={loading}>
|
||||
<h1>{displayName}</h1>
|
||||
<Row justify="space-around" align="middle">
|
||||
@@ -161,7 +163,7 @@ export default function ChatModerationDetailsModal(props: Props) {
|
||||
<div>
|
||||
<h1>Recent Chat Messages</h1>
|
||||
|
||||
<div className={s.chatHistory}>
|
||||
<div className={styles.chatHistory}>
|
||||
{messages.map(message => (
|
||||
<ChatMessageRow
|
||||
key={message.id}
|
||||
@@ -176,4 +178,4 @@ export default function ChatModerationDetailsModal(props: Props) {
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user