Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
e-learning platform
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
2020-027
e-learning platform
Commits
b86f7974
Commit
b86f7974
authored
Apr 17, 2020
by
Shaini Thenuwara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View posts (frontend)
parent
6ef5898d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
Front-end/React_Frontend/src/components/Student.js
Front-end/React_Frontend/src/components/Student.js
+45
-2
Front-end/React_Frontend/src/index.css
Front-end/React_Frontend/src/index.css
+4
-0
Front-end/React_Frontend/src/index.js
Front-end/React_Frontend/src/index.js
+2
-2
No files found.
Front-end/React_Frontend/src/components/Student.js
View file @
b86f7974
import
React
,
{
Component
}
from
'
react
'
import
axios
from
'
axios
'
import
constant
from
'
../service/constant
'
;
const
CardPostNav
=
props
=>
(
<
div
>
<
div
className
=
"
card postCard
"
>
<
img
className
=
"
card-img-top
"
src
=
"
...
"
alt
=
"
Card image cap
"
/>
<
div
className
=
"
card-body
"
>
<
h5
className
=
"
card-title
"
>
Card
title
<
/h5
>
<
p
className
=
"
card-text
"
>
Some
quick
example
text
to
build
on
the
card
title
and
make
up
the
bulk
of
the
card
'
s content.</p>
<a href="#" className="btn btn-primary">Go somewhere</a>
</div>
</div>
<br/>
</div>
);
class Student extends Component {
...
...
@@ -7,18 +22,46 @@ class Student extends Component {
super(pros)
this.state = {
postList:[]
}
}
componentWillMount() {
axios.get(constant()+
'
/
post
'
)
.then(res => {
this.setState({postList: res.data});
}).catch(err => {
console.log(err);
});
}
viewCardList = () => {
return this.state.postList.map(function(value,index){
return <CardPostNav postObj={value} index={index} />;
})
}
render(){
const { postList } = this.state;
return(
<div className="container">
<
h2
>
Student
Page
<
/h2
>
<div className="panel panel-default">
<div className="panel-heading">
<h3 className="panel-title">
Login
</h3>
</div>
<div className="panel-body">
{this.viewCardList()}
<br/>
</div>
</div>
</div>
)
}
}
export default Student;
Front-end/React_Frontend/src/index.css
View file @
b86f7974
...
...
@@ -113,4 +113,8 @@ a:link {
.resultViewBtn
{
width
:
150px
;
margin-right
:
20px
;
}
.postCard
{
width
:
18rem
;
}
\ No newline at end of file
Front-end/React_Frontend/src/index.js
View file @
b86f7974
...
...
@@ -19,8 +19,8 @@ ReactDOM.render(
<
a
className
=
"
navbar-brand
"
href
=
"
#
"
><
h4
className
=
"
navBarTitle
"
>
E
-
Learning
Platform
<
/h4></
a
>
<
/nav
>
<
br
/>
<
Route
exact
path
=
'
/
'
component
=
{
CreatePost
}
/
>
{
/* <Route exact path='/' component={Login} /> */
}
{
/* <Route exact path='/' component={CreatePost} /> */
}
<
Route
exact
path
=
'
/
'
component
=
{
Login
}
/
>
<
Route
path
=
'
/Register
'
component
=
{
Register
}
/
>
<
Route
path
=
'
/App
'
component
=
{
App
}
/
>
<
Route
path
=
'
/Student
'
component
=
{
Student
}
/
>
...
...
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