Skip to content

Commit

Permalink
🌈 Design: 1:1 λŒ€ν™” λ°© λ§ˆν¬μ—… μΆ”κ°€ (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoRaang committed Dec 8, 2024
1 parent e036de3 commit ffcaa57
Show file tree
Hide file tree
Showing 11 changed files with 244 additions and 24 deletions.
50 changes: 50 additions & 0 deletions src/assets/stylesheets/components/_mainModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,56 @@
}
}

/* μ‚¬μš©μž 1:1 λŒ€ν™” */

#user-chat-room-container {
display: flex;
flex-flow: column nowrap;
height: 100%;
overflow: hidden;
}

#user-chat-room-body {
flex: 1;
overflow-y: scroll;
}

#user-chat-room-controls {
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
inset-block-start: 0;
padding-inline: 0.8rem;
height: 2.4rem;
background-color: rgb(var(--clr-text) / 0.75);
backdrop-filter: blur(1.8rem);
color: rgb(var(--clr-text-on-tint));
z-index: 2;
}

#user-chat-room-stacks {
}

#user-chat-room-input-container {
flex-shrink: 0;
}

.chat-input-wrapper {
display: flex;
gap: 0.4rem;
padding: 0.4rem;
background-color: rgb(var(--clr-white));
background-image: linear-gradient(
rgb(var(--clr-tint-100) / 0.05),
rgb(var(--clr-tint-100) / 0.05)
);
}

#input-chat-text {
flex: 1;
}

/* λ°˜μ‘ν˜• 쿼리 */

@container main-container (max-width: 720px) {
Expand Down
1 change: 0 additions & 1 deletion src/assets/stylesheets/layouts/_commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ a:has(#logo-primary) {

> .nametag-username {
max-width: 8rem;
color: rgb(var(--clr-text));
font-size: var(--fnt-md);
font-weight: 700;
text-overflow: ellipsis;
Expand Down
74 changes: 73 additions & 1 deletion src/assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ a:has(#logo-primary) {
}
.user-nametag > .nametag-username {
max-width: 8rem;
color: rgb(var(--clr-text));
font-size: var(--fnt-md);
font-weight: 700;
text-overflow: ellipsis;
Expand Down Expand Up @@ -3725,6 +3724,50 @@ input[type=checkbox]:is([data-checkbox-type=toggle]):focus + label .switch-rail
font-weight: 700;
}

/* μ‚¬μš©μž 1:1 λŒ€ν™” */
#user-chat-room-container {
display: flex;
flex-flow: column nowrap;
height: 100%;
overflow: hidden;
}

#user-chat-room-body {
flex: 1;
overflow-y: scroll;
}

#user-chat-room-controls {
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
inset-block-start: 0;
padding-inline: 0.8rem;
height: 2.4rem;
background-color: rgb(var(--clr-text)/0.75);
-webkit-backdrop-filter: blur(1.8rem);
backdrop-filter: blur(1.8rem);
color: rgb(var(--clr-text-on-tint));
z-index: 2;
}

#user-chat-room-input-container {
flex-shrink: 0;
}

.chat-input-wrapper {
display: flex;
gap: 0.4rem;
padding: 0.4rem;
background-color: rgb(var(--clr-white));
background-image: linear-gradient(rgb(var(--clr-tint-100)/0.05), rgb(var(--clr-tint-100)/0.05));
}

#input-chat-text {
flex: 1;
}

/* λ°˜μ‘ν˜• 쿼리 */
@container main-container (max-width: 720px) {
#main-modal:has(.cover-signature-image-container) #main-modal-side-menu {
Expand Down Expand Up @@ -5483,4 +5526,33 @@ input[type=checkbox]:is([data-checkbox-type=toggle]):focus + label .switch-rail
margin-top: 0.2rem;
font-size: var(--fnt-xs);
color: rgb(var(--clr-alert));
}

