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
shopping-mall
Commits
96d53c8a
Commit
96d53c8a
authored
Jan 13, 2021
by
kusang96
Browse files
route 손보는 중
parent
064e5fe5
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
96d53c8a
...
@@ -18,6 +18,7 @@ function App() {
...
@@ -18,6 +18,7 @@ function App() {
return
(
return
(
<
div
>
<
div
>
{
console
.
log
(
"
match.params=
"
,
match
.
params
(
product
))}
<
MainNav
/>
<
MainNav
/>
<
SubNav
/>
<
SubNav
/>
<
Router
>
<
Router
>
...
@@ -25,8 +26,8 @@ function App() {
...
@@ -25,8 +26,8 @@ function App() {
<
Route
exact
path
=
"
/
"
component
=
{
Home
}
/
>
<
Route
exact
path
=
"
/
"
component
=
{
Home
}
/
>
<
Route
path
=
"
/login
"
component
=
{
Login
}
/
>
<
Route
path
=
"
/login
"
component
=
{
Login
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
Signup
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
Signup
}
/
>
<
Route
path
=
"
/product
"
component
=
{
Product
}
/
>
{
/*
<Route path="/product" component={Product} />
*/
}
<
Route
path
=
"
/product
slis
t
"
component
=
{
ProductsList
}
/
>
<
Route
path
=
"
/product
/:produc
t
"
component
=
{
ProductsList
}
/
>
<
Route
path
=
"
/admin
"
component
=
{
Admin
}
/
>
<
Route
path
=
"
/admin
"
component
=
{
Admin
}
/
>
<
Route
path
=
"
/regist
"
component
=
{
ProductRegist
}
/
>
<
Route
path
=
"
/regist
"
component
=
{
ProductRegist
}
/
>
<
Route
path
=
"
/shoppingcart
"
component
=
{
ShoppingCart
}
/
>
<
Route
path
=
"
/shoppingcart
"
component
=
{
ShoppingCart
}
/
>
...
...
client/src/Components/SubNav.js
View file @
96d53c8a
...
@@ -14,9 +14,9 @@ function SubNav() {
...
@@ -14,9 +14,9 @@ function SubNav() {
const
response
=
await
axios
.
get
(
'
/api/categorys
'
)
const
response
=
await
axios
.
get
(
'
/api/categorys
'
)
let
list
=
[]
let
list
=
[]
Object
.
keys
(
response
.
data
[
0
]).
forEach
((
ele
)
=>
{
Object
.
keys
(
response
.
data
[
0
]).
forEach
((
ele
)
=>
{
const
url
=
"
/
"
+
ele
.
toLowerCase
()
const
url
=
ele
.
toLowerCase
()
list
.
push
(
list
.
push
(
<
Nav
.
Link
href
=
{
url
}
>
{
ele
}
<
/Nav.Link
>
<
Nav
.
Link
href
=
{
`/product/
${
url
}
`
}
>
{
ele
}
<
/Nav.Link
>
)
)
})
})
setCategorysDiv
(
list
)
setCategorysDiv
(
list
)
...
...
client/src/Pages/Home.js
View file @
96d53c8a
...
@@ -3,6 +3,9 @@ import { Card, Container, Row } from 'react-bootstrap';
...
@@ -3,6 +3,9 @@ import { Card, Container, Row } from 'react-bootstrap';
function
Home
()
{
function
Home
()
{
return
(
return
(
<
div
>
<
div
>
<
Container
className
=
"
my-5
"
>
<
Container
className
=
"
my-5
"
>
...
...
client/src/Pages/ProductsList.js
View file @
96d53c8a
...
@@ -25,6 +25,7 @@ function ProductsList() {
...
@@ -25,6 +25,7 @@ function ProductsList() {
return
(
return
(
<
div
>
<
div
>
<
style
type
=
"
text/css
"
>
<
style
type
=
"
text/css
"
>
{
`
{
`
.btn {
.btn {
...
@@ -118,7 +119,7 @@ function ProductsList() {
...
@@ -118,7 +119,7 @@ function ProductsList() {
<
/Card
>
<
/Card
>
<
/Row
>
<
/Row
>
<
/Container
>
<
/Container
>
<
Pagination
/>
{
/*
<Pagination
postsPerPage={postsPerPage} totalPosts={posts.length} paginate={paginate} /> */
}
<
/div
>
<
/div
>
)
)
}
}
...
...
client/src/Pages/Signup.js
View file @
96d53c8a
...
@@ -16,7 +16,7 @@ function Signup() {
...
@@ -16,7 +16,7 @@ function Signup() {
const
[
user
,
setUser
]
=
useState
(
''
)
const
[
user
,
setUser
]
=
useState
(
''
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
validated
,
setValidated
]
=
useState
(
false
);
function
handleChange
(
event
)
{
function
handleChange
(
event
)
{
const
{
name
,
value
}
=
event
.
target
const
{
name
,
value
}
=
event
.
target
...
@@ -41,25 +41,25 @@ const [validated, setValidated] = useState(false);
...
@@ -41,25 +41,25 @@ const [validated, setValidated] = useState(false);
}
catch
(
error
)
{
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
catchErrors
(
error
,
setError
)
}
}
}
}
function
checkPassword
(
event
){
function
checkPassword
(
event
)
{
const
p1
=
user
.
password
const
p1
=
user
.
password
const
p2
=
user
.
password2
const
p2
=
user
.
password2
if
(
p1
!==
p2
){
if
(
p1
!==
p2
)
{
event
.
preventDefault
();
event
.
preventDefault
();
event
.
stopPropagation
();
event
.
stopPropagation
();
alert
(
'
비밀번호가 일치하지 않습니다.
'
)
alert
(
'
비밀번호가 일치하지 않습니다.
'
)
return
false
return
false
}
else
{
}
else
{
return
true
return
true
}
}
}
}
return
(
return
(
<
div
>
<
div
>
...
@@ -156,7 +156,7 @@ const [validated, setValidated] = useState(false);
...
@@ -156,7 +156,7 @@ const [validated, setValidated] = useState(false);
value
=
{
user
.
password2
}
value
=
{
user
.
password2
}
required
required
onChange
=
{
handleChange
}
onChange
=
{
handleChange
}
/
>
/
>
<
Form
.
Control
.
Feedback
type
=
"
invalid
"
>
비밀번호를
한번
더
입력하세요
.
<
Form
.
Control
.
Feedback
type
=
"
invalid
"
>
비밀번호를
한번
더
입력하세요
.
<
/Form.Control.Feedback
>
<
/Form.Control.Feedback
>
<
/Form.Row
>
<
/Form.Row
>
...
@@ -177,7 +177,7 @@ const [validated, setValidated] = useState(false);
...
@@ -177,7 +177,7 @@ const [validated, setValidated] = useState(false);
<
Button
<
Button
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
type
=
"
submit
"
block
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
type
=
"
submit
"
block
onClick
=
{
checkPassword
}
onClick
=
{
checkPassword
}
>
>
Sign
Up
Sign
Up
<
/Button
>
<
/Button
>
<
/Form
>
<
/Form
>
...
...
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