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";
function
App
()
{
return
(
<
Router
>
<
Switch
>
<
Route
exact
path
=
"
/
"
>
<
Home
/>
<
/Route
>
<
Route
path
=
{
Routes
.
Profile
.
path
}
>
<
Profile
/>
<
/Route
>
<
Route
path
=
{
Routes
.
TraceCode
.
path
}
>
<
TraceCode
/>
<
/Route
>
<
/Switch
>
<
Switch
>
<
Route
exact
path
=
"
/
"
>
<
Home
/>
<
/Route
>
<
Route
path
=
{
Routes
.
Profile
.
path
}
>
<
Profile
/>
<
/Route
>
<
Route
path
=
{
Routes
.
TraceCode
.
path
}
>
<
TraceCode
/>
<
/Route
>
<
/Switch
>
<
/Router
>
);
}
...
...
src/components/Home/index.js
View file @
ce269b19
import
React
from
'
react
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Routes
}
from
'
../../routes
'
;
import
dummyData
from
'
../../data/index.json
'
;
const
Home
=
()
=>
{
return
(
<
ul
>
<
Link
to
=
{
Routes
.
Profile
.
path
}
>
Profile
<
/Link
>
<
Link
to
=
{
Routes
.
Profile
.
path
+
`/
${
dummyData
.
data
.
map
(
data
=>
data
.
code
)}
`
}
>
Profile
<
/Link
>
<
/ul
>
);
}
...
...
src/components/Profile/index.js
View file @
ce269b19
...
...
@@ -10,7 +10,7 @@ const Profile = () => {
dummyData
.
data
&&
dummyData
.
data
.
length
>
0
?
dummyData
.
data
.
map
((
data
,
key
)
=>
{
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
>
<
Row
className
=
"
mb-2
"
>
<
Col
xs
=
{
8
}
>
...
...
@@ -36,7 +36,7 @@ const Profile = () => {
<
div
>
{
data
.
profile_product
&&
data
.
profile_product
.
length
>
0
?
data
.
profile_product
.
map
(
product
=>
{
const
onHandleTraceCode
=
()
=>
{
history
.
push
({
pathname
:
Routes
.
TraceCode
.
path
,
pathname
:
Routes
.
TraceCode
.
path
+
`/
${
product
.
trace_code
}
`
,
state
:
{
product
}
});
}
...
...
src/components/TraceCode/index.js
View file @
ce269b19
...
...
@@ -8,21 +8,20 @@ const TraceCode = () => {
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
console
.
log
(
"
product
"
,
product
);
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
>
<
div
className
=
"
text-center
"
>
<
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
=
"
mb-3
"
>
M
ã
s
ả
n
ph
ẩ
m
{
product
.
trace_code
}
<
/div
>
<
div
className
=
"
mb-3
"
>
Xu
ấ
t
x
ứ
{
product
.
origin
}
<
/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
ứ
<
span
className
=
"
font-weight-bold
"
>
{
product
.
origin
}
<
/span>
</
div
>
<
div
className
=
"
h5 mb-3
"
style
=
{{
color
:
'
#33CC66
'
}}
>
Gi
á
:
{
product
.
cost
}
<
/div
>
<
/div
>
<
/Card.Header
>
<
Card
.
Body
>
<
div
className
=
"
main-container
"
>
<
Row
className
=
"
wrapper-search py-4
"
>
<
div
className
=
"
wrapper-search py-4
"
>
<
Tab
.
Container
defaultActiveKey
=
"
general-information
"
>
<
Row
>
<
Col
xs
=
{
12
}
>
...
...
@@ -59,16 +58,20 @@ const TraceCode = () => {
<
Tab
.
Pane
eventKey
=
"
product-chain-diary
"
>
{
product
.
product_chain_diary
.
map
(
diary
=>
(
<
div
>
<
Row
className
=
"
h6 mt-3
"
>
{
diary
.
company
}
<
/Row
>
<
div
className
=
"
h6 mt-3
"
>
{
diary
.
company
}
<
/div
>
<
Row
className
=
"
mb-3
"
>
<
Col
>
{
formatDateTime
(
diary
.
date
)}
<
/Col
>
<
Col
>
{
diary
.
description
}
<
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
Col
><
/Col
>
<
/Row
>
<
/div
>
))}
<
/Tab.Pane
>
<
Tab
.
Pane
eventKey
=
"
product-certification
"
>
{
product
.
product_certification
.
map
(
certificate
=>
(
{
product
.
product_certification
.
map
(
(
certificate
)
=>
(
<
div
>
<
div
className
=
"
h6 mt-3 mb-3
"
>
{
certificate
.
certification_information
}
<
/div
>
<
img
src
=
{
window
.
location
.
origin
+
certificate
.
image
}
alt
=
"
certificate
"
height
=
"
250px
"
/>
...
...
@@ -79,10 +82,10 @@ const TraceCode = () => {
<
/Col
>
<
/Row
>
<
/Tab.Container
>
<
/
Row
>
<
/
div
>
<
/div
>
<
/Card.Body
>
<
/Card
>
<
/Card>
);
}
...
...
src/routes.js
View file @
ce269b19
export
const
Routes
=
{
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