Skip to content

Commit 13d6ce9

Browse files
authored
Merge pull request #11 from eunhye-ahn/frontend/group-vote-page
[FE] 댓글 : 작성, 조회, 삭제 기능 구현
2 parents 74c13ef + 7df452e commit 13d6ce9

File tree

76 files changed

+2451
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2451
-104
lines changed

polling-app-client/.idea/.gitignore

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/.idea/polling-app-client.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/package-lock.json

Lines changed: 36 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polling-app-client/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"name": "polling-app-client",
33
"version": "0.1.0",
44
"private": true,
5+
"proxy": "http://localhost:8080",
56
"dependencies": {
67
"antd": "^3.2.2",
78
"react": "^16.5.2",
89
"react-dom": "^16.5.2",
910
"react-router-dom": "^4.3.1",
10-
"react-scripts": "1.1.5"
11+
"react-scripts": "1.1.5",
12+
"slick-carousel": "^1.8.1"
1113
},
1214
"scripts": {
1315
"start": "react-app-rewired start",

polling-app-client/src/app/App.js

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import HomeDashboard from '../components/Dashboard/HomeDashboard';
2+
import GroupPollList from '../components/Dashboard/GroupPollList';
3+
import MyComments from '../components/Dashboard/MyComments';
4+
15
import React, { Component } from 'react';
26
import './App.css';
37
import {
@@ -9,7 +13,6 @@ import {
913
import { getCurrentUser } from '../util/APIUtils';
1014
import { ACCESS_TOKEN } from '../constants';
1115

12-
import PollList from '../poll/PollList';
1316
import NewPoll from '../poll/NewPoll';
1417
import Login from '../user/login/Login';
1518
import Signup from '../user/signup/Signup';
@@ -19,6 +22,7 @@ import NotFound from '../common/NotFound';
1922
import LoadingIndicator from '../common/LoadingIndicator';
2023
import PrivateRoute from '../common/PrivateRoute';
2124

25+
2226
import { Layout, notification } from 'antd';
2327
const { Content } = Layout;
2428

@@ -99,19 +103,41 @@ class App extends Component {
99103
<Content className="app-content">
100104
<div className="container">
101105
<Switch>
102-
<Route exact path="/"
103-
render={(props) => <PollList isAuthenticated={this.state.isAuthenticated}
104-
currentUser={this.state.currentUser} handleLogout={this.handleLogout} {...props} />}>
105-
</Route>
106-
<Route path="/login"
106+
<Route exact path="/"
107+
render={(props) => (
108+
<HomeDashboard
109+
currentUser={this.state.currentUser}
110+
isAuthenticated={this.state.isAuthenticated}
111+
handleLogout={this.handleLogout}
112+
{...props}
113+
/>
114+
)}
115+
/>
116+
117+
118+
119+
<Route path="/login"
107120
render={(props) => <Login onLogin={this.handleLogin} {...props} />}></Route>
108121
<Route path="/signup" component={Signup}></Route>
122+
109123
<Route path="/users/:username"
110124
render={(props) => <Profile isAuthenticated={this.state.isAuthenticated} currentUser={this.state.currentUser} {...props} />}>
111125
</Route>
112126
<PrivateRoute authenticated={this.state.isAuthenticated} path="/poll/new" component={NewPoll} handleLogout={this.handleLogout}></PrivateRoute>
113-
<Route component={NotFound}></Route>
114-
</Switch>
127+
<PrivateRoute
128+
path="/groups/:groupId/polls"
129+
component={GroupPollList}
130+
authenticated={this.state.isAuthenticated}
131+
/>
132+
133+
<PrivateRoute
134+
path="/polls/:pollId/comments"
135+
component={MyComments}
136+
authenticated={this.state.isAuthenticated}
137+
/>
138+
139+
<Route component={NotFound} />
140+
</Switch>
115141
</div>
116142
</Content>
117143
</Layout>

polling-app-client/src/common/AppHeader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class AppHeader extends Component {
3434
<img src={pollIcon} alt="poll" className="poll-icon" />
3535
</Link>
3636
</Menu.Item>,
37+
3738
<Menu.Item key="/profile" className="profile-menu">
3839
<ProfileDropdownMenu
3940
currentUser={this.props.currentUser}
Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
import React from 'react';
2-
import {
3-
Route,
4-
Redirect
5-
} from "react-router-dom";
6-
7-
8-
const PrivateRoute = ({ component: Component, authenticated, ...rest }) => (
9-
<Route
10-
{...rest}
11-
render={props =>
12-
authenticated ? (
13-
<Component {...rest} {...props} />
14-
) : (
15-
<Redirect
16-
to={{
17-
pathname: '/login',
18-
state: { from: props.location }
19-
}}
20-
/>
21-
)
22-
}
23-
/>
2+
import { Route, Redirect } from "react-router-dom";
3+
4+
const PrivateRoute = ({ component: Component, render, authenticated, ...rest }) => (
5+
<Route
6+
{...rest}
7+
render={props =>
8+
authenticated ? (
9+
render ? render(props) : <Component {...props} />
10+
) : (
11+
<Redirect
12+
to={{
13+
pathname: '/login',
14+
state: { from: props.location }
15+
}}
16+
/>
17+
)
18+
}
19+
/>
2420
);
25-
26-
export default PrivateRoute
21+
22+
export default PrivateRoute;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
.poll-container {
2+
width: 100%;
3+
max-width: 600px; /* 또는 위에 그룹 카드랑 똑같은 너비 */
4+
margin: 0 auto;
5+
background-color: white;
6+
padding: 20px;
7+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
8+
border-radius: 10px;
9+
}
10+
11+
12+
.group-actions-text {
13+
flex: 1;
14+
}
15+
16+
.group-actions-text h3 {
17+
font-size: 1.2rem;
18+
margin-bottom: 8px;
19+
color: #333;
20+
}
21+
22+
.group-actions-text p {
23+
font-size: 0.95rem;
24+
color: #666;
25+
line-height: 1.5;
26+
}
27+
28+
.group-actions-buttons {
29+
display: flex;
30+
gap: 12px;
31+
}
32+
33+
.create-btn {
34+
background-color: #2196f3;
35+
color: white;
36+
border: none;
37+
padding: 10px 16px;
38+
font-size: 0.95rem;
39+
border-radius: 6px;
40+
cursor: pointer;
41+
transition: background-color 0.3s;
42+
}
43+
44+
.create-btn:hover {
45+
background-color: #1976d2;
46+
}
47+
48+
.join-btn {
49+
background-color: #f1f1f1;
50+
color: #333;
51+
border: none;
52+
padding: 10px 16px;
53+
font-size: 0.95rem;
54+
border-radius: 6px;
55+
cursor: pointer;
56+
transition: background-color 0.3s;
57+
}
58+
59+
.join-btn:hover {
60+
background-color: #ddd;
61+
}
62+
63+
.group-actions-container {
64+
background-color: #fff;
65+
padding: 24px;
66+
border-radius: 12px;
67+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
68+
display: flex;
69+
justify-content: space-between;
70+
align-items: center;
71+
width: 100%;
72+
}

0 commit comments

Comments
 (0)