Skip to content

Commit a2cac55

Browse files
committed
feat: 리스트 페이지 제작
1 parent 66935d8 commit a2cac55

File tree

5 files changed

+78
-25
lines changed

5 files changed

+78
-25
lines changed

src/App.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
@media all and (max-width: 390px) {
1212
body {
1313
width: 100%;
14-
height: 100%;
15-
min-height: 100vh;
14+
height: calc(100vh - env(safe-area-inset-bottom));
1615
background-color: #fff;
16+
overflow-y: hidden;
1717
--v-scrollbar-offset: 0 !important;
1818
-webkit-user-select: none; /* Safari */
1919
-moz-user-select: none; /* Firefox */

src/components/FourthModal.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.Modal {
22
width: 100%;
3-
height: auto;
3+
height: 170px;
44
position: fixed;
55
bottom: 0;
6-
bottom: env(safe-area-inset-bottom); /* 아이폰X 이상의 모델에서 하단에 위치하도록 설정 */
6+
/*bottom: env(safe-area-inset-bottom); !* 아이폰X 이상의 모델에서 하단에 위치하도록 설정 *!*/
77
background: #fff; /* 모달의 배경색 */
88
z-index: 1000;
99
transition: transform 0.3s ease; /* 모달이 나타나거나 사라질 때 부드럽게 나타나도록 설정 */
@@ -27,16 +27,16 @@
2727

2828
.button-container {
2929
align-items: center;
30+
padding-top: 20px;
3031
}
3132

3233
.modal-button {
3334
background-color: #EAE3FC;
34-
width: 173px;
35+
width: 168px;
3536
height: 44px;
3637
color: black;
3738
border: none;
3839
padding: 10px 20px;
39-
margin: 10px;
4040
border-radius: 20px;
4141
font-size: 16px;
4242
cursor: pointer;

src/css/chat.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,32 @@
3131
.transparent-div {
3232
visibility: hidden; /* 투명 div를 보이지 않게 함 */
3333
}
34+
35+
.text-input-form {
36+
position: fixed;
37+
bottom: 0;
38+
left: 0;
39+
width: 100%;
40+
display: flex;
41+
justify-content: space-between;
42+
background-color: #f8f8f8;
43+
padding: 10px;
44+
box-sizing: border-box;
45+
}
46+
47+
.text-input {
48+
flex-grow: 1;
49+
margin-right: 10px;
50+
padding: 10px;
51+
border-radius: 20px;
52+
border: 1px solid #ddd;
53+
}
54+
55+
.submit-button {
56+
padding: 10px 20px;
57+
border-radius: 20px;
58+
border: none;
59+
background-color: #6750A4;
60+
color: #FFFFFF;
61+
cursor: pointer;
62+
}

src/pages/Chat.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import SecondModal from '../components/SecondModal';
66
import ThirdModal from '../components/ThirdModal';
77
import FourthModal from '../components/FourthModal';
88
import FifthModal from '../components/FifthModal';
9+
910
import '../css/chat.css';
1011
import ChatProfile from '../assets/message-circle.svg';
1112

@@ -106,6 +107,18 @@ const Chat = () => {
106107
const [fifthEffectFinished, setFifthEffectFinished] = useState(false);
107108
const [finalEffectFinished, setFinalEffectFinished] = useState(false);
108109

110+
const [inputValue, setInputValue] = useState('');
111+
112+
const handleChange = (e) => {
113+
setInputValue(e.target.value);
114+
};
115+
116+
// const handleSubmit = (e) => {
117+
// e.preventDefault();
118+
// onSubmit(inputValue);
119+
// setInputValue(''); // 입력 후 입력창 초기화
120+
// };
121+
109122

110123
useEffect(() => {
111124
const storedNickname = localStorage.getItem('nickname');
@@ -114,7 +127,10 @@ const Chat = () => {
114127
}
115128
const chatbox = document.querySelector('.message-container'); // chatbox 클래스를 가진 요소 선택
116129
if (chatbox) {
117-
chatbox.scrollTop = chatbox.scrollHeight; // 스크롤을 맨 아래로 이동
130+
setTimeout(() => {
131+
window.scrollTo(0, document.body.scrollHeight);
132+
}
133+
, 1000);
118134
}
119135

120136
}, [messages]);
@@ -456,6 +472,12 @@ return (
456472
</div>
457473
))}
458474
</div>
475+
{finalEffectFinished && <input
476+
type="text"
477+
value={inputValue}
478+
className="text-input"
479+
placeholder="여기에 입력하세요..."
480+
/> && <button type="submit" className="submit-button">전송</button> }
459481

460482
</StyledChat>
461483
</ChatContainer>

src/pages/OnBoarding.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import styled from 'styled-components';
44
import logo from '../assets/logo.svg';
55

66
const Container = styled.div`
7-
position: relative;
87
display: flex;
9-
flex-direction: column;
10-
justify-content: center;
118
align-items: center;
129
width: 100%;
13-
height: 100vh;
10+
height: calc(100vh - env(safe-area-inset-bottom));
1411
box-sizing: border-box;
12+
flex-direction: column;
13+
justify-content: flex-end;
14+
1515
background-color: #a883d8;
1616
padding-bottom: 20px;
17+
padding-bottom: calc(20px + env(safe-area-inset-bottom));
18+
overflow: hidden;
1719
`;
1820

1921
const LogoImage = styled.img`
@@ -26,22 +28,22 @@ const LogoImage = styled.img`
2628
`;
2729

2830
const Button = styled.button`
29-
margin-top: auto;
30-
background-color: #ffffff;
31-
width: 80%;
32-
height: 45px;
33-
color: #864ae1;
34-
font-family: 'Pretendard', sans-serif;
35-
font-weight: 600;
36-
font-size: 14px;
37-
border: none;
38-
border-radius: 16px;
39-
cursor: pointer;
40-
padding-bottom: 0;
41-
padding-bottom: env(safe-area-inset-bottom);
42-
31+
background-color: #ffffff;
32+
width: 80%;
33+
height: 45px;
34+
color: #864ae1;
35+
font-family: 'Pretendard', sans-serif;
36+
font-weight: 600;
37+
font-size: 14px;
38+
border: none;
39+
border-radius: 16px;
40+
cursor: pointer;
41+
bottom: 0;
42+
bottom: env(safe-area-inset-bottom);
43+
//bottom: env(safe-area-inset-bottom); /* 아이폰x 이상의 모델에서는 화면 하단에 위치 */
4344
`;
4445

46+
4547
const OnBoarding = () => {
4648
const navigator = useNavigate();
4749

0 commit comments

Comments
 (0)