Skip to content

Commit 6521b24

Browse files
Style Changes (#13)
Co-authored-by: Jeongyeon Lee <jylee05@snu.ac.kr>
1 parent 7b108ea commit 6521b24

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
65
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
6+
<title>SNUXI</title>
87
</head>
98
<body>
109
<div id="root"></div>

src/components/BottomNav/BottomNav.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
.bottom-nav {
2-
position: fixed;
3-
bottom: 0;
4-
left: 0;
5-
right: 0;
62
display: flex;
73
justify-content: space-around;
84
align-items: center;

src/pages/CreateRoom/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ const CreateRoom = () => {
1010
const [end, setEnd] = useState('');
1111
const [dateTime, setDateTime] = useState('');
1212
const [roomName, setRoomName] = useState('');
13-
const [maxParticipants, setMaxParticipants] = useState(1);
13+
const [minParticipants, setMinParticipants] = useState(2);
1414

1515
const handleParticipantChange = (amount: number) => {
16-
setMaxParticipants((prev) => {
16+
setMinParticipants((prev) => {
1717
const newValue = prev + amount;
18-
if (newValue >= 1 && newValue <= 4) {
18+
if (newValue >= 2 && newValue <= 4) {
1919
return newValue;
2020
}
2121
return prev;
@@ -30,9 +30,11 @@ const CreateRoom = () => {
3030

3131
// check for development
3232
if (!userState.isLoggedIn) {
33-
// placeholder email
34-
// alert("로그인이 필요합니다.");
35-
// return;
33+
alert('로그인이 필요합니다.');
34+
window.location.href = '/login';
35+
return;
36+
}
37+
if (import.meta.env.DEV) {
3638
userState.email = 'dev@snu.ac.kr';
3739
}
3840

@@ -42,7 +44,7 @@ const CreateRoom = () => {
4244
from: start,
4345
to: end,
4446
time: dateTime,
45-
maxHeadcount: maxParticipants,
47+
minHeadcount: minParticipants,
4648
user: userState.email, // Send user's email
4749
});
4850

@@ -112,10 +114,10 @@ const CreateRoom = () => {
112114

113115
<div className="card">
114116
<div className="input-group">
115-
<label>최대 인원</label>
117+
<label>최소 인원</label>
116118
<div className="participant-control">
117119
<button onClick={() => handleParticipantChange(-1)}>-</button>
118-
<span>{maxParticipants}</span>
120+
<span>{minParticipants}</span>
119121
<button onClick={() => handleParticipantChange(1)}>+</button>
120122
</div>
121123
</div>

src/router/MainLayout.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.main-layout {
2+
display: flex;
3+
flex-direction: column;
4+
height: 100vh;
5+
}
6+
7+
.main-content {
8+
flex-grow: 1;
9+
overflow-y: auto;
10+
}

src/router/Router.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ import Login from '../pages/Login';
55
import MyChat from '../pages/MyChat';
66
import MyPage from '../pages/MyPage/MyPage';
77
import RoomSearch from '../pages/SearchRoom/RoomSearch';
8+
import './MainLayout.css';
89

910
const MainLayout = () => {
1011
return (
11-
<>
12-
<Outlet />
12+
<div className="main-layout">
13+
<div className="main-content">
14+
<Outlet />
15+
</div>
1316
<BottomNav />
14-
</>
17+
</div>
1518
);
1619
};
1720

@@ -25,7 +28,7 @@ const Router = () => {
2528
<Route path="/create-room" element={<CreateRoom />} />
2629
<Route path="/my-chat" element={<MyChat />} />
2730
<Route path="/my-page" element={<MyPage />} />
28-
<Route path="/" element={<MyPage />} />
31+
<Route path="/" element={<RoomSearch />} />
2932
</Route>
3033
</Routes>
3134
</BrowserRouter>

0 commit comments

Comments
 (0)