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
850d7b56
Commit
850d7b56
authored
Jun 30, 2021
by
Vinh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create detail profile page
parent
75165956
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1000 additions
and
35 deletions
+1000
-35
src/index.js
src/index.js
+7
-0
src/reoutes.js
src/reoutes.js
+4
-0
src/views/Index.js
src/views/Index.js
+1
-0
src/views/IndexSections/Inputs.js
src/views/IndexSections/Inputs.js
+70
-35
src/views/examples/DetailProfile.js
src/views/examples/DetailProfile.js
+918
-0
No files found.
src/index.js
View file @
850d7b56
...
...
@@ -29,6 +29,8 @@ import Login from "views/examples/Login.js";
import
Profile
from
"
views/examples/Profile.js
"
;
import
Register
from
"
views/examples/Register.js
"
;
import
Tracecode
from
"
views/examples/Tracecode.js
"
import
DetailProfile
from
"
views/examples/DetailProfile.js
"
import
{
Routes
}
from
"
./reoutes
"
;
ReactDOM
.
render
(
<
BrowserRouter
>
...
...
@@ -39,6 +41,11 @@ ReactDOM.render(
exact
render
=
{
props
=>
<
Tracecode
{...
props
}
/>
}
/>
<
Route
path
=
{
'
/profile/detail
'
}
exact
render
=
{
props
=>
<
DetailProfile
{...
props
}
/>
}
/>
<
Route
path
=
"
/landing-page
"
exact
...
...
src/reoutes.js
0 → 100644
View file @
850d7b56
export
const
Routes
=
{
SearchDetail
:
{
path
:
"
./profile
"
},
TraceCode
:
{
path
:
"
./trace-code
"
}
}
\ No newline at end of file
src/views/Index.js
View file @
850d7b56
...
...
@@ -60,6 +60,7 @@ class Index extends React.Component {
<
Hero
/>
<
section
className
=
"
section
"
>
<
Container
>
<
Inputs
/>
<
/Container
>
<
/section
>
<
/main
>
...
...
src/views/IndexSections/Inputs.js
View file @
850d7b56
...
...
@@ -15,7 +15,7 @@
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
import
React
from
"
react
"
;
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
// nodejs library that concatenates classes
import
classnames
from
"
classnames
"
;
// reactstrap components
...
...
@@ -27,32 +27,61 @@ import {
InputGroup
,
Container
,
Row
,
Col
Col
,
Button
,
Form
}
from
"
reactstrap
"
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
dummyData
from
"
../../data/index.json
"
;
import
{
Routes
}
from
"
../../reoutes
"
;
const
Inputs
=
()
=>
{
const
[
searchProfile
,
setSearchProfile
]
=
useState
();
const
history
=
useHistory
();
const
handleChangeSearch
=
(
event
)
=>
{
console
.
log
(
"
change change
"
);
setSearchProfile
(
event
.
target
.
value
);
}
const
onHandleSearch
=
()
=>
{
console
.
log
(
"
dummyData.data
"
,
dummyData
.
data
);
const
nameCode
=
dummyData
.
data
.
map
(
item
=>
item
.
code
);
console
.
log
(
"
nameCode
"
,
nameCode
);
if
(
searchProfile
===
nameCode
){
history
.
push
({
pathname
:
Routes
.
SearchProfile
.
path
+
`
${
searchProfile
}
`
,
state
:
{
code_name
:
searchProfile
}
});
}
else
{
history
.
push
(
""
);
}
console
.
log
(
"
this.state.searchProfile
"
,
searchProfile
);
}
class
Inputs
extends
React
.
Component
{
state
=
{};
render
()
{
return
(
<>
<
section
className
=
"
section pb-0 section-components
"
>
<
Container
className
=
"
mb-5
"
>
{
/* Inputs */
}
<
h3
className
=
"
h4 text-success font-weight-bold mb-4
"
>
Inputs
<
/h3
>
<
div
className
=
"
mb-3
"
>
<
h3
className
=
"
h4 text-success font-weight-bold mb-4
"
>
Search
profile
<
/h3
>
{
/*
<div className="mb-3">
<small className="text-uppercase font-weight-bold">
Form controls
</small>
<
/div
>
</div>
*/
}
<
Row
>
<
Col
lg
=
"
4
"
sm
=
"
6
"
>
<
FormGroup
>
{
/*
<FormGroup>
<Input placeholder="Regular" type="text" />
<
/FormGroup
>
</FormGroup> */
}
<
FormGroup
className
=
{
classnames
({
focused
:
this
.
state
.
searchFocused
})}
//
className={classnames({
//
focused: this.state.searchFocused
//
})}
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
...
...
@@ -63,13 +92,20 @@ class Inputs extends React.Component {
<
Input
placeholder
=
"
Search
"
type
=
"
text
"
onFocus
=
{
e
=>
this
.
setState
({
searchFocused
:
true
})}
onBlur
=
{
e
=>
this
.
setState
({
searchFocused
:
false
})}
// onFocus={e => this.setState({ searchFocused: true })}
// onBlur={e => this.setState({ searchFocused: false })}
value
=
{
searchProfile
}
onChange
=
{
handleChangeSearch
}
/
>
<
/InputGroup
>
<
/FormGroup
>
<
Button
className
=
"
btn-1
"
color
=
"
primary
"
type
=
"
button
"
onClick
=
{
onHandleSearch
}
>
Search
<
/Button
>
<
/Col
>
<
Col
lg
=
"
4
"
sm
=
"
6
"
>
{
/* <Col lg="4" sm="6">
<FormGroup>
<Input disabled placeholder="Regular" type="text" />
</FormGroup>
...
...
@@ -108,12 +144,12 @@ class Inputs extends React.Component {
type="email"
/>
</FormGroup>
<
/Col
>
</Col>
*/
}
<
/Row
>
<
/Container
>
<
div
className
=
"
py-5 bg-secondary
"
>
{
/*
<div className="py-5 bg-secondary">
<Container>
{
/* Inputs (alternative) */
}
Inputs (alternative)
<div className="mb-3">
<small className="text-uppercase font-weight-bold">
Form controls (alternative)
...
...
@@ -199,11 +235,10 @@ class Inputs extends React.Component {
</Col>
</Row>
</Container>
<
/div
>
</div>
*/
}
<
/section
>
<
/
>
);
}
}
export
default
Inputs
;
src/views/examples/DetailProfile.js
0 → 100644
View file @
850d7b56
This diff is collapsed.
Click to expand it.
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