Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebFront
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem
WebFront
Commits
54c2e082
Commit
54c2e082
authored
7 months ago
by
심재엽
Browse files
Options
Downloads
Patches
Plain Diff
design: 메시지에 사용자 이름 표시 관련 디자인 수정
parent
5030d371
No related branches found
No related tags found
1 merge request
!45
design: 전송 버튼 nowrap 추가, 메시지에 사용자 이름 표시 관련 디자인 수정
Pipeline
#11000
failed
7 months ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/ChattingDetail.jsx
+30
-21
30 additions, 21 deletions
src/components/ChattingDetail.jsx
with
30 additions
and
21 deletions
src/components/ChattingDetail.jsx
+
30
−
21
View file @
54c2e082
...
@@ -824,7 +824,10 @@ function ChattingDetail() {
...
@@ -824,7 +824,10 @@ function ChattingDetail() {
<
NoticeContainer
isCollapsed
=
{
isNoticeCollapsed
}
>
<
NoticeContainer
isCollapsed
=
{
isNoticeCollapsed
}
>
{
!
isNoticeCollapsed
?
(
{
!
isNoticeCollapsed
?
(
<>
<>
<
NoticeMessage
isCollapsed
=
{
isNoticeCollapsed
}
onClick
=
{
handleNoticeClick
}
>
<
NoticeMessage
isCollapsed
=
{
isNoticeCollapsed
}
onClick
=
{
handleNoticeClick
}
>
📢
{
notice
?.
message
}
📢
{
notice
?.
message
}
</
NoticeMessage
>
</
NoticeMessage
>
<
NoticeSender
>
{
notice
?.
sender
}
</
NoticeSender
>
<
NoticeSender
>
{
notice
?.
sender
}
</
NoticeSender
>
...
@@ -854,7 +857,7 @@ function ChattingDetail() {
...
@@ -854,7 +857,7 @@ function ChattingDetail() {
{
/* 공지사항 상세 모달 */
}
{
/* 공지사항 상세 모달 */
}
{
isNoticeDetailModalOpen
&&
(
{
isNoticeDetailModalOpen
&&
(
<
ChattingNoticeDetailModal
<
ChattingNoticeDetailModal
initialNotice
=
{
selectedNotice
}
// 처음 표시할 공지사항
initialNotice
=
{
selectedNotice
}
notices
=
{
notices
}
notices
=
{
notices
}
onClose
=
{
closeNoticeDetailModal
}
onClose
=
{
closeNoticeDetailModal
}
onSelectNotice
=
{
(
notice
)
=>
setSelectedNotice
(
notice
)
}
onSelectNotice
=
{
(
notice
)
=>
setSelectedNotice
(
notice
)
}
...
@@ -897,7 +900,9 @@ function ChattingDetail() {
...
@@ -897,7 +900,9 @@ function ChattingDetail() {
theme
=
"purple"
theme
=
"purple"
onClick
=
{
handleArrowDown
}
onClick
=
{
handleArrowDown
}
state
=
{
state
=
{
currentSearchIndex
<
searchResults
.
length
-
1
?
"
default
"
:
"
disable
"
currentSearchIndex
<
searchResults
.
length
-
1
?
"
default
"
:
"
disable
"
}
}
icon
=
{
<
FaArrowDown
/>
}
icon
=
{
<
FaArrowDown
/>
}
/>
/>
...
@@ -926,21 +931,20 @@ function ChattingDetail() {
...
@@ -926,21 +931,20 @@ function ChattingDetail() {
const
prevMessage
=
messages
[
index
-
1
];
const
prevMessage
=
messages
[
index
-
1
];
const
nextMessage
=
messages
[
index
+
1
];
const
nextMessage
=
messages
[
index
+
1
];
// 이전 메시지와 비교
const
sameSenderAsPrev
=
const
sameSenderAsPrev
=
prevMessage
&&
prevMessage
.
sender
===
messageData
.
sender
;
prevMessage
&&
prevMessage
.
sender
===
messageData
.
sender
;
// 다음 메시지와 비교
const
sameSenderAsNext
=
const
sameSenderAsNext
=
nextMessage
&&
nextMessage
.
sender
===
messageData
.
sender
;
nextMessage
&&
nextMessage
.
sender
===
messageData
.
sender
;
// 현재 메시지의 타임스탬프
const
messageTime
=
new
Date
(
messageData
.
timestamp
).
toLocaleTimeString
(
const
messageTime
=
new
Date
(
messageData
.
timestamp
).
toLocaleTimeString
([],
{
[],
{
hour
:
"
2-digit
"
,
hour
:
"
2-digit
"
,
minute
:
"
2-digit
"
,
minute
:
"
2-digit
"
,
});
}
);
// 이전 메시지의 타임스탬프
const
prevMessageTime
=
const
prevMessageTime
=
prevMessage
&&
prevMessage
&&
new
Date
(
prevMessage
.
timestamp
).
toLocaleTimeString
([],
{
new
Date
(
prevMessage
.
timestamp
).
toLocaleTimeString
([],
{
...
@@ -948,11 +952,9 @@ function ChattingDetail() {
...
@@ -948,11 +952,9 @@ function ChattingDetail() {
minute
:
"
2-digit
"
,
minute
:
"
2-digit
"
,
});
});
// 새로운 분 단위 메시지인지 확인
// const isNewMinute = !prevMessage || messageTime !== prevMessageTime;
const
isNewMinute
=
!
prevMessage
||
messageTime
!==
prevMessageTime
;
const
isLastMessageInGroup
=
!
sameSenderAsNext
;
const
isDifferentUserFromPrev
=
!
sameSenderAsPrev
;
// 마지막 메시지인지 확인
const
isLastMessageInGroup
=
!
sameSenderAsNext
||
messageTime
!==
nextMessage
.
timestamp
;
if
(
messageData
.
type
===
"
join
"
||
messageData
.
type
===
"
leave
"
)
{
if
(
messageData
.
type
===
"
join
"
||
messageData
.
type
===
"
leave
"
)
{
return
(
return
(
...
@@ -960,12 +962,11 @@ function ChattingDetail() {
...
@@ -960,12 +962,11 @@ function ChattingDetail() {
);
);
}
}
// 읽지 않은 사람 수
const
unreadCountValue
=
unreadCount
(
messageData
.
_id
);
const
unreadCountValue
=
unreadCount
(
messageData
.
_id
);
return
(
return
(
<
div
key
=
{
index
}
>
<
div
key
=
{
index
}
>
{
is
NewMinute
&&
!
isMine
&&
(
{
is
DifferentUserFromPrev
&&
!
isMine
&&
(
<
strong
<
strong
style
=
{
{
style
=
{
{
display
:
"
block
"
,
display
:
"
block
"
,
...
@@ -977,10 +978,15 @@ function ChattingDetail() {
...
@@ -977,10 +978,15 @@ function ChattingDetail() {
{
messageData
.
sender
}
{
messageData
.
sender
}
</
strong
>
</
strong
>
)
}
)
}
<
MessageContainer
<
MessageContainer
isMine
=
{
isMine
}
isMine
=
{
isMine
}
highlighted
=
{
searchResults
[
currentSearchIndex
]
===
messageData
}
highlighted
=
{
searchResults
[
currentSearchIndex
]
===
messageData
}
ref
=
{
searchResults
[
currentSearchIndex
]
===
messageData
?
highlightedMessageRef
:
null
}
ref
=
{
searchResults
[
currentSearchIndex
]
===
messageData
?
highlightedMessageRef
:
null
}
style
=
{
{
style
=
{
{
marginTop
:
sameSenderAsPrev
?
"
-16px
"
:
"
8px
"
,
marginTop
:
sameSenderAsPrev
?
"
-16px
"
:
"
8px
"
,
justifyContent
:
isMine
?
"
flex-end
"
:
"
flex-start
"
,
justifyContent
:
isMine
?
"
flex-end
"
:
"
flex-start
"
,
...
@@ -988,7 +994,9 @@ function ChattingDetail() {
...
@@ -988,7 +994,9 @@ function ChattingDetail() {
>
>
<
MessageBubble
<
MessageBubble
isMine
=
{
isMine
}
isMine
=
{
isMine
}
highlighted
=
{
searchResults
[
currentSearchIndex
]
===
messageData
}
highlighted
=
{
searchResults
[
currentSearchIndex
]
===
messageData
}
onContextMenu
=
{
(
e
)
=>
handleRightClick
(
e
,
messageData
)
}
onContextMenu
=
{
(
e
)
=>
handleRightClick
(
e
,
messageData
)
}
style
=
{
{
style
=
{
{
textAlign
:
isMine
?
"
right
"
:
"
left
"
,
textAlign
:
isMine
?
"
right
"
:
"
left
"
,
...
@@ -1013,6 +1021,7 @@ function ChattingDetail() {
...
@@ -1013,6 +1021,7 @@ function ChattingDetail() {
{
unreadCountValue
>
0
&&
`
${
unreadCountValue
}
`
}
{
unreadCountValue
>
0
&&
`
${
unreadCountValue
}
`
}
</
span
>
</
span
>
</
div
>
</
div
>
{
isLastMessageInGroup
&&
(
{
isLastMessageInGroup
&&
(
<
MessageTimestamp
isMine
=
{
isMine
}
>
<
MessageTimestamp
isMine
=
{
isMine
}
>
{
messageTime
}
{
messageTime
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment