Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-155
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-155
2021-155
Commits
1e511967
Commit
1e511967
authored
Jul 23, 2021
by
dasunx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pagination added for automated answer
parent
f2718707
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
3 deletions
+106
-3
client/components/automated-answer-swiper/AutomatedAnswerSwiper.jsx
...ponents/automated-answer-swiper/AutomatedAnswerSwiper.jsx
+27
-0
client/components/automated-answer-swiper/AutomatedAnswerSwiper.module.css
.../automated-answer-swiper/AutomatedAnswerSwiper.module.css
+0
-0
client/components/pagination/Pagination.jsx
client/components/pagination/Pagination.jsx
+42
-0
client/components/pagination/Pagination.module.css
client/components/pagination/Pagination.module.css
+31
-0
client/components/youtube-videos/YoutubeVideoWrapper.js
client/components/youtube-videos/YoutubeVideoWrapper.js
+6
-3
No files found.
client/components/automated-answer-swiper/AutomatedAnswerSwiper.jsx
0 → 100644
View file @
1e511967
import
React
,
{
useState
}
from
'
react
'
import
Pagination
from
'
../pagination/Pagination
'
const
AutomatedAnswerSwiper
=
({
children
})
=>
{
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
0
)
const
onBtnClick
=
(
index
)
=>
{
console
.
log
(
'
here
'
+
index
)
if
(
index
<
children
.
length
)
{
setCurrentIndex
(
index
)
}
}
return
(
<
div
className=
"automated"
>
<
Pagination
currentIndex=
{
currentIndex
}
length=
{
children
.
length
}
onBtnClick=
{
onBtnClick
}
onClickFirst=
{
()
=>
setCurrentIndex
(
0
)
}
onClickLast=
{
()
=>
setCurrentIndex
(
children
.
length
-
1
)
}
/>
{
children
[
currentIndex
]
}
</
div
>
)
}
export
default
AutomatedAnswerSwiper
client/components/automated-answer-swiper/AutomatedAnswerSwiper.module.css
0 → 100644
View file @
1e511967
client/components/pagination/Pagination.jsx
0 → 100644
View file @
1e511967
import
React
from
'
react
'
import
styles
from
'
./Pagination.module.css
'
const
Pagination
=
({
currentIndex
,
length
,
onBtnClick
,
onClickFirst
,
onClickLast
})
=>
{
return
(
<
div
className=
{
styles
.
pagination_wrapper
}
>
<
span
onClick=
{
onClickFirst
}
className=
{
styles
.
cursor
}
>
first
</
span
>
<
div
className=
{
styles
.
numbering
}
>
{
new
Array
(
length
).
fill
(
0
).
map
((
item
,
index
)
=>
{
return
(
<
span
className=
{
index
==
currentIndex
?
styles
.
active_number
:
styles
.
muted_number
}
key=
{
index
}
onClick=
{
()
=>
onBtnClick
(
index
)
}
>
{
index
+
1
}
</
span
>
)
})
}
{
/* <span className={styles.active_number}>{currentIndex + 1}</span>/
<span className={styles.muted_number}>{length}</span> */
}
</
div
>
<
span
onClick=
{
onClickLast
}
className=
{
styles
.
cursor
}
>
last
</
span
>
</
div
>
)
}
export
default
Pagination
client/components/pagination/Pagination.module.css
0 → 100644
View file @
1e511967
.pagination_wrapper
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
}
.numbering
{
color
:
#999
;
*
{
margin
:
0
2px
;
cursor
:
pointer
;
}
}
.active_number
{
color
:
#fff
;
padding
:
2px
10px
;
background-color
:
#13ff625
c
;
border
:
1px
solid
#78ff78
;
}
.muted_number
{
color
:
#fff
;
padding
:
2px
10px
;
background-color
:
#5d5d5d5
c
;
border
:
1px
solid
#9c9c9c
;
}
.cursor
{
cursor
:
pointer
;
}
client/components/youtube-videos/YoutubeVideoWrapper.js
View file @
1e511967
import
React
from
'
react
'
import
AutomatedAnswerSwiper
from
'
../automated-answer-swiper/AutomatedAnswerSwiper
'
import
YoutubeVideo
from
'
./youtube-video/YoutubeVideo
'
import
styles
from
'
./YoutubeVideoWrapper.module.css
'
const
YoutubeVideoWrapper
=
({
videos
})
=>
{
...
...
@@ -9,9 +10,11 @@ const YoutubeVideoWrapper = ({ videos }) => {
youtube
<
/h1
>
<
div
className
=
{
styles
.
wrapper
}
>
{
videos
.
map
((
video
,
index
)
=>
{
return
<
YoutubeVideo
video
=
{
video
}
key
=
{
index
}
/
>
})}
<
AutomatedAnswerSwiper
>
{
videos
.
map
((
video
,
index
)
=>
{
return
<
YoutubeVideo
video
=
{
video
}
key
=
{
index
}
/
>
})}
<
/AutomatedAnswerSwiper
>
<
/div
>
<
/
>
)
...
...
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