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