Toggle navigation
Toggle navigation
This project
Loading...
Sign in
황선혁
/
weather_chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Eric Whale
2022-05-31 21:00:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e07b1fc23d9e206e51daf3fd02f443d371b70f7c
e07b1fc2
1 parent
bb7b429b
Build UserRoom page
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
84 additions
and
17 deletions
client/package.json
client/src/components/UserBox.jsx
client/src/index.js
client/src/routes/login.jsx
client/src/routes/signup.jsx
client/src/routes/userroom.jsx
client/src/lib/auth.js → client/src/service/auth.js
client/src/styles/bar.scss
client/src/styles/box.scss
client/src/styles/layout.scss
client/src/styles/lib/auth.js
client/package.json
View file @
e07b1fc
...
...
@@ -22,10 +22,17 @@
"eject"
:
"react-scripts eject"
},
"eslintConfig"
:
{
"extends"
:
[
"react-app"
,
"react-app/jest"
]
"extends"
:
[
"react-app"
,
"react-app/jest"
]
},
"browserslist"
:
{
"production"
:
[
">0.2%"
,
"not dead"
,
"not op_mini all"
],
"production"
:
[
">0.2%"
,
"not dead"
,
"not op_mini all"
],
"development"
:
[
"last 1 chrome version"
,
"last 1 firefox version"
,
...
...
client/src/components/UserBox.jsx
View file @
e07b1fc
function
UserBox
()
{
return
<
div
>
UserBox
</
div
>;
import
"../styles/box.scss"
;
function
UserBox
({
user
})
{
return
(
<
div
className=
"userBox"
>
<
h1
>
{
user
.
username
}
</
h1
>
<
p
>
user info
</
p
>
<
div
>
chat!
</
div
>
</
div
>
);
}
export
default
UserBox
;
...
...
client/src/index.js
View file @
e07b1fc
...
...
@@ -8,13 +8,15 @@ import Signup from "./routes/signup";
import
Login
from
"./routes/login"
;
import
Userroom
from
"./routes/userroom"
;
import
Settings
from
"./routes/settings"
;
// styles
import
"./styles/layout.scss"
;
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"root"
));
root
.
render
(
<
BrowserRouter
>
<
Routes
>
<
Route
path
=
"/"
element
=
{
<
App
/>
}
/>
/
/
App
=
chatroom
<
Route
path
=
"/"
element
=
{
<
App
/>
}
/
>
<
Route
path
=
"/login"
element
=
{
<
Login
/>
}
/
>
<
Route
path
=
"/signup"
element
=
{
<
Signup
/>
}
/
>
<
Route
path
=
"/userroom"
element
=
{
<
Userroom
/>
}
/
>
...
...
client/src/routes/login.jsx
View file @
e07b1fc
import
{
Link
}
from
"react-router-dom"
;
import
{
useState
}
from
"react"
;
// lib
import
{
handleLogin
}
from
"../lib/auth"
;
// styles
import
{
Link
}
from
"react-router-dom"
;
import
"../styles/layout.scss"
;
import
{
handleLogin
}
from
"../service/auth"
;
function
Login
()
{
const
[
email
,
setEmail
]
=
useState
(
""
);
...
...
client/src/routes/signup.jsx
View file @
e07b1fc
import
{
Link
}
from
"react-router-dom"
;
// styles
import
"../styles/layout.scss"
;
function
Signup
()
{
const
handleSubmit
=
(
e
)
=>
{
...
...
client/src/routes/userroom.jsx
View file @
e07b1fc
import
axios
from
"axios"
;
import
{
useState
,
useEffect
}
from
"react"
;
// components
import
Bottombar
from
"../components/Bottombar"
;
import
Topbar
from
"../components/Topbar"
;
import
UserBox
from
"../components/UserBox"
;
function
Userroom
()
{
const
Userroom
=
()
=>
{
const
[
users
,
setUsers
]
=
useState
(
null
);
useEffect
(()
=>
{
axios
.
get
(
"/api/users/all/"
).
then
((
response
)
=>
{
setUsers
(
response
.
data
);
});
},
[]);
if
(
!
users
)
return
null
;
return
(
<
div
>
<
Topbar
/>
<
h1
>
User Room
</
h1
>
<
div
>
<
UserBox
/>
<
UserBox
/>
<
UserBox
/>
<
UserBox
/>
{
Array
.
isArray
(
users
)
?
users
.
map
((
user
,
i
)
=>
{
return
<
UserBox
key=
{
i
}
user=
{
user
}
/>;
})
:
""
}
</
div
>
<
Bottombar
/>
</
div
>
);
}
}
;
export
default
Userroom
;
...
...
client/src/
lib
/auth.js
→
client/src/
service
/auth.js
View file @
e07b1fc
File moved
client/src/styles/bar.scss
View file @
e07b1fc
...
...
@@ -2,4 +2,21 @@
.bottombar
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
font-size
:
1
.3rem
;
a
{
font-size
:
2rem
;
}
*
{
padding
:
0
.3rem
0
.5rem
;
}
}
.topbar
{
margin-bottom
:
0
.5rem
;
}
.bottombar
{
margin-top
:
0
.5rem
;
}
...
...
client/src/styles/box.scss
0 → 100644
View file @
e07b1fc
.userBox
,
.chatBox
{
margin
:
0
.3rem
1rem
;
border
:
0
.2rem
black
solid
;
border-radius
:
10px
;
}
.userBox
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
flex-start
;
align-items
:
center
;
*
{
padding
:
0
.3rem
0
.5rem
;
}
}
client/src/styles/layout.scss
View file @
e07b1fc
*
{
margin
:
0
;
padding
:
0
;
}
.container
{
display
:
flex
;
flex-direction
:
column
;
...
...
client/src/styles/lib/auth.js
deleted
100644 → 0
View file @
bb7b429
File mode changed
Please
register
or
login
to post a comment