.gallery-swiper.swiper {
width: 100%;
height: 8rem;
}
.gallery-swiper.swiper .swiper-pagination-bullet {
width: 0.5rem;
height: 0.5rem;
background: rgb(var(--clr-white)/0.5);
border: 0.1rem solid rgb(var(--clr-gray));
opacity: 1;
transition: all 0.25s;
}
.gallery-swiper.swiper .swiper-pagination-bullet-active {
border-color: rgb(var(--clr-info));
background: rgb(var(--clr-white));
transform: scale(1.2);
opacity: 1;
}
.gallery-slide {
height: 100%;
}
.gallery-slide img {
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
border-radius: var(--rad-lg);
}
1 change: 1 addition & 0 deletions src/components/MainModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const MainModal = ({ routeName }) => {
'user-reviews': <UserReviews />,
'user-chat-list': <UserChatList />,
'user-chat-room': <UserChatRoom />,
'user-ignores': <>μ°¨λ‹¨ν•œ μœ μ € λͺ©λ‘μž…λ‹ˆλ‹€.</>,

// μž₯μ†Œ κΈ€νƒ€λž˜ 라우트 맀치
'place-info': <PlaceInfo />,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ChatItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dateFormat from '../../utils/dateFormat';
import hourFormat from '../../utils/hourFormat';

const ChatItem = ({
chatFrom = 'my',
chatFrom = 'my', // my, opposite
chatUser = { userID: 0, userImage: null, userName: 'λŒ€ν™” μƒλŒ€' },
chatContent = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas laboriosam, debitis veniam nobis eligendi sequi modi deleniti repellat harum aliquid possimus, repellendus, quisquam voluptatem! Exercitationem voluptas dolorem natus architecto laborum.',
dateTime = '1970-01-01',
Expand Down
12 changes: 11 additions & 1 deletion src/components/common/ChatRoomItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ const ChatRoomItem = ({
chatLatestMessage = 'κ°€μž₯ μ΅œκ·Όμ— 주고받은 λŒ€ν™” λ‚΄μš©',
chatMessageStack = 0,
chatLetestDateTime = '1970-01-01 16:36:45',
onNav,
}) => {
return (
<div className="chat-room-item">
<div
className="chat-room-item"
onClick={() =>
onNav({
label: '1 : 1 λŒ€ν™”',
value: 'user-chat-room',
count: 0,
})
}
>
<UserProfileImage imageSize={1.8} />

<dl className="chat-room-descriptions">
Expand Down
8 changes: 7 additions & 1 deletion src/components/common/MallangItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ const MallangItem = ({

<span>Β·</span>

<p>{mallangObject.petGender}</p>
<p>
{mallangObject.petGender === 'M'
? '수컷'
: mallangObject.petGender === 'F'
? 'μ•”μ»·'
: 'μ•Œ 수 μ—†μŒ'}
</p>
</dd>
</dl>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/layout/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ const Header = ({ setPanel }) => {
<button
type="button"
id="button-user-profile"
title="λŒ€ν‘œ λ§λž‘μ΄ 보기"
onClick={() => setPanel('user-profile')}
>
<UserProfileImage
imageSrc={
'https://picsum.photos/36/36?random=1'
'https://picsum.photos/seed/kim/128/128'
}
imageSize={1.8}
/>
Expand Down
5 changes: 5 additions & 0 deletions src/datas/modalNavObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
"value": "user-chat-list",
"count": null
},
{
"label": "1 : 1 λŒ€ν™” (μž„μ‹œ)",
"value": "user-chat-room",
"count": null
},
{
"label": "차단 μœ μ € λͺ©λ‘ (λ―Έν™•μ •)",
"value": "user-ignores",
Expand Down
12 changes: 0 additions & 12 deletions src/pages/UserChatList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ const UserChatList = () => {
<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />

<ChatRoomItem />
</div>
</>
);
Expand Down
100 changes: 94 additions & 6 deletions src/pages/UserChatRoom.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,102 @@
import { useEffect, useRef } from 'react';
import Remix from '../components/common/Remix';
import NameTag from '../components/common/NameTag';
import ModalDateSeparator from '../components/common/ModalDateSeparator';
import ModalInstruction from '../components/common/ModalInstruction';
import ChatItem from '../components/common/ChatItem';

const UserChatRoom = () => {
const UserChatRoom = ({ sessionID = 0 }) => {
const chatList = useRef();
const chatOppsite = {
userID: 1,
userImage: 'https://picsum.photos/seed/choi/128/128',
userName: 'μ΅œμ‚¬μš©μž',
};

const handleRefreshMessage = () => {
// λŒ€ν™”μ°½μ΄ refresh λ˜μ—ˆμ„ λ•Œ λŒ€ν™”μ°½μ„ 맨 μ•„λž˜λ‘œ 내릴 것
chatList.current.scrollTop = chatList.current.scrollHeight;
};

useEffect(() => {
handleRefreshMessage();
}, []);

return (
<>
<div>
<ChatItem />
<div id="user-chat-room-container">
<div id="user-chat-room-body" ref={chatList}>
<div id="user-chat-room-controls">
<button
type="button"
onClick={() => console.log(sessionID)}
>
<Remix iconName={'arrow-left-s-line'} />
</button>

<NameTag userObject={chatOppsite} />

<button type="button">
<Remix iconName={'close-line'} />
</button>
</div>

<div className="user-common-item-list">
<ModalInstruction
instEmoji="πŸŽ‰"
inst
instHeadline={chatOppsite.userName}
instContent="λ‹˜κ³Όμ˜ λŒ€ν™”κ°€ μ‹œμž‘λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μƒλŒ€λ°©μ˜ κΈˆμ „ μš”κ΅¬ λ“±μœΌλ‘œ μΈν•œ ν”Όν•΄λ₯Ό μž…μ§€ μ•Šλ„λ‘ μ£Όμ˜ν•΄ μ£Όμ„Έμš”."
/>
</div>

<div id="user-chat-room-stacks">
<section id="user-chat-date-block-container">
<article className="user-chat-date-block">
<ModalDateSeparator dateString="2024-01-01" />

<div className="user-common-item-list">
<ChatItem />

<ChatItem
chatFrom={'opposite'}
chatUser={chatOppsite}
/>

<ChatItem />

<ChatItem
chatFrom={'opposite'}
chatUser={chatOppsite}
/>

<ChatItem />

<ChatItem
chatFrom={'opposite'}
chatUser={chatOppsite}
/>
</div>
</article>
</section>
</div>
</div>

<div id="user-chat-room-input-container">
<hr />

<div className="chat-input-wrapper">
<input
type="text"
id="input-chat-text"
placeholder="λŒ€ν™” μž…λ ₯..."
/>

<ChatItem />
<button type="button" className="buttons">
<span>보내기</span>
</button>
</div>
</div>
</>
</div>
);
};

Expand Down

0 comments on commit ffcaa57

Please sign in to comment.