Skip to content

Commit 3c4f3b7

Browse files
committed
Cleanup
1 parent f49a706 commit 3c4f3b7

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

src/UI/components/pages/ChatRoom.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { twMerge } from 'tailwind-merge';
21
import ChatBox from '../single/chatbox';
32
import UserList from '../single/UserList';
43
import Chat from '../single/chat';
4+
import { cn } from '@/lib/utils';
55

66
export default function ChatRoom(props: any) {
77
return (
88
<div
99
id="big-panel"
10-
className={twMerge(
10+
className={cn(
1111
props.className,
1212
'flex break-normal h-screen',
1313
)}
@@ -17,9 +17,7 @@ export default function ChatRoom(props: any) {
1717
<Chat
1818
/>
1919
</div>
20-
<div className="flex-grow">
21-
<ChatBox />
22-
</div>
20+
<ChatBox />
2321
</div>
2422
<div className="w-64">
2523
<UserList

src/UI/components/single/BigPanel.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import {
22
HTMLAttributes,
33
useContext,
4-
useRef,
5-
useState,
64
} from 'react';
7-
import { twMerge } from 'tailwind-merge';
85

96
import { PS_context } from './PS_context';
107
import UserList from './UserList';
@@ -13,6 +10,7 @@ import ChatBox from './chatbox';
1310
import Chat from './chat';
1411
import Home from '../../Home';
1512
import SettingsPage from '../../SettingsPage';
13+
import { cn } from '@/lib/utils';
1614

1715
export default function BigPanel(props: Readonly<HTMLAttributes<'div'>>) {
1816
const { selectedPage: room, rooms } = useContext(PS_context);
@@ -27,7 +25,7 @@ export default function BigPanel(props: Readonly<HTMLAttributes<'div'>>) {
2725
return <SettingsPage className={props.className} />;
2826
} else {
2927
return (
30-
<div className={twMerge(props.className, 'flex flex-col text-red-400')}>
28+
<div className={cn(props.className, 'flex flex-col text-red-400')}>
3129
Unknown room type: "{roomType}"
3230
</div>
3331
);
@@ -37,7 +35,7 @@ export default function BigPanel(props: Readonly<HTMLAttributes<'div'>>) {
3735
return (
3836
<div
3937
id="big-panel"
40-
className={twMerge(
38+
className={cn(
4139
props.className,
4240
'flex break-normal h-screen',
4341
)}

src/UI/components/single/UserList.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export default function UserList() {
3535

3636
return (
3737
<div className="bg-gray-sidebar-light dark:bg-gray-600 w-full h-full p-2 overflow-y-auto whitespace-nowrap">
38-
<input className="w-full text-sm h-10 py-1 mb-2 px-2 bg-gray-251 placeholder:text-gray-150 dark:bg-gray-700 rounded-md" type="text" placeholder="Search users" value={search} onChange={(e) => setSearch(e.target.value)} />
38+
<input
39+
className="w-full text-sm h-10 py-1 mb-2 px-2 bg-gray-251 placeholder:text-gray-150 dark:bg-gray-700 rounded-md"
40+
type="text"
41+
placeholder="Search users"
42+
value={search}
43+
onChange={(e) => setSearch(e.target.value)}
44+
/>
3945
{staff.length > 0 && <h2 className="text-sm font-bold text-gray-500 dark:text-gray-175 mb-2">Staff</h2>}
4046
{staff.map((user, index) => (
4147
<div key={index}>

src/UI/components/single/chat.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
createRef,
33
Fragment,
4-
MouseEvent,
54
useCallback,
65
useContext,
76
useLayoutEffect,

src/UI/components/single/sidebar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { HTMLAttributes, useContext } from 'react';
22
import { PS_context } from './PS_context';
33
import { RoomListComponent } from '../RoomListComponent';
4-
import { twMerge } from 'tailwind-merge';
54
import {
65
restrictToParentElement,
76
restrictToVerticalAxis,
@@ -23,6 +22,7 @@ import {
2322
verticalListSortingStrategy,
2423
} from '@dnd-kit/sortable';
2524
import SortableItem from '../../../utils/Sortable';
25+
import { cn } from '@/lib/utils';
2626

2727
export default function Sidebar(props: Readonly<HTMLAttributes<'div'>>) {
2828
const { rooms, setRooms } = useContext(PS_context);
@@ -63,7 +63,7 @@ export default function Sidebar(props: Readonly<HTMLAttributes<'div'>>) {
6363
>
6464
<div
6565
id='sidebar'
66-
className={twMerge(
66+
className={cn(
6767
'bg-gray-sidebar-light dark:bg-gray-600 h-screen flex flex-col justify-between',
6868
props.className,
6969
)}

0 commit comments

Comments
 (0)