Skip to content

Commit 0dbd630

Browse files
authored
Merge branch 'dev' into Refactor/#275-C
2 parents 0b6b285 + ce6b7d6 commit 0dbd630

File tree

19 files changed

+96
-79
lines changed

19 files changed

+96
-79
lines changed

β€Žclient/src/components/ConfMediaBar/ConfMedia/index.tsxβ€Ž renamed to β€Žclient/src/components/MeetingMediaBar/MeetingMedia/index.tsxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface MediaProps {
77
muted: boolean;
88
}
99

10-
function ConfMedia({ stream, muted }: MediaProps) {
10+
function MeetingMedia({ stream, muted }: MediaProps) {
1111
const ref = useRef<HTMLVideoElement>(null);
1212

1313
useEffect(() => {
@@ -18,4 +18,4 @@ function ConfMedia({ stream, muted }: MediaProps) {
1818
return <video className={style.video} ref={ref} muted={muted} autoPlay />;
1919
}
2020

21-
export default memo(ConfMedia);
21+
export default memo(MeetingMedia);

β€Žclient/src/components/ConfMediaBar/index.tsxβ€Ž renamed to β€Žclient/src/components/MeetingMediaBar/index.tsxβ€Ž

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { useEffect, useState } from 'react';
2-
import { useConfMediaStreams } from 'src/hooks/useConfMediaStreams';
2+
import { useMeetingMediaStreams } from 'src/hooks/useMeetingMediaStreams';
33
import useSocketContext from 'src/hooks/useSocketContext';
44

5-
import ConfMedia from './ConfMedia';
5+
import MeetingMedia from './MeetingMedia';
66
import StreamButton from './StreamButton';
77
import style from './style.module.scss';
88

9-
function ConfMediaBar() {
9+
function MeetingMediaBar() {
1010
const { workspaceSocket: socket } = useSocketContext();
11-
const [streams, setMyTrack] = useConfMediaStreams(socket);
11+
const [streams, setMyTrack] = useMeetingMediaStreams(socket);
1212

1313
const [isMicOn, setIsMicOn] = useState(true);
1414
const [isCamOn, setIsCamOn] = useState(true);
@@ -22,11 +22,11 @@ function ConfMediaBar() {
2222
}, [isCamOn]);
2323

2424
return (
25-
<div className={style['conf-bar']}>
25+
<div className={style['meeting-bar']}>
2626
<ul>
2727
{Array.from(streams).map(([id, stream]) => (
2828
<li key={id}>
29-
<ConfMedia
29+
<MeetingMedia
3030
key={id}
3131
stream={stream}
3232
muted={id === 'me' ? true : false}
@@ -50,4 +50,4 @@ function ConfMediaBar() {
5050
);
5151
}
5252

53-
export default ConfMediaBar;
53+
export default MeetingMediaBar;

β€Žclient/src/components/ConfMediaBar/style.module.scssβ€Ž renamed to β€Žclient/src/components/MeetingMediaBar/style.module.scssβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.conf-bar {
1+
.meeting-bar {
22
display: flex;
33
flex-direction: column;
44
align-items: center;

β€Žclient/src/components/Mom/Block/TextBlock.tsxβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,22 @@ function TextBlock({
127127
};
128128
}, []);
129129

130+
useEffect(() => {
131+
updateCaretPosition();
132+
}, [isOpen]);
133+
130134
// λ‘œμ»¬μ—μ„œ μΌμ–΄λ‚˜λŠ” μž‘μ„± - μ‚½μž…κ³Ό μ‚­μ œ μ—°μ‚°
131135
const onInput: React.FormEventHandler = (e) => {
132136
setOffset();
133137

138+
if (!blockRef.current) return;
139+
140+
if (blockRef.current.innerText === '/') {
141+
setIsOpen(true);
142+
} else if (isOpen) {
143+
setIsOpen(false);
144+
}
145+
134146
if (offsetRef.current === null) return;
135147

136148
const event = e.nativeEvent as InputEvent;
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import { memo } from 'react';
22
import SOCKET_MESSAGE from 'src/constants/socket-message';
3-
import { useConfContext } from 'src/hooks/useConfContext';
3+
import { useMeetingContext } from 'src/hooks/useMeetingContext';
44
import useSocketContext from 'src/hooks/useSocketContext';
55
import color from 'styles/color.module.scss';
66

77
import style from './style.module.scss';
88

9-
function ConfButton() {
9+
function MeetingButton() {
1010
const { workspaceSocket: socket } = useSocketContext();
1111

12-
const ConfContext = useConfContext();
13-
const { isStart, setIsStart } = ConfContext;
12+
const MeetingContext = useMeetingContext();
13+
const { isOnGoing, setIsOnGoing } = MeetingContext;
1414

1515
const onClick = () => {
16-
setIsStart(!isStart);
16+
setIsOnGoing(!isOnGoing);
1717
socket.emit(
18-
isStart
18+
isOnGoing
1919
? SOCKET_MESSAGE.WORKSPACE.END_MEETING
2020
: SOCKET_MESSAGE.WORKSPACE.START_MEETING,
2121
);
2222
};
2323

2424
return (
2525
<button
26-
className={style['conf-button']}
26+
className={style['meeting-button']}
2727
onClick={onClick}
28-
style={{ backgroundColor: isStart ? color.red : color.green }}
28+
style={{ backgroundColor: isOnGoing ? color.red : color.green }}
2929
>
30-
{isStart ? 'νšŒμ˜μ’…λ£Œ' : 'νšŒμ˜μ‹œμž‘'}
30+
{isOnGoing ? 'νšŒμ˜μ’…λ£Œ' : 'νšŒμ˜μ‹œμž‘'}
3131
</button>
3232
);
3333
}
3434

35-
export default memo(ConfButton);
35+
export default memo(MeetingButton);

0 commit comments

Comments
Β (0)