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
Show whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
c8e83894
...
...
@@ -13,7 +13,7 @@ function App() {
{
/* <AuthProvider> */
}
<
Switch
>
<
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
"
component
=
{
ProfilePage
}
/
>
<
Route
path
=
"
/room/:roomId/:channelId
"
component
=
{
RoomPage
}
/
>
...
...
client/src/components/Header.js
View file @
c8e83894
...
...
@@ -10,7 +10,7 @@ const Header = () => {
>
<
div
className
=
"
d-flex justify-content-end
"
>
<
div
>
<
Link
to
=
"
/user
"
>
<
Link
to
=
"
/user
/:id
"
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
/Link
>
<
/div
>
...
...
client/src/components/Home/CreateRoom.js
View file @
c8e83894
...
...
@@ -48,7 +48,7 @@ const CreateRoom = () => {
if
(
success
)
{
console
.
log
(
'
success
'
,
success
)
alert
(
'
룸생성이 완료되었습니다!
'
)
return
<
Redirect
to
=
'
/user
'
/>
return
<
Redirect
to
=
'
/user
/:id
'
/>
}
const
{
name
,
owner
,
member
,
profileimg
}
=
room
;
...
...
client/src/components/Home/HomeProfile.js
View file @
c8e83894
...
...
@@ -16,7 +16,8 @@ const HomeProfile = () => {
async
function
getSetUser
(
userID
)
{
try
{
// console.log('userID', userID)
const
data
=
await
userApi
.
getUser
(
userID
)
// `/users/${userId}`
const
data
=
await
userApi
.
getUser
(
`/user/
${
userId
}
`
)
// console.log(data)
setUser
(
data
)
// console.log(user)
...
...
client/src/components/Home/JoinRoom.js
View file @
c8e83894
...
...
@@ -38,7 +38,7 @@ const JoinRoom = () => {
}
}
if
(
success
)
{
return
<
Redirect
to
=
"
/user
"
/>
;
return
<
Redirect
to
=
"
/user
/:id
"
/>
;
}
return
(
...
...
client/src/components/Login.js
View file @
c8e83894
...
...
@@ -14,6 +14,7 @@ const Login = () => {
const
[
disabled
,
setDisabled
]
=
useState
(
true
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
success
,
setSuccess
]
=
useState
(
false
)
const
[
id
,
setId
]
=
useState
(
''
)
useEffect
(()
=>
{
const
isUser
=
Object
.
values
(
user
).
every
((
el
)
=>
Boolean
(
el
))
...
...
@@ -33,6 +34,7 @@ const Login = () => {
// setError("");
const
data
=
await
userApi
.
login
(
user
)
console
.
log
(
data
)
setId
(
data
.
id
)
handleLogin
(
data
.
id
)
setSuccess
(
true
)
}
catch
(
error
)
{
...
...
@@ -44,7 +46,7 @@ const Login = () => {
}
if
(
success
)
{
alert
(
'
로그인 되었습니다
'
)
return
<
Redirect
to
=
"
/user
"
/>
return
<
Redirect
to
=
{
`
/user
/
${
id
}
`
}
/
>
}
const
{
email
,
password
}
=
user
...
...
client/src/components/Room/ChannelList.js
View file @
c8e83894
...
...
@@ -9,7 +9,7 @@ const ChannelList = () => {
<
nav
className
=
"
navbar navbar-light d-flex justify-content-between
"
>
<
LeftHamburger
/>
<
div
>
<
Link
to
=
"
/user
"
>
<
Link
to
=
"
/user
/:id
"
>
<
img
src
=
"
/BORA.png
"
style
=
{{
width
:
'
160px
'
}}
/
>
<
/Link
>
<
/div
>
...
...
client/src/components/Room/RightHamburger.js
View file @
c8e83894
...
...
@@ -105,7 +105,7 @@ const RightHamberger = () => {
<
/div
>
<
div
className
=
"
row mb-3
"
>
<
div
className
=
"
d-flex justify-content-evenly
"
>
{
/* <Link to="/user"> */
}
{
/* <Link to="/user
/:id
"> */
}
<
button
type
=
"
submit
"
className
=
"
col-2 p-1 btn btn-primary
"
...
...
client/src/pages/InvitePage.js
View file @
c8e83894
...
...
@@ -10,7 +10,7 @@ const InvitePage = () => {
function
Invitereject
()
{
// if () //초대받은 사람이 로그인 o
// <Link to="/user"></Link>//유저 페이지로 이동.
// <Link to="/user
/:id
"></Link>//유저 페이지로 이동.
// else //로그인x
// <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