mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
upgraded swiperjs to 8.0
This commit is contained in:
parent
ddbd51f534
commit
68bab520df
5 changed files with 36 additions and 35 deletions
|
@ -39,7 +39,7 @@
|
|||
"react-sortable-hoc": "^2.0.0",
|
||||
"react-sticky-box": "^0.9.3",
|
||||
"sass": "^1.49.0",
|
||||
"swiper": "^6.8.4",
|
||||
"swiper": "^8.0.7",
|
||||
"swr": "^1.0.1",
|
||||
"throttle-debounce": "^2.1.0",
|
||||
"typescript": "^4.0.5",
|
||||
|
|
|
@ -53,10 +53,19 @@ const NodeImageSwiperBlock: FC<IProps> = observer(({ node }) => {
|
|||
[images, controlledSwiper, showPhotoSwiper]
|
||||
);
|
||||
|
||||
// TODO: remove it if swiper 8 fixed sliding to first slide on init
|
||||
// useEffect(() => {
|
||||
// controlledSwiper?.slideTo(0, 0);
|
||||
// return () => controlledSwiper?.slideTo(0, 0);
|
||||
// }, [images, node?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
controlledSwiper?.slideTo(0, 0);
|
||||
return () => controlledSwiper?.slideTo(0, 0);
|
||||
}, [images, node?.id]);
|
||||
if (isModalActive) {
|
||||
controlledSwiper?.keyboard.disable();
|
||||
} else {
|
||||
controlledSwiper?.keyboard.enable();
|
||||
}
|
||||
}, [isModalActive]);
|
||||
|
||||
if (!images?.length) {
|
||||
return null;
|
||||
|
@ -74,14 +83,6 @@ const NodeImageSwiperBlock: FC<IProps> = observer(({ node }) => {
|
|||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (isModalActive) {
|
||||
controlledSwiper?.keyboard.disable();
|
||||
} else {
|
||||
controlledSwiper?.keyboard.enable();
|
||||
}
|
||||
}, [isModalActive]);
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<Swiper
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
@import 'photoswipe/dist/photoswipe';
|
||||
@import 'photoswipe/dist/default-skin/default-skin';
|
||||
|
||||
@import 'swiper/swiper';
|
||||
@import 'swiper/components/effect-fade/effect-fade';
|
||||
@import 'swiper/components/lazy/lazy';
|
||||
@import 'swiper/components/pagination/pagination';
|
||||
@import 'swiper/components/scrollbar/scrollbar';
|
||||
@import 'swiper/components/zoom/zoom';
|
||||
@import 'swiper/components/navigation/navigation';
|
||||
@import 'swiper/css';
|
||||
@import 'swiper/css/effect-fade';
|
||||
@import 'swiper/css/lazy';
|
||||
@import 'swiper/css/pagination';
|
||||
@import 'swiper/css/scrollbar';
|
||||
@import 'swiper/css/zoom';
|
||||
@import 'swiper/css/navigation';
|
||||
|
||||
html {
|
||||
min-height: 100vh;
|
||||
|
|
File diff suppressed because one or more lines are too long
30
yarn.lock
30
yarn.lock
|
@ -940,12 +940,12 @@ dom-accessibility-api@^0.5.6:
|
|||
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.11.tgz#79d5846c4f90eba3e617d9031e921de9324f84ed"
|
||||
integrity sha512-7X6GvzjYf4yTdRKuCVScV+aA9Fvh5r8WzWrXBH9w82ZWB/eYDMGCnazoC/YAqAzUJWHzLOnZqr46K3iEyUhUvw==
|
||||
|
||||
dom7@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-3.0.0.tgz#b861ce5d67a6becd7aaa3ad02942ff14b1240331"
|
||||
integrity sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==
|
||||
dom7@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.4.tgz#8b68c5d8e5e2ed0fddb1cb93e433bc9060c8f3fb"
|
||||
integrity sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==
|
||||
dependencies:
|
||||
ssr-window "^3.0.0-alpha.1"
|
||||
ssr-window "^4.0.0"
|
||||
|
||||
duplexer@^0.1.2:
|
||||
version "0.1.2"
|
||||
|
@ -2643,10 +2643,10 @@ sprintf-js@~1.0.2:
|
|||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
|
||||
ssr-window@^3.0.0, ssr-window@^3.0.0-alpha.1:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-3.0.0.tgz#fd5b82801638943e0cc704c4691801435af7ac37"
|
||||
integrity sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==
|
||||
ssr-window@^4.0.0, ssr-window@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
|
||||
integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==
|
||||
|
||||
string-argv@^0.3.1:
|
||||
version "0.3.1"
|
||||
|
@ -2766,13 +2766,13 @@ supports-preserve-symlinks-flag@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
||||
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
||||
|
||||
swiper@^6.8.4:
|
||||
version "6.8.4"
|
||||
resolved "https://registry.yarnpkg.com/swiper/-/swiper-6.8.4.tgz#938fed4144f4d7952fbf9c44e5832d133a4de794"
|
||||
integrity sha512-O+buF9Q+sMA0H7luMS8R59hCaJKlpo8PXhQ6ZYu6Rn2v9OsFd4d1jmrv14QvxtQpKAvL/ZiovEeANI/uDGet7g==
|
||||
swiper@^8.0.7:
|
||||
version "8.0.7"
|
||||
resolved "https://registry.yarnpkg.com/swiper/-/swiper-8.0.7.tgz#9eefe26c703e627a6dc7237c0109e172ce06e3f6"
|
||||
integrity sha512-GHjDfxSZdupfU7LrSVOpaNaT7R1D2zxopPGBFz1UOXOtsYvVJLg0k6NvkTAD7qn0ASl5pTti82qoYwvYvIkg4g==
|
||||
dependencies:
|
||||
dom7 "^3.0.0"
|
||||
ssr-window "^3.0.0"
|
||||
dom7 "^4.0.4"
|
||||
ssr-window "^4.0.2"
|
||||
|
||||
swr@^1.0.1:
|
||||
version "1.2.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue