Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
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
2021-049
2021-049
Commits
4c34c289
Commit
4c34c289
authored
Nov 24, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loading to Home page
parent
bb220b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+17
-2
No files found.
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
4c34c289
...
...
@@ -18,6 +18,7 @@ import TutorCard from "./HomePage/TutorCard";
import
RightSideAdd
from
"
./HomePage/AdvertisementRightSide
"
;
import
swal
from
"
sweetalert
"
;
import
Carousel
from
"
react-bootstrap/Carousel
"
;
import
{
Spinner
}
from
"
react-bootstrap
"
;
export
default
class
Home
extends
Component
{
...
...
@@ -66,7 +67,7 @@ export default class Home extends Component {
"
https://picsum.photos/200/300/?image=526
"
],
selectedImage
:
"
https://picsum.photos/200/300/?image=523
"
,
in
:
0
,
loading
:
false
};
this
.
FindCities
=
this
.
FindCities
.
bind
(
this
);
...
...
@@ -322,6 +323,10 @@ export default class Home extends Component {
FindTutor
()
{
this
.
setState
({
loading
:
true
})
const
Filters
=
{
selectedStream
:
this
.
state
.
selectedStream
,
selectedSubject
:
this
.
state
.
selectedSubject
,
...
...
@@ -408,7 +413,7 @@ export default class Home extends Component {
}
else
if
(
Number
(
tutor
.
tutor_student_count
)
===
0
)
{
valueForStudentCount
=
0
}
else
{
valueForStudentCount
=
1
0
valueForStudentCount
=
0
}
...
...
@@ -465,6 +470,7 @@ export default class Home extends Component {
TutorRecommendedFinalList
.
sort
((
a
,
b
)
=>
b
.
tutor_finalScore
-
a
.
tutor_finalScore
);
TutorOnlyFilterFinalList
.
sort
((
a
,
b
)
=>
b
.
tutor_finalScore
-
a
.
tutor_finalScore
);
this
.
setState
({
loading
:
false
,
TutorFilteredRecommendedListFinal
:
TutorRecommendedFinalList
,
TutorOnlyFilteredListFinal
:
TutorOnlyFilterFinalList
},
()
=>
{
...
...
@@ -902,6 +908,15 @@ export default class Home extends Component {
style
=
{{
background
:
'
#1E4258
'
,
marginLeft
:
'
50px
'
,
marginRight
:
'
50px
'
,
marginTop
:
'
10px
'
}}
>
<
h5
style
=
{{
color
:
"
white
"
,
float
:
'
left
'
,
margin
:
'
15px
'
}}
>
{
this
.
state
.
TutorFilteredList
.
length
}
Results
<
/h5
>
<
/div
>
{
this
.
state
.
loading
?
<
div
className
=
"
row
"
style
=
{{
justifyContent
:
'
center
'
,
padding
:
'
20px
'
}}
>
<
Spinner
animation
=
"
border
"
role
=
"
status
"
size
=
{
20
}
>
<
/Spinner
>
<
/div
>
:
<
div
><
/div
>
}
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8
"
>
{
this
.
state
.
TutorFilteredRecommendedListFinal
.
length
>
0
?
...
...
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