Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web2022
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Website
web2022
Commits
da5e090a
Commit
da5e090a
authored
Aug 03, 2022
by
mxm-web-develop
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of gitlab.33.cn:Website/web2022
parents
6442694c
6380fe57
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
step.png
src/assets/img/step.png
+0
-0
EventsScrollView.tsx
src/components/EventsScrollView.tsx
+4
-0
index.tsx
src/views/About/Memorabilia/index.tsx
+27
-3
No files found.
src/assets/img/step.png
0 → 100644
View file @
da5e090a
951 Bytes
src/components/EventsScrollView.tsx
View file @
da5e090a
...
...
@@ -10,6 +10,7 @@ import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "r
interface
ScrollViewType
extends
IProps
{
wrapHeight
?:
string
;
prop
?:
any
;
getScrollHandler
?:
(
next
:
Function
,
prev
:
Function
)
=>
void
}
const
initBScroll
=
(
el
:
HTMLElement
)
=>
{
...
...
@@ -57,6 +58,9 @@ export const EventsScrollView = (props: ScrollViewType) => {
useEffect
(()
=>
{
const
scrollEl
=
initBScroll
(
wrapRef
.
current
as
HTMLDivElement
)
setScrollObj
(
scrollEl
)
if
(
props
.
getScrollHandler
)
{
props
.
getScrollHandler
(
scrollEl
.
next
,
scrollEl
.
prev
)
}
return
()
=>
{
scrollObj
?.
destroy
();
};
...
...
src/views/About/Memorabilia/index.tsx
View file @
da5e090a
import
{
IProps
}
from
"@/common/Iprops.interface"
import
{
AppContianer
}
from
"@/layouts/AppContianer"
import
{
useRef
,
useState
,
useEffect
,
useMemo
,
useCallback
}
from
'react'
import
{
useRef
,
useState
,
useEffect
,
useMemo
,
useCallback
,
Fragment
}
from
'react'
import
{
getEvents
}
from
"@/fetch/dataFetch"
import
{
EventItem
,
EventsTable
}
from
"./EventItem"
import
{
EventsScrollView
}
from
"@/components/EventsScrollView"
import
Step
from
"@/assets/img/step.png"
interface
MemorabiliaType
extends
IProps
{
...
...
@@ -22,6 +24,25 @@ export const Memorabilia = () => {
return
()
=>
fetchData
.
unsubscribe
()
},[
currentSlide
])
const
scrollHandler
:
{
next
?:
Function
prev
?:
Function
}
=
{}
const
getScrollHandler
=
(
next
:
Function
,
prev
:
Function
)
=>
{
scrollHandler
.
next
=
next
scrollHandler
.
prev
=
prev
}
const
scrollTo
=
(
step
:
number
)
=>
{
switch
(
step
)
{
case
1
:
scrollHandler
.
next
?
scrollHandler
.
next
()
:
null
;
break
case
-
1
:
scrollHandler
.
prev
?
scrollHandler
.
prev
()
:
null
;
break
}
}
return
(
<
AppContianer
className=
"flex items-center justify-start h-full w-full relative labtop:px-[120px] "
>
...
...
@@ -36,7 +57,9 @@ export const Memorabilia = () => {
</
div
>
{
data
?
<
EventsScrollView
>
<
div
className=
"relative"
>
<
img
className=
'absolute top-96 -left-16 rotate-180 opacity-30 hover:opacity-100 cursor-pointer'
onClick=
{
()
=>
scrollTo
(
-
1
)
}
src=
{
Step
}
alt=
""
/>
<
EventsScrollView
getScrollHandler=
{
getScrollHandler
}
>
<
div
className=
'flex '
>
{
data
.
length
>
0
&&
data
.
map
((
g
:
any
,
index
:
number
)
=>
(
...
...
@@ -47,12 +70,13 @@ export const Memorabilia = () => {
}
</
div
>
</
EventsScrollView
>
<
img
className=
'absolute top-96 -right-16 opacity-30 hover:opacity-100 cursor-pointer'
onClick=
{
()
=>
scrollTo
(
1
)
}
src=
{
Step
}
alt=
""
/>
</
div
>
:
<
div
>
loading
</
div
>
}
</
div
>
</
AppContianer
>
...
...
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