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
be0a7340
Commit
be0a7340
authored
Jan 13, 2021
by
kusang96
Browse files
href 처리중
parent
96d53c8a
Changes
3
Show whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
be0a7340
...
...
@@ -18,10 +18,9 @@ function App() {
return
(
<
div
>
{
console
.
log
(
"
match.params=
"
,
match
.
params
(
product
))}
<
Router
>
<
MainNav
/>
<
SubNav
/>
<
Router
>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
Home
}
/
>
<
Route
path
=
"
/login
"
component
=
{
Login
}
/
>
...
...
client/src/Components/SubNav.js
View file @
be0a7340
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'
react
'
;
import
{
Redirect
}
from
'
react-router-dom
'
;
import
{
Navbar
,
Nav
,
NavDropdown
}
from
'
react-bootstrap
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Navbar
,
Nav
}
from
'
react-bootstrap
'
;
import
axios
from
'
axios
'
;
import
catchErrors
from
'
../utils/catchErrors
'
;
...
...
@@ -16,7 +16,7 @@ function SubNav() {
Object
.
keys
(
response
.
data
[
0
]).
forEach
((
ele
)
=>
{
const
url
=
ele
.
toLowerCase
()
list
.
push
(
<
Nav
.
Link
href
=
{
`/product/
${
url
}
`
}
>
{
ele
}
<
/Nav.Link
>
<
Nav
.
Link
as
=
{
Link
}
to
=
{
`/product/
${
url
}
`
}
>
{
ele
}
<
/Nav.Link
>
)
})
setCategorysDiv
(
list
)
...
...
client/src/Pages/ProductsList.js
View file @
be0a7340
...
...
@@ -2,7 +2,8 @@ import React, { useState, useEffect, useRef } from 'react';
import
Pagination
from
'
../Components/Pagination
'
;
import
{
Container
,
Row
,
Col
,
Form
,
FormControl
,
Button
,
Card
,
Dropdown
}
from
'
react-bootstrap
'
;
function
ProductsList
()
{
function
ProductsList
(
props
)
{
const
const
[
sub
,
setSub
]
=
useState
([
'
PADDED JACKET
'
,
'
JACKET
'
,
'
JUMPER
'
,
'
COAT
'
,
'
FLEECE
'
,
'
CARDIGAN / VEST
'
])
// useEffect(() => {
...
...
@@ -25,7 +26,7 @@ function ProductsList() {
return
(
<
div
>
{
console
.
log
(
"
match.params=
"
,
props
.
match
.
params
.
product
)}
<
style
type
=
"
text/css
"
>
{
`
.btn {
...
...
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