Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
A
Aqbits Trace Code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mai Thanh Cong
Aqbits Trace Code
Commits
ce269b19
Commit
ce269b19
authored
Jun 30, 2021
by
Mai Thanh Cong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update UI profile, trace-code
parent
4ddc8971
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
24 deletions
+28
-24
src/App.js
src/App.js
+11
-11
src/components/Home/index.js
src/components/Home/index.js
+2
-1
src/components/Profile/index.js
src/components/Profile/index.js
+2
-2
src/components/TraceCode/index.js
src/components/TraceCode/index.js
+12
-9
src/routes.js
src/routes.js
+1
-1
No files found.
src/App.js
View file @
ce269b19
...
@@ -10,17 +10,17 @@ import TraceCode from "./components/TraceCode/index";
...
@@ -10,17 +10,17 @@ import TraceCode from "./components/TraceCode/index";
function
App
()
{
function
App
()
{
return
(
return
(
<
Router
>
<
Router
>
<
Switch
>
<
Switch
>
<
Route
exact
path
=
"
/
"
>
<
Route
exact
path
=
"
/
"
>
<
Home
/>
<
Home
/>
<
/Route
>
<
/Route
>
<
Route
path
=
{
Routes
.
Profile
.
path
}
>
<
Route
path
=
{
Routes
.
Profile
.
path
}
>
<
Profile
/>
<
Profile
/>
<
/Route
>
<
/Route
>
<
Route
path
=
{
Routes
.
TraceCode
.
path
}
>
<
Route
path
=
{
Routes
.
TraceCode
.
path
}
>
<
TraceCode
/>
<
TraceCode
/>
<
/Route
>
<
/Route
>
<
/Switch
>
<
/Switch
>
<
/Router
>
<
/Router
>
);
);
}
}
...
...
src/components/Home/index.js
View file @
ce269b19
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Routes
}
from
'
../../routes
'
;
import
{
Routes
}
from
'
../../routes
'
;
import
dummyData
from
'
../../data/index.json
'
;
const
Home
=
()
=>
{
const
Home
=
()
=>
{
return
(
return
(
<
ul
>
<
ul
>
<
Link
to
=
{
Routes
.
Profile
.
path
}
>
Profile
<
/Link
>
<
Link
to
=
{
Routes
.
Profile
.
path
+
`/
${
dummyData
.
data
.
map
(
data
=>
data
.
code
)}
`
}
>
Profile
<
/Link
>
<
/ul
>
<
/ul
>
);
);
}
}
...
...
src/components/Profile/index.js
View file @
ce269b19
...
@@ -10,7 +10,7 @@ const Profile = () => {
...
@@ -10,7 +10,7 @@ const Profile = () => {
dummyData
.
data
&&
dummyData
.
data
.
length
>
0
?
dummyData
.
data
&&
dummyData
.
data
.
length
>
0
?
dummyData
.
data
.
map
((
data
,
key
)
=>
{
dummyData
.
data
.
map
((
data
,
key
)
=>
{
return
(
return
(
<
Card
className
=
"
px-0 px-md-4 py-0 border-0
"
>
<
Card
className
=
"
px-0 px-md-4 py-0 border-0
"
key
=
{
key
}
>
<
Card
.
Body
>
<
Card
.
Body
>
<
Row
className
=
"
mb-2
"
>
<
Row
className
=
"
mb-2
"
>
<
Col
xs
=
{
8
}
>
<
Col
xs
=
{
8
}
>
...
@@ -36,7 +36,7 @@ const Profile = () => {
...
@@ -36,7 +36,7 @@ const Profile = () => {
<
div
>
{
data
.
profile_product
&&
data
.
profile_product
.
length
>
0
?
data
.
profile_product
.
map
(
product
=>
{
<
div
>
{
data
.
profile_product
&&
data
.
profile_product
.
length
>
0
?
data
.
profile_product
.
map
(
product
=>
{
const
onHandleTraceCode
=
()
=>
{
const
onHandleTraceCode
=
()
=>
{
history
.
push
({
history
.
push
({
pathname
:
Routes
.
TraceCode
.
path
,
pathname
:
Routes
.
TraceCode
.
path
+
`/
${
product
.
trace_code
}
`
,
state
:
{
product
}
state
:
{
product
}
});
});
}
}
...
...
src/components/TraceCode/index.js
View file @
ce269b19
...
@@ -8,21 +8,20 @@ const TraceCode = () => {
...
@@ -8,21 +8,20 @@ const TraceCode = () => {
const
history
=
useHistory
();
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
const
product
=
state
.
product
;
console
.
log
(
"
product
"
,
product
);
return
(
return
(
<
Card
className
=
"
px-0 px-md-4 py-0 border-0
"
>
<
Card
className
=
"
px-0 px-md-4 py-0 border-0
"
key
=
{
product
.
product_id
}
>
<
Card
.
Header
>
<
Card
.
Header
>
<
div
className
=
"
text-center
"
>
<
div
className
=
"
text-center
"
>
<
img
className
=
"
mb-3
"
src
=
{
window
.
location
.
origin
+
product
.
image
}
alt
=
"
product
"
/>
<
img
className
=
"
mb-3
"
src
=
{
window
.
location
.
origin
+
product
.
image
}
alt
=
"
product
"
/>
<
div
className
=
"
h4 font-weight-bold mb-3
"
>
{
product
.
name
}
<
/div
>
<
div
className
=
"
h4 font-weight-bold mb-3
"
>
{
product
.
name
}
<
/div
>
<
div
className
=
"
mb-3
"
>
M
ã
s
ả
n
ph
ẩ
m
{
product
.
trace_code
}
<
/div
>
<
div
className
=
"
mb-3
"
>
M
ã
s
ả
n
ph
ẩ
m
<
span
className
=
"
font-weight-bold
"
>
{
product
.
trace_code
}
<
/span>
</
div
>
<
div
className
=
"
mb-3
"
>
Xu
ấ
t
x
ứ
{
product
.
origin
}
<
/div
>
<
div
className
=
"
mb-3
"
>
Xu
ấ
t
x
ứ
<
span
className
=
"
font-weight-bold
"
>
{
product
.
origin
}
<
/span>
</
div
>
<
div
className
=
"
h5 mb-3
"
style
=
{{
color
:
'
#33CC66
'
}}
>
Gi
á
:
{
product
.
cost
}
<
/div
>
<
div
className
=
"
h5 mb-3
"
style
=
{{
color
:
'
#33CC66
'
}}
>
Gi
á
:
{
product
.
cost
}
<
/div
>
<
/div
>
<
/div
>
<
/Card.Header
>
<
/Card.Header
>
<
Card
.
Body
>
<
Card
.
Body
>
<
div
className
=
"
main-container
"
>
<
div
className
=
"
main-container
"
>
<
Row
className
=
"
wrapper-search py-4
"
>
<
div
className
=
"
wrapper-search py-4
"
>
<
Tab
.
Container
defaultActiveKey
=
"
general-information
"
>
<
Tab
.
Container
defaultActiveKey
=
"
general-information
"
>
<
Row
>
<
Row
>
<
Col
xs
=
{
12
}
>
<
Col
xs
=
{
12
}
>
...
@@ -59,16 +58,20 @@ const TraceCode = () => {
...
@@ -59,16 +58,20 @@ const TraceCode = () => {
<
Tab
.
Pane
eventKey
=
"
product-chain-diary
"
>
<
Tab
.
Pane
eventKey
=
"
product-chain-diary
"
>
{
product
.
product_chain_diary
.
map
(
diary
=>
(
{
product
.
product_chain_diary
.
map
(
diary
=>
(
<
div
>
<
div
>
<
Row
className
=
"
h6 mt-3
"
>
{
diary
.
company
}
<
/Row
>
<
div
className
=
"
h6 mt-3
"
>
{
diary
.
company
}
<
/div
>
<
Row
className
=
"
mb-3
"
>
<
Row
className
=
"
mb-3
"
>
<
Col
>
{
formatDateTime
(
diary
.
date
)}
<
/Col
>
<
Col
>
{
formatDateTime
(
diary
.
date
)}
<
/Col
>
<
Col
>
{
diary
.
description
}
<
/Col
>
<
Col
>
{
diary
.
description
}
<
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
/Row
>
<
/Row
>
<
/div
>
<
/div
>
))}
))}
<
/Tab.Pane
>
<
/Tab.Pane
>
<
Tab
.
Pane
eventKey
=
"
product-certification
"
>
<
Tab
.
Pane
eventKey
=
"
product-certification
"
>
{
product
.
product_certification
.
map
(
certificate
=>
(
{
product
.
product_certification
.
map
(
(
certificate
)
=>
(
<
div
>
<
div
>
<
div
className
=
"
h6 mt-3 mb-3
"
>
{
certificate
.
certification_information
}
<
/div
>
<
div
className
=
"
h6 mt-3 mb-3
"
>
{
certificate
.
certification_information
}
<
/div
>
<
img
src
=
{
window
.
location
.
origin
+
certificate
.
image
}
alt
=
"
certificate
"
height
=
"
250px
"
/>
<
img
src
=
{
window
.
location
.
origin
+
certificate
.
image
}
alt
=
"
certificate
"
height
=
"
250px
"
/>
...
@@ -79,10 +82,10 @@ const TraceCode = () => {
...
@@ -79,10 +82,10 @@ const TraceCode = () => {
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
/Tab.Container
>
<
/Tab.Container
>
<
/
Row
>
<
/
div
>
<
/div
>
<
/div
>
<
/Card.Body
>
<
/Card.Body
>
<
/Card
>
<
/Card>
);
);
}
}
...
...
src/routes.js
View file @
ce269b19
export
const
Routes
=
{
export
const
Routes
=
{
Profile
:
{
path
:
"
/profile
"
},
Profile
:
{
path
:
"
/profile
"
},
TraceCode
:
{
path
:
`/trace-code/`
}
TraceCode
:
{
path
:
"
/trace-code
"
}
};
};
\ No newline at end of file
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