Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
bora-it
Commits
c8e83894
Commit
c8e83894
authored
Aug 01, 2021
by
우지원
Browse files
/user/:id
parent
e73fe78d
Changes
9
Hide whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
c8e83894
...
@@ -13,7 +13,7 @@ function App() {
...
@@ -13,7 +13,7 @@ function App() {
{
/* <AuthProvider> */
}
{
/* <AuthProvider> */
}
<
Switch
>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
HomeGuestPage
}
/
>
<
Route
exact
path
=
"
/
"
component
=
{
HomeGuestPage
}
/
>
<
Route
exact
path
=
"
/user
"
component
=
{
HomeUserPage
}
/
>
<
Route
exact
path
=
"
/user
/:id
"
component
=
{
HomeUserPage
}
/
>
<
Route
path
=
"
/profile/:id/update
"
component
=
{
InfoUpdatePage
}
/
>
<
Route
path
=
"
/profile/:id/update
"
component
=
{
InfoUpdatePage
}
/
>
<
Route
path
=
"
/profile/:id
"
component
=
{
ProfilePage
}
/
>
<
Route
path
=
"
/profile/:id
"
component
=
{
ProfilePage
}
/
>
<
Route
path
=
"
/room/:roomId/:channelId
"
component
=
{
RoomPage
}
/
>
<
Route
path
=
"
/room/:roomId/:channelId
"
component
=
{
RoomPage
}
/
>
...
...
client/src/components/Header.js
View file @
c8e83894
...
@@ -10,7 +10,7 @@ const Header = () => {
...
@@ -10,7 +10,7 @@ const Header = () => {
>
>
<
div
className
=
"
d-flex justify-content-end
"
>
<
div
className
=
"
d-flex justify-content-end
"
>
<
div
>
<
div
>
<
Link
to
=
"
/user
"
>
<
Link
to
=
"
/user
/:id
"
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
/Link
>
<
/Link
>
<
/div
>
<
/div
>
...
...
client/src/components/Home/CreateRoom.js
View file @
c8e83894
...
@@ -48,7 +48,7 @@ const CreateRoom = () => {
...
@@ -48,7 +48,7 @@ const CreateRoom = () => {
if
(
success
)
{
if
(
success
)
{
console
.
log
(
'
success
'
,
success
)
console
.
log
(
'
success
'
,
success
)
alert
(
'
룸생성이 완료되었습니다!
'
)
alert
(
'
룸생성이 완료되었습니다!
'
)
return
<
Redirect
to
=
'
/user
'
/>
return
<
Redirect
to
=
'
/user
/:id
'
/>
}
}
const
{
name
,
owner
,
member
,
profileimg
}
=
room
;
const
{
name
,
owner
,
member
,
profileimg
}
=
room
;
...
...
client/src/components/Home/HomeProfile.js
View file @
c8e83894
...
@@ -16,7 +16,8 @@ const HomeProfile = () => {
...
@@ -16,7 +16,8 @@ const HomeProfile = () => {
async
function
getSetUser
(
userID
)
{
async
function
getSetUser
(
userID
)
{
try
{
try
{
// console.log('userID', userID)
// console.log('userID', userID)
const
data
=
await
userApi
.
getUser
(
userID
)
// `/users/${userId}`
const
data
=
await
userApi
.
getUser
(
`/user/
${
userId
}
`
)
// console.log(data)
// console.log(data)
setUser
(
data
)
setUser
(
data
)
// console.log(user)
// console.log(user)
...
...
client/src/components/Home/JoinRoom.js
View file @
c8e83894
...
@@ -38,7 +38,7 @@ const JoinRoom = () => {
...
@@ -38,7 +38,7 @@ const JoinRoom = () => {
}
}
}
}
if
(
success
)
{
if
(
success
)
{
return
<
Redirect
to
=
"
/user
"
/>
;
return
<
Redirect
to
=
"
/user
/:id
"
/>
;
}
}
return
(
return
(
...
...
client/src/components/Login.js
View file @
c8e83894
...
@@ -14,6 +14,7 @@ const Login = () => {
...
@@ -14,6 +14,7 @@ const Login = () => {
const
[
disabled
,
setDisabled
]
=
useState
(
true
)
const
[
disabled
,
setDisabled
]
=
useState
(
true
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
success
,
setSuccess
]
=
useState
(
false
)
const
[
success
,
setSuccess
]
=
useState
(
false
)
const
[
id
,
setId
]
=
useState
(
''
)
useEffect
(()
=>
{
useEffect
(()
=>
{
const
isUser
=
Object
.
values
(
user
).
every
((
el
)
=>
Boolean
(
el
))
const
isUser
=
Object
.
values
(
user
).
every
((
el
)
=>
Boolean
(
el
))
...
@@ -33,6 +34,7 @@ const Login = () => {
...
@@ -33,6 +34,7 @@ const Login = () => {
// setError("");
// setError("");
const
data
=
await
userApi
.
login
(
user
)
const
data
=
await
userApi
.
login
(
user
)
console
.
log
(
data
)
console
.
log
(
data
)
setId
(
data
.
id
)
handleLogin
(
data
.
id
)
handleLogin
(
data
.
id
)
setSuccess
(
true
)
setSuccess
(
true
)
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -44,7 +46,7 @@ const Login = () => {
...
@@ -44,7 +46,7 @@ const Login = () => {
}
}
if
(
success
)
{
if
(
success
)
{
alert
(
'
로그인 되었습니다
'
)
alert
(
'
로그인 되었습니다
'
)
return
<
Redirect
to
=
"
/user
"
/>
return
<
Redirect
to
=
{
`
/user
/
${
id
}
`
}
/
>
}
}
const
{
email
,
password
}
=
user
const
{
email
,
password
}
=
user
...
...
client/src/components/Room/ChannelList.js
View file @
c8e83894
...
@@ -9,7 +9,7 @@ const ChannelList = () => {
...
@@ -9,7 +9,7 @@ const ChannelList = () => {
<
nav
className
=
"
navbar navbar-light d-flex justify-content-between
"
>
<
nav
className
=
"
navbar navbar-light d-flex justify-content-between
"
>
<
LeftHamburger
/>
<
LeftHamburger
/>
<
div
>
<
div
>
<
Link
to
=
"
/user
"
>
<
Link
to
=
"
/user
/:id
"
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
/Link
>
<
/Link
>
<
/div
>
<
/div
>
...
...
client/src/components/Room/RightHamburger.js
View file @
c8e83894
...
@@ -105,7 +105,7 @@ const RightHamberger = () => {
...
@@ -105,7 +105,7 @@ const RightHamberger = () => {
<
/div
>
<
/div
>
<
div
className
=
"
row mb-3
"
>
<
div
className
=
"
row mb-3
"
>
<
div
className
=
"
d-flex justify-content-evenly
"
>
<
div
className
=
"
d-flex justify-content-evenly
"
>
{
/* <Link to="/user"> */
}
{
/* <Link to="/user
/:id
"> */
}
<
button
<
button
type
=
"
submit
"
type
=
"
submit
"
className
=
"
col-2 p-1 btn btn-primary
"
className
=
"
col-2 p-1 btn btn-primary
"
...
...
client/src/pages/InvitePage.js
View file @
c8e83894
...
@@ -10,7 +10,7 @@ const InvitePage = () => {
...
@@ -10,7 +10,7 @@ const InvitePage = () => {
function
Invitereject
()
{
function
Invitereject
()
{
// if () //초대받은 사람이 로그인 o
// if () //초대받은 사람이 로그인 o
// <Link to="/user"></Link>//유저 페이지로 이동.
// <Link to="/user
/:id
"></Link>//유저 페이지로 이동.
// else //로그인x
// else //로그인x
// <Link to="/"></Link> //메인화면으로 이동.
// <Link to="/"></Link> //메인화면으로 이동.
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment