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
15bbb1c5
Commit
15bbb1c5
authored
Apr 26, 2020
by
Shaini Thenuwara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View post updated
parent
b86f7974
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
635 additions
and
66 deletions
+635
-66
Front-end/React_Frontend/package-lock.json
Front-end/React_Frontend/package-lock.json
+551
-12
Front-end/React_Frontend/package.json
Front-end/React_Frontend/package.json
+3
-1
Front-end/React_Frontend/src/components/Student.js
Front-end/React_Frontend/src/components/Student.js
+66
-51
Front-end/React_Frontend/src/index.css
Front-end/React_Frontend/src/index.css
+15
-2
No files found.
Front-end/React_Frontend/package-lock.json
View file @
15bbb1c5
This diff is collapsed.
Click to expand it.
Front-end/React_Frontend/package.json
View file @
15bbb1c5
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
"version"
:
"0.1.0"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"private"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@material-ui/core"
:
"^4.9.10"
,
"axios"
:
"^0.18.0"
,
"axios"
:
"^0.18.0"
,
"bootstrap"
:
"^4.
3
.1"
,
"bootstrap"
:
"^4.
4
.1"
,
"react"
:
"^16.8.6"
,
"react"
:
"^16.8.6"
,
"react-bootstrap"
:
"^1.0.0"
,
"react-bootstrap-table"
:
"^4.3.1"
,
"react-bootstrap-table"
:
"^4.3.1"
,
"react-dom"
:
"^16.8.6"
,
"react-dom"
:
"^16.8.6"
,
"react-router-dom"
:
"^5.0.0"
,
"react-router-dom"
:
"^5.0.0"
,
...
...
Front-end/React_Frontend/src/components/Student.js
View file @
15bbb1c5
import
React
,
{
Component
}
from
'
react
'
import
React
,
{
Component
}
from
'
react
'
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
constant
from
'
../service/constant
'
;
import
constant
from
'
../service/constant
'
;
import
Card
from
'
react-bootstrap/Card
'
const
CardPostNav
=
props
=>
(
import
{
makeStyles
}
from
'
@material-ui/core/styles
'
;
<
div
>
import
GridList
from
'
@material-ui/core/GridList
'
;
<
div
className
=
"
card postCard
"
>
import
GridListTile
from
'
@material-ui/core/GridListTile
'
;
<
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
{
class
Student
extends
Component
{
constructor(pros)
{
constructor
(
pros
)
{
super(pros)
super
(
pros
)
this.state = {
this
.
state
=
{
postList:[]
postList
:
[],
}
count
:
0
,
}
}
}
componentWillMount() {
componentWillMount
()
{
axios.get(constant()+
'
/
post
'
)
axios
.
get
(
constant
()
+
'
/post
'
)
.then(res => {
.
then
(
res
=>
{
this.setState({postList: res.data
});
this
.
setState
({
postList
:
res
.
data
});
}).catch(err => {
}).
catch
(
err
=>
{
console.log(err);
console
.
log
(
err
);
});
});
}
}
viewCardList = () => {
render
()
{
return this.state.postList.map(function(value,index){
return <CardPostNav postObj={value} index={index} />;
})
}
const
{
postList
}
=
this
.
state
;
render(){
const
classes
=
makeStyles
((
theme
)
=>
({
const { postList } = this.state;
root
:
{
return(
display
:
'
flex
'
,
<div className="container">
flexWrap
:
'
wrap
'
,
<div className="panel panel-default">
justifyContent
:
'
space-around
'
,
<div className="panel-heading">
overflow
:
'
hidden
'
,
<h3 className="panel-title">
backgroundColor
:
theme
.
palette
.
background
.
paper
,
Login
},
</h3>
gridList
:
{
</div>
width
:
500
,
<div className="panel-body">
height
:
450
,
{this.viewCardList()}
},
<br/>
}));
</div>
return
(
<
div
className
=
"
container
"
>
<
div
className
=
"
panel panel-default
"
>
<
div
className
=
"
panel-heading
"
>
<
h3
className
=
"
panel-title
"
>
Login
<
/h3
>
<
/div
>
<
div
className
=
"
panel-body
"
>
<
div
className
=
{
classes
.
root
}
>
<
GridList
cellHeight
=
{
500
}
className
=
{
classes
.
gridList
}
cols
=
{
3
}
>
{
postList
.
map
((
item
)
=>
(
<
GridListTile
key
=
{
item
.
img
}
cols
=
{
item
.
cols
||
1
}
>
<
Card
>
<
Card
.
Img
className
=
"
postImageSize
"
variant
=
"
top
"
src
=
{
item
.
image
}
/
>
<
Card
.
Body
>
<
Card
.
Title
>
{
item
.
title
}
<
/Card.Title
>
<
Card
.
Text
>
{
item
.
content
}
<
/Card.Text
>
<
/Card.Body
>
<
Card
.
Footer
>
<
a
href
=
"
#
"
class
=
"
btn btn-primary
"
>
Go
somewhere
<
/a
>
<
/Card.Footer
>
<
/Card
>
<
/GridListTile
>
))}
<
/GridList
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
<
/div
>
}
<
/div
>
)
}
}
}
export
default
Student
;
export
default
Student
;
Front-end/React_Frontend/src/index.css
View file @
15bbb1c5
...
@@ -116,5 +116,18 @@ a:link {
...
@@ -116,5 +116,18 @@ a:link {
}
}
.postCard
{
.postCard
{
width
:
18rem
;
width
:
20rem
;
}
}
\ No newline at end of file
.postImageSize
{
width
:
23rem
;
height
:
200px
;
}
ul
#CardView-Align
li
{
display
:
inline
;
}
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