@ludo.ninja/components 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/graphql/index.js +3 -7
- package/build/api/server-assets/mutations/useDislikeAsset/index.js +7 -9
- package/build/api/server-assets/mutations/useLikeAsset/index.js +7 -9
- package/build/api/server-assets/queries/useFetchAssetByBlockchain/index.js +14 -21
- package/build/api/server-assets/queries/useFetchAssets/index.js +11 -14
- package/build/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +13 -15
- package/build/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +11 -13
- package/build/api/server-collection/mutations/useDislikeCollection/index.js +7 -9
- package/build/api/server-collection/mutations/useLikeCollection/index.js +7 -9
- package/build/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +19 -21
- package/build/api/server-experiences/queries/useFetchMyTasks/index.js +15 -20
- package/build/api/server-galleries/mutations/useAddAssetsToGallery/index.js +9 -12
- package/build/api/server-galleries/mutations/useAddChangeGalleryBanner/index.js +9 -13
- package/build/api/server-galleries/mutations/useAddCollectionsToGallery/index.js +9 -12
- package/build/api/server-galleries/mutations/useAddCreationsToGallery/index.js +13 -16
- package/build/api/server-galleries/mutations/useCreateFavorites/index.js +5 -8
- package/build/api/server-galleries/mutations/useCreateGallery/index.js +5 -8
- package/build/api/server-galleries/mutations/useDeleteGallery/index.js +10 -12
- package/build/api/server-galleries/mutations/useDeleteGalleryBanner/index.js +9 -13
- package/build/api/server-galleries/mutations/useEditGallery/index.js +5 -7
- package/build/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +13 -16
- package/build/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.js +12 -15
- package/build/api/server-galleries/queries/useFetchGallery/index.js +11 -18
- package/build/api/server-galleries/queries/useFetchGalleryAssets/index.js +9 -12
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +11 -17
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +13 -19
- package/build/api/server-galleries/queries/useFetchSubscribedGalleries/index.js +9 -11
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +10 -16
- package/build/api/server-identities/mutations/useAddWalletElrond/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletFlow/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletMetamask/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletSolana/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletTezos/index.js +10 -12
- package/build/api/server-identities/mutations/useFollowProfile/index.js +13 -15
- package/build/api/server-identities/mutations/useGenerateNewInviteCodes/index.js +7 -9
- package/build/api/server-identities/mutations/useInviteCode/index.js +9 -11
- package/build/api/server-identities/mutations/useRemoveWallet/index.js +10 -12
- package/build/api/server-identities/mutations/useRevokeToken/index.js +5 -7
- package/build/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +9 -11
- package/build/api/server-identities/mutations/useUnfollowProfile/index.js +13 -15
- package/build/api/server-identities/queries/useFetchProfile/index.js +19 -23
- package/build/api/server-identities/queries/useFetchUserWallets/index.js +4 -6
- package/build/api/server-medias/mutations/useDeleteUserpic/index.js +7 -9
- package/build/api/server-medias/mutations/useUploadUserpic/index.js +7 -9
- package/build/api/server-medias/queries/useFetchUserPic/index.js +8 -10
- package/build/api/server-opportunities/mutations/useDislikeOpportunity.js +8 -12
- package/build/api/server-opportunities/mutations/useLikeOpportunity.js +8 -12
- package/build/api/server-opportunities/mutations/useOpenOpportunity/index.js +8 -10
- package/build/api/server-opportunities/queries/useGetOpportunities.js +9 -13
- package/build/api/server-preferences/queries/fetchSearchResultSelections/index.js +6 -11
- package/build/api/server-preferences/queries/fetchSearchResultSelections/queryData.js +9 -13
- package/build/api/server-search/queries/useFetchAllCreations/index.js +15 -23
- package/build/api/server-search/queries/useFetchAssetsCount/index.js +2 -4
- package/build/api/server-search/queries/useFetchCollection/index.js +16 -23
- package/build/api/server-search/queries/useFetchCollections/index.js +16 -23
- package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +18 -24
- package/build/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +16 -24
- package/build/api/server-search/queries/useFetchNetWorth/index.js +7 -9
- package/build/api/server-search/queries/useFindCreations/index.js +20 -28
- package/build/api/server-search/queries/useFindProfilesByName/index.js +14 -19
- package/build/api/server-search/queries/useFindShowcaseItems/index.js +1 -3
- package/build/api/server-search/queries/useFindUserCreations/index.js +16 -21
- package/build/api/server-search/queries/useFindUserShowcaseItems/index.js +1 -3
- package/build/api/subscriptions/SubscriberInviteNotification.js +18 -22
- package/build/components/assetPage/assetLikes/index.js +25 -30
- package/build/components/assetPage/assetNft/index.js +14 -21
- package/build/components/assetPage/audioVideoPlayer/Duration.js +5 -8
- package/build/components/assetPage/audioVideoPlayer/index.js +51 -81
- package/build/components/assetPage/category/index.js +18 -25
- package/build/components/assetPage/description/index.js +17 -24
- package/build/components/assetPage/index.js +11 -25
- package/build/components/assetPage/information/index.js +43 -50
- package/build/components/assetPage/marketPlaces/index.js +26 -33
- package/build/components/assetPage/media/AssetImage/index.js +52 -80
- package/build/components/assetPage/moreDropDown/index.js +47 -77
- package/build/components/assetPage/participants/index.js +64 -71
- package/build/components/assetPage/priceRank/index.js +38 -45
- package/build/components/assetPage/properties/index.js +19 -26
- package/build/components/assetPage/slider/index.js +44 -51
- package/build/components/assetPage/slider/slideItem.js +14 -21
- package/build/components/assetPage/slider/store.js +2 -5
- package/build/components/assetPage/tittle/index.js +32 -39
- package/build/components/assetPage/viewer3D/index.js +50 -58
- package/build/components/base/Meta/index.js +6 -11
- package/build/components/base/NoSSR/index.js +4 -9
- package/build/components/favoriteList/add/addCreationToFavoriteList/index.js +14 -19
- package/build/components/gallery/add/addCreationToGallery/index.js +20 -25
- package/build/components/headers/components/headerExperienceLabel/index.js +12 -17
- package/build/components/headers/components/headerUserPic/index.js +11 -16
- package/build/components/headers/header/index.js +17 -22
- package/build/components/headers/headerSearch/index.js +21 -26
- package/build/components/headers/headerSimple/index.js +14 -19
- package/build/components/linkTabs/index.js +14 -19
- package/build/components/linkTabs/linkTab/index.js +22 -27
- package/build/components/profile/profileSkeleton/index.js +10 -18
- package/build/components/search/SearchInputContainer.js +61 -91
- package/build/components/search/searchCloseMoreButtons/index.js +20 -25
- package/build/components/search/searchSimpleInput/index.js +37 -65
- package/build/components/search/searchSuggestions/index.js +32 -37
- package/build/components/search/searchSuggestions/searchSuggestionsCaption/index.js +17 -22
- package/build/components/search/searchSuggestions/searchSuggestionsFooter/index.js +20 -25
- package/build/components/search/searchSuggestions/searchSuggestionsItem/index.js +29 -34
- package/build/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.js +28 -58
- package/build/components/search/searchSuggestions/searchSuggestionsNotFound/index.js +19 -24
- package/build/components/searchFiltersConnector/filters/applyResetBtns/index.js +11 -16
- package/build/components/searchFiltersConnector/filters/galleriesFiltersForm/index.js +13 -18
- package/build/components/searchFiltersConnector/filters/index.js +38 -43
- package/build/components/searchFiltersConnector/filters/mobileFilters/index.js +5 -10
- package/build/components/searchFiltersConnector/filters/setsFiltersForm/index.js +12 -17
- package/build/components/searchFiltersConnector/index.js +12 -19
- package/build/components/sidebar/data.js +18 -26
- package/build/components/sidebar/index.js +59 -87
- package/build/components/sidebar/initializer.js +4 -34
- package/build/components/sidebar/sidebarFilters/index.js +8 -13
- package/build/components/sidebar/sidebarInviteCodeLabel/index.js +14 -19
- package/build/components/toTopBtn/index.js +32 -39
- package/build/dto/AssetEntity/index.js +19 -24
- package/build/dto/AssetEntity/interface.js +1 -2
- package/build/dto/AssetEntity/views/AssetAudio/index.js +11 -16
- package/build/dto/AssetEntity/views/AssetImage/index.js +12 -17
- package/build/dto/AssetEntity/views/AssetObject/index.js +13 -18
- package/build/dto/AssetEntity/views/AssetOther/index.js +13 -18
- package/build/dto/AssetEntity/views/AssetScreenshot/index.js +12 -17
- package/build/dto/AssetEntity/views/AssetVideo/index.js +11 -16
- package/build/dto/AssetEntity/views/index.js +6 -16
- package/build/dto/Collection/CollectionCreationEntity/index.js +22 -27
- package/build/dto/Collection/CollectionCreationEntity/interface.js +1 -2
- package/build/dto/Collection/CollectionEntity/index.js +5 -7
- package/build/dto/Collection/CollectionEntity/interface.js +1 -2
- package/build/dto/CreationEntity/index.js +19 -24
- package/build/dto/CreationEntity/interface.js +1 -2
- package/build/dto/GalleryEntityV2/index.js +5 -10
- package/build/dto/GalleryEntityV2/interface.js +1 -2
- package/build/dto/Theme/interface.js +1 -5
- package/build/dto/common/ItemType/data.js +26 -28
- package/build/dto/common/ItemType/index.js +5 -7
- package/build/dto/common/ItemViews/CreationAudio/index.js +11 -16
- package/build/dto/common/ItemViews/CreationImage/index.js +12 -17
- package/build/dto/common/ItemViews/CreationObject/index.js +10 -15
- package/build/dto/common/ItemViews/CreationOther/index.js +11 -16
- package/build/dto/common/ItemViews/CreationVideo/index.js +11 -16
- package/build/dto/common/Media/Audio/index.js +9 -14
- package/build/dto/common/Media/Image/index.js +10 -15
- package/build/dto/common/Media/Object/index.js +9 -14
- package/build/dto/common/Media/Other/index.js +14 -19
- package/build/dto/common/Media/Screenshot/index.js +10 -15
- package/build/dto/common/Media/Urls/index.js +23 -38
- package/build/dto/common/Media/Video/index.js +9 -14
- package/build/dto/common/Media/index.js +3 -5
- package/build/dto/common/Media/interface.js +1 -2
- package/build/entities/user/type.js +1 -2
- package/build/fonts/FontsInitializeLayout.js +13 -16
- package/build/fonts/vars.js +1 -6
- package/build/hooks/apollo/index.js +8 -11
- package/build/hooks/audio/useMultiAudio/index.js +10 -12
- package/build/hooks/extension/useExtension/index.js +8 -10
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +33 -39
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +32 -39
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +32 -39
- package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +27 -34
- package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +26 -32
- package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +23 -29
- package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +27 -34
- package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +30 -36
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.js +11 -13
- package/build/hooks/likes/dynamic/useGetTableLikes.js +24 -30
- package/build/hooks/likes/index.js +27 -32
- package/build/hooks/likes/useGetLikesAsset.js +20 -24
- package/build/layouts/GlobalLayout.js +24 -31
- package/build/layouts/base/LWithRegularHeader/index.js +7 -12
- package/build/layouts/base/LWithRegularHeader/type.js +1 -2
- package/build/layouts/base/LWithSearchHeader/index.js +5 -10
- package/build/layouts/base/LWithSearchHeader/type.js +1 -2
- package/build/layouts/custom/mainLayout/index.js +8 -13
- package/build/layouts/custom/styles.js +15 -21
- package/build/layouts/pageTransitionLayout.js +6 -8
- package/build/layouts/pageWithLayout.js +1 -2
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +35 -42
- package/build/modules/gallery/api/useGetFavoriteGallery.js +11 -15
- package/build/modules/gallery/store.js +10 -16
- package/build/modules/gallery/ui/AllResults.js +7 -11
- package/build/modules/gallery/ui/Description.js +24 -31
- package/build/modules/gallery/ui/EditGallery.js +15 -22
- package/build/modules/gallery/ui/GalleryDeleteIcon.js +12 -19
- package/build/modules/gallery/ui/PlaceholderItemsGallery.js +21 -28
- package/build/modules/gallery/ui/STopSections.js +10 -16
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +25 -30
- package/build/modules/gallery/ui/chooseGalleryItems/index.js +47 -52
- package/build/modules/gallery/ui/createGalleryForm/index.js +31 -36
- package/build/modules/gallery/ui/editGalleryForm/index.js +40 -45
- package/build/modules/gallery/ui/itemsPreview/index.js +54 -61
- package/build/modules/gallery/useToGalleryAsset.js +15 -23
- package/build/modules/notifications/CreatorNotifications.js +10 -40
- package/build/modules/notifications/index.js +3 -6
- package/build/modules/opportunity/OpportunityCard.js +81 -88
- package/build/modules/opportunity/OpportunityDropDown.js +11 -18
- package/build/modules/opportunity/ShareIcon.js +2 -6
- package/build/modules/opportunity/encodeQuery.js +4 -10
- package/build/modules/opportunity/popup/CopyIcon.js +3 -5
- package/build/modules/opportunity/popup/FacebookIcon.js +3 -5
- package/build/modules/opportunity/popup/LinkedInIcon.js +3 -5
- package/build/modules/opportunity/popup/LogoXIcon.js +3 -5
- package/build/modules/opportunity/popup/OpportunityMenu.js +44 -51
- package/build/modules/opportunity/type.js +1 -2
- package/build/modules/sessionScroll/globalTabs.js +1 -4
- package/build/modules/sessionScroll/index.js +16 -23
- package/build/modules/sessionScroll/type.js +1 -2
- package/build/modules/sessionScroll/useVirtuosoInitialScroll.js +12 -16
- package/build/modules/user/auth/useAuthVerification.js +10 -37
- package/build/modules/user/auth/useSignIn.js +7 -11
- package/build/modules/user/auth/useSignOut.js +11 -18
- package/build/modules/user/profileData/profileDataInitialization.js +14 -18
- package/build/modules/user/store.js +9 -12
- package/build/modules/virtuoso/VirtuosoPageBuilder.js +36 -43
- package/build/modules/virtuoso/VirtuosoToTopBtn.js +8 -13
- package/build/modules/virtuoso/types.js +1 -2
- package/build/modules/virtuoso/useSubscribeVirtuosoScrollToHeader.js +4 -8
- package/build/modules/virtuoso/useVirtuosoData.js +6 -10
- package/build/store/env/index.js +4 -7
- package/build/store/index.js +4 -7
- package/build/store/media/index.js +4 -7
- package/build/store/media/types.js +1 -2
- package/build/store/ui/index.js +21 -24
- package/build/store/ui/types.js +1 -2
- package/build/store/ui/utils.js +4 -8
- package/build/styles/ScreenWidth.js +3 -6
- package/build/styles/animations/index.js +3 -6
- package/build/styles/colors/index.js +1 -38
- package/build/styles/globalStyles.js +5 -7
- package/build/styles/mixins/boxShadow.js +3 -5
- package/build/styles/mixins/boxTransform.js +3 -5
- package/build/styles/mixins/z-indexes.js +10 -13
- package/build/styles/typography/index.js +1 -13
- package/build/system/ActiveLink/ActiveLink.test.js +14 -19
- package/build/system/ActiveLink/index.js +10 -38
- package/build/system/Alert/index.js +6 -11
- package/build/system/Alert/type.js +1 -8
- package/build/system/BasicOverlay/index.js +5 -10
- package/build/system/Buttons/IconButton/index.js +2 -7
- package/build/system/Buttons/IconWithButton/index.js +2 -7
- package/build/system/Buttons/MainButton/index.js +2 -7
- package/build/system/Buttons/SecondaryButton/index.js +2 -7
- package/build/system/Cards/CardCheckbox/CardCheckbox.test.js +8 -13
- package/build/system/Cards/CardCheckbox/index.js +19 -24
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +11 -16
- package/build/system/Cards/CardContent/CardCategory/index.js +13 -18
- package/build/system/Cards/CardContent/CardContent.test.js +31 -36
- package/build/system/Cards/CardContent/CardLikes/CardLikes.test.js +11 -16
- package/build/system/Cards/CardContent/CardLikes/index.js +11 -16
- package/build/system/Cards/CardContent/CardShowMore/CardShowMore.test.js +20 -25
- package/build/system/Cards/CardContent/CardShowMore/index.js +34 -40
- package/build/system/Cards/CardContent/index.js +32 -37
- package/build/system/Cards/CardMedia/CardAudio/CardAudio.test.js +35 -40
- package/build/system/Cards/CardMedia/CardAudio/index.js +18 -23
- package/build/system/Cards/CardMedia/CardImage/CardImage.test.js +14 -19
- package/build/system/Cards/CardMedia/CardImage/index.js +8 -13
- package/build/system/Cards/CardMedia/CardVideo/index.js +17 -22
- package/build/system/Cards/CardRank/index.js +32 -37
- package/build/system/Cards/CreationCard/CardHead.js +35 -42
- package/build/system/Cards/CreationCard/index.js +45 -76
- package/build/system/Cards/MultiMediaCard/index.js +30 -35
- package/build/system/Cards/Styles/Content.js +9 -14
- package/build/system/Cards/Styles/Head.js +8 -13
- package/build/system/Cards/Styles/Headicons.js +23 -28
- package/build/system/Cards/Styles/Image.js +8 -13
- package/build/system/Cards/Styles/Likes.js +14 -19
- package/build/system/Cards/Styles/MultiHead.js +11 -16
- package/build/system/Cards/Styles/Video.js +3 -8
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsError/index.js +14 -19
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.js +10 -15
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.js +17 -24
- package/build/system/CardsHolderWithSkeleton/CardsHolderLoader/index.js +15 -20
- package/build/system/DropDown/DropDown.test.js +14 -19
- package/build/system/DropDown/index.js +12 -17
- package/build/system/Filters/helpers.js +1 -5
- package/build/system/Filters/type.js +2 -5
- package/build/system/Forms/Checkbox/Checkbox.test.js +13 -18
- package/build/system/Forms/Checkbox/index.js +16 -21
- package/build/system/Forms/DatePicker/index.js +46 -51
- package/build/system/Forms/ErrorLabel/ErrorLabel.test.js +11 -16
- package/build/system/Forms/ErrorLabel/index.js +10 -15
- package/build/system/Forms/Input/Input.test.js +13 -18
- package/build/system/Forms/Input/index.js +29 -35
- package/build/system/Forms/Input/type.js +1 -2
- package/build/system/Forms/Messages/index.js +1 -3
- package/build/system/Forms/RadioInput/index.js +12 -17
- package/build/system/Forms/Selects/DesktopSelect/index.js +41 -69
- package/build/system/Forms/Selects/DesktopSelect/type.js +1 -2
- package/build/system/Forms/Selects/MobileSelect/index.js +10 -15
- package/build/system/Forms/TextArea/TextArea.test.js +13 -18
- package/build/system/Forms/TextArea/index.js +26 -31
- package/build/system/Forms/index.js +5 -14
- package/build/system/Img/ExternalImage/index.js +11 -17
- package/build/system/Img/ImageInterceptor/ImageInterceptor.test.js +18 -23
- package/build/system/Img/ImageInterceptor/index.js +10 -40
- package/build/system/Img/Profilepic/index.js +12 -19
- package/build/system/Img/Userpic/UserPic.test.js +15 -20
- package/build/system/Img/Userpic/index.js +28 -33
- package/build/system/Img/index.js +3 -19
- package/build/system/Labels/ExperienceLabel/ExperienceLabel.test.js +12 -17
- package/build/system/Labels/ExperienceLabel/index.js +27 -32
- package/build/system/Labels/InviteLabel/InviteLabel.test.js +10 -15
- package/build/system/Labels/InviteLabel/index.js +14 -19
- package/build/system/Labels/SkeletonLabel/index.js +2 -7
- package/build/system/Modals/Modal/Modal.test.js +11 -16
- package/build/system/Modals/Modal/index.js +24 -29
- package/build/system/Modals/ModalSidebar/CreatorModalSidebarPortal.js +7 -37
- package/build/system/Modals/ModalSidebar/ModalSidebar.test.js +11 -16
- package/build/system/Modals/ModalSidebar/ModalSidebarPortal.js +5 -9
- package/build/system/Modals/ModalSidebar/index.js +23 -29
- package/build/system/Overlay/Overlay.test.js +11 -16
- package/build/system/Overlay/index.js +11 -16
- package/build/system/PageLoader/index.js +2 -7
- package/build/system/Palete/index.js +2 -7
- package/build/system/ShareIconResize.js +14 -21
- package/build/system/Tabs/TabNavLink/TabNavLink.test.js +15 -20
- package/build/system/Tabs/TabNavLink/index.js +17 -23
- package/build/system/Tabs/TabsNav/TabsNav.test.js +18 -23
- package/build/system/Tabs/TabsNav/index.js +7 -13
- package/build/system/Tabs/TabsNav/type.js +1 -2
- package/build/system/Tabs/TabsPanel/TabsPanel.test.js +13 -18
- package/build/system/Tabs/TabsPanel/index.js +5 -10
- package/build/system/index.js +6 -22
- package/build/system/theme.js +1 -7
- package/build/utils/3d.js +1 -5
- package/build/utils/adaptive/check4k.js +5 -9
- package/build/utils/adaptive/scale.js +5 -9
- package/build/utils/auth/index.js +3 -7
- package/build/utils/copyBtn/index.js +23 -30
- package/build/utils/env/index.js +1 -5
- package/build/utils/extractItemIds.js +3 -9
- package/build/utils/getDimensionsImage.js +1 -5
- package/build/utils/getPageSizeAssets.js +4 -8
- package/build/utils/imageProportionsSize/index.js +1 -5
- package/build/utils/screen/index.js +24 -30
- package/build/utils/seacrhTabs.js +1 -4
- package/build/utils/ssrFunctions/index.js +9 -15
- package/build/utils/ui/index.js +1 -5
- package/package.json +1 -1
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const router_1 = require("next/router");
|
|
6
|
-
const traditional_1 = require("zustand/traditional");
|
|
7
|
-
const utils_1 = require("@ludo.ninja/utils");
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { createWithEqualityFn } from 'zustand/traditional';
|
|
4
|
+
import { getSessionKey, isServer } from '@ludo.ninja/utils';
|
|
8
5
|
const sessionKey = 'scrollPositions';
|
|
9
|
-
const getScrollKeys = () => {
|
|
10
|
-
const result =
|
|
6
|
+
export const getScrollKeys = () => {
|
|
7
|
+
const result = getSessionKey(sessionKey);
|
|
11
8
|
if (result) {
|
|
12
9
|
return JSON.parse(result);
|
|
13
10
|
}
|
|
14
11
|
return null;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
const removeScrollKeys = () => {
|
|
13
|
+
export const removeScrollKeys = () => {
|
|
18
14
|
sessionStorage.removeItem(sessionKey);
|
|
19
15
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (utils_1.isServer)
|
|
16
|
+
export const setScrollKeys = (data) => {
|
|
17
|
+
if (isServer)
|
|
23
18
|
return;
|
|
24
|
-
|
|
19
|
+
removeScrollKeys();
|
|
25
20
|
sessionStorage.setItem(sessionKey, JSON.stringify(data));
|
|
26
21
|
};
|
|
27
|
-
|
|
28
|
-
exports.useScrollState = (0, traditional_1.createWithEqualityFn)()((setState, getState) => ({
|
|
22
|
+
export const useScrollState = createWithEqualityFn()((setState, getState) => ({
|
|
29
23
|
isHandleUpdateScroll: false,
|
|
30
24
|
setIsHandleUpdateScroll: (isHandleUpdateScroll) => {
|
|
31
25
|
setState({ isHandleUpdateScroll });
|
|
@@ -37,7 +31,7 @@ exports.useScrollState = (0, traditional_1.createWithEqualityFn)()((setState, ge
|
|
|
37
31
|
removeScrollKeysWithCheckRoute: (url) => {
|
|
38
32
|
const { isHandleUpdateScroll, backRoute } = getState();
|
|
39
33
|
if (!isHandleUpdateScroll && url !== backRoute) {
|
|
40
|
-
|
|
34
|
+
removeScrollKeys();
|
|
41
35
|
}
|
|
42
36
|
else {
|
|
43
37
|
setState({
|
|
@@ -47,10 +41,10 @@ exports.useScrollState = (0, traditional_1.createWithEqualityFn)()((setState, ge
|
|
|
47
41
|
},
|
|
48
42
|
}));
|
|
49
43
|
// custom Component Interceptor scroll state without global page rerender in effect
|
|
50
|
-
const DeleteScrollStateInterceptor = () => {
|
|
51
|
-
const removeScrollKeysWithCheckRoute =
|
|
52
|
-
const router =
|
|
53
|
-
|
|
44
|
+
export const DeleteScrollStateInterceptor = () => {
|
|
45
|
+
const removeScrollKeysWithCheckRoute = useScrollState((state) => state.removeScrollKeysWithCheckRoute);
|
|
46
|
+
const router = useRouter();
|
|
47
|
+
useEffect(() => {
|
|
54
48
|
router.events.on('routeChangeStart', removeScrollKeysWithCheckRoute);
|
|
55
49
|
return () => {
|
|
56
50
|
router.events.off('routeChangeStart', removeScrollKeysWithCheckRoute);
|
|
@@ -58,4 +52,3 @@ const DeleteScrollStateInterceptor = () => {
|
|
|
58
52
|
}, []);
|
|
59
53
|
return null;
|
|
60
54
|
};
|
|
61
|
-
exports.DeleteScrollStateInterceptor = DeleteScrollStateInterceptor;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const scrollTop = (0, react_1.useRef)(0);
|
|
9
|
-
const isFirstScrolling = (0, react_1.useRef)(true);
|
|
10
|
-
const { setIsHandleUpdateScroll, setBackRoute } = (0, index_1.useScrollState)((state) => ({
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { getScrollKeys, setScrollKeys, useScrollState } from './index';
|
|
4
|
+
export const useVirtuosoInitialScroll = ({ virtuosoData, activeTab, virtuoso, }) => {
|
|
5
|
+
const scrollTop = useRef(0);
|
|
6
|
+
const isFirstScrolling = useRef(true);
|
|
7
|
+
const { setIsHandleUpdateScroll, setBackRoute } = useScrollState((state) => ({
|
|
11
8
|
setIsHandleUpdateScroll: state.setIsHandleUpdateScroll,
|
|
12
9
|
setBackRoute: state.setBackRoute,
|
|
13
10
|
}));
|
|
14
|
-
const router =
|
|
15
|
-
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
useEffect(() => {
|
|
16
13
|
if (virtuosoData.creations.length) {
|
|
17
14
|
if (activeTab && activeTab.value && isFirstScrolling.current) {
|
|
18
|
-
const scrollKeys =
|
|
15
|
+
const scrollKeys = getScrollKeys();
|
|
19
16
|
if (scrollKeys) {
|
|
20
17
|
const scrollPosition = scrollKeys[activeTab.value]?.pageOffsetKey;
|
|
21
18
|
const scrollIndex = scrollKeys[activeTab.value]?.itemIndexKey;
|
|
@@ -31,7 +28,7 @@ const useVirtuosoInitialScroll = ({ virtuosoData, activeTab, virtuoso, }) => {
|
|
|
31
28
|
// });
|
|
32
29
|
}
|
|
33
30
|
delete scrollKeys[activeTab.value];
|
|
34
|
-
|
|
31
|
+
setScrollKeys(scrollKeys);
|
|
35
32
|
isFirstScrolling.current = false;
|
|
36
33
|
}
|
|
37
34
|
}
|
|
@@ -41,7 +38,7 @@ const useVirtuosoInitialScroll = ({ virtuosoData, activeTab, virtuoso, }) => {
|
|
|
41
38
|
updateScroll: (index) => {
|
|
42
39
|
if (activeTab && activeTab.value) {
|
|
43
40
|
setIsHandleUpdateScroll(true);
|
|
44
|
-
|
|
41
|
+
setScrollKeys({
|
|
45
42
|
[activeTab.value]: {
|
|
46
43
|
pageOffsetKey: scrollTop.current,
|
|
47
44
|
itemsCountKey: virtuosoData.creations.length,
|
|
@@ -56,4 +53,3 @@ const useVirtuosoInitialScroll = ({ virtuosoData, activeTab, virtuoso, }) => {
|
|
|
56
53
|
},
|
|
57
54
|
};
|
|
58
55
|
};
|
|
59
|
-
exports.useVirtuosoInitialScroll = useVirtuosoInitialScroll;
|
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useAuthVerification = void 0;
|
|
27
|
-
const react_1 = require("react");
|
|
28
|
-
const router_1 = require("next/router");
|
|
29
|
-
const useSignIn_1 = require("./useSignIn");
|
|
30
|
-
const useSignOut_1 = require("./useSignOut");
|
|
31
|
-
const useAuthVerification = () => {
|
|
32
|
-
const router = (0, router_1.useRouter)();
|
|
33
|
-
const signIn = (0, useSignIn_1.useSignIn)();
|
|
34
|
-
const signOut = (0, useSignOut_1.useSignOut)();
|
|
35
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { useSignIn } from "./useSignIn";
|
|
4
|
+
import { useSignOut } from "./useSignOut";
|
|
5
|
+
export const useAuthVerification = () => {
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
const signIn = useSignIn();
|
|
8
|
+
const signOut = useSignOut();
|
|
9
|
+
useEffect(() => {
|
|
36
10
|
const verification = async () => {
|
|
37
11
|
try {
|
|
38
|
-
const authCookies = await
|
|
12
|
+
const authCookies = await import('@ludo.ninja/api/build/cookies'); //update check version cookie in client
|
|
39
13
|
const authCookiesParsed = authCookies.getCookies();
|
|
40
14
|
if (authCookiesParsed.authToken &&
|
|
41
15
|
authCookiesParsed.wallets &&
|
|
@@ -71,4 +45,3 @@ const useAuthVerification = () => {
|
|
|
71
45
|
};
|
|
72
46
|
}, [router.query]);
|
|
73
47
|
};
|
|
74
|
-
exports.useAuthVerification = useAuthVerification;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const useSignIn = () => {
|
|
8
|
-
const setUser = (0, store_1.useUserStore)((state) => state.setUser);
|
|
9
|
-
const NEXT_PUBLIC_ENV_DOMAIN = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_DOMAIN);
|
|
1
|
+
import { authCookies } from '@ludo.ninja/api';
|
|
2
|
+
import { useUserStore } from "../store";
|
|
3
|
+
import { useEnvStore } from "../../../store/env";
|
|
4
|
+
export const useSignIn = () => {
|
|
5
|
+
const setUser = useUserStore((state) => state.setUser);
|
|
6
|
+
const NEXT_PUBLIC_ENV_DOMAIN = useEnvStore((state) => state.NEXT_PUBLIC_ENV_DOMAIN);
|
|
10
7
|
return (user) => {
|
|
11
8
|
setUser({
|
|
12
9
|
userId: user.userId,
|
|
@@ -17,7 +14,6 @@ const useSignIn = () => {
|
|
|
17
14
|
inviteCode: user.inviteCode,
|
|
18
15
|
role: user.role,
|
|
19
16
|
});
|
|
20
|
-
|
|
17
|
+
authCookies.assignCookies(user.userId, user.wallets, user.authToken, user.refreshToken, user.newUser.toString(), user.inviteCode, user.role, NEXT_PUBLIC_ENV_DOMAIN);
|
|
21
18
|
};
|
|
22
19
|
};
|
|
23
|
-
exports.useSignIn = useSignIn;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const api_1 = require("@ludo.ninja/api");
|
|
9
|
-
const env_1 = require("../../../store/env");
|
|
10
|
-
const useRevokeToken_1 = __importDefault(require("../../../api/server-identities/mutations/useRevokeToken"));
|
|
11
|
-
const store_1 = require("../store");
|
|
12
|
-
const useSignOut = () => {
|
|
13
|
-
const { NEXT_PUBLIC_WELCOME_HOST, NEXT_PUBLIC_ENV_DOMAIN } = (0, env_1.useEnvStore)((state) => ({
|
|
1
|
+
import { destroyCookie } from 'nookies';
|
|
2
|
+
import { authCookies } from '@ludo.ninja/api';
|
|
3
|
+
import { useEnvStore } from "../../../store/env";
|
|
4
|
+
import useRevokeToken from "../../../api/server-identities/mutations/useRevokeToken";
|
|
5
|
+
import { useUserStore } from '../store';
|
|
6
|
+
export const useSignOut = () => {
|
|
7
|
+
const { NEXT_PUBLIC_WELCOME_HOST, NEXT_PUBLIC_ENV_DOMAIN } = useEnvStore((state) => ({
|
|
14
8
|
NEXT_PUBLIC_WELCOME_HOST: state.NEXT_PUBLIC_WELCOME_HOST,
|
|
15
9
|
NEXT_PUBLIC_ENV_DOMAIN: state.NEXT_PUBLIC_ENV_DOMAIN,
|
|
16
10
|
}));
|
|
17
|
-
const { revokeToken } = (
|
|
18
|
-
const setUser =
|
|
11
|
+
const { revokeToken } = useRevokeToken();
|
|
12
|
+
const setUser = useUserStore((state) => state.setUser);
|
|
19
13
|
return async () => {
|
|
20
14
|
try {
|
|
21
15
|
await revokeToken();
|
|
@@ -24,8 +18,8 @@ const useSignOut = () => {
|
|
|
24
18
|
//====
|
|
25
19
|
}
|
|
26
20
|
finally {
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
authCookies.destroyCookies(NEXT_PUBLIC_ENV_DOMAIN);
|
|
22
|
+
destroyCookie(null, 'authMultiversXWallet', {
|
|
29
23
|
path: '/',
|
|
30
24
|
domain: NEXT_PUBLIC_ENV_DOMAIN,
|
|
31
25
|
});
|
|
@@ -34,4 +28,3 @@ const useSignOut = () => {
|
|
|
34
28
|
}
|
|
35
29
|
};
|
|
36
30
|
};
|
|
37
|
-
exports.useSignOut = useSignOut;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
8
|
-
const store_1 = require("../store");
|
|
9
|
-
const ui_1 = require("../../../store/ui");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { hosts } from '@ludo.ninja/api';
|
|
3
|
+
import { identitySchema } from '@ludo.ninja/api';
|
|
4
|
+
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
5
|
+
import { useUserStore } from "../store";
|
|
6
|
+
import { useUiStore } from "../../../store/ui";
|
|
10
7
|
const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
11
|
-
const openAlert =
|
|
8
|
+
const openAlert = useUiStore((state) => state.openAlert);
|
|
12
9
|
const { setIsLoadingProfileData, setProfileData,
|
|
13
10
|
// profileData,
|
|
14
|
-
setUserExp, setInviteCodes, } =
|
|
11
|
+
setUserExp, setInviteCodes, } = useUserStore((state) => ({
|
|
15
12
|
setIsLoadingProfileData: state.setIsLoadingProfileData,
|
|
16
13
|
setProfileData: state.setProfileData,
|
|
17
14
|
profileData: state.profileData,
|
|
@@ -19,9 +16,9 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
19
16
|
setInviteCodes: state.setInviteCodes,
|
|
20
17
|
}));
|
|
21
18
|
// console.log('profileData', profileData);
|
|
22
|
-
|
|
19
|
+
identitySchema.useFetchMyProfileV2Query({
|
|
23
20
|
context: {
|
|
24
|
-
uri:
|
|
21
|
+
uri: hosts.identityHost,
|
|
25
22
|
},
|
|
26
23
|
onCompleted: ({ fetchMyProfileV2: fetchMyProfile }) => {
|
|
27
24
|
// console.log('fetchMyProfile', fetchMyProfile);
|
|
@@ -41,7 +38,7 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
41
38
|
},
|
|
42
39
|
onError: (err) => {
|
|
43
40
|
openAlert({
|
|
44
|
-
type:
|
|
41
|
+
type: alertVariants.error,
|
|
45
42
|
caption: err.message,
|
|
46
43
|
});
|
|
47
44
|
setProfileData(null);
|
|
@@ -50,10 +47,9 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
50
47
|
});
|
|
51
48
|
return null;
|
|
52
49
|
};
|
|
53
|
-
const ProfileDataInitialization = () => {
|
|
54
|
-
const userId =
|
|
50
|
+
export const ProfileDataInitialization = () => {
|
|
51
|
+
const userId = useUserStore((state) => state.user?.userId);
|
|
55
52
|
if (!userId)
|
|
56
53
|
return null;
|
|
57
|
-
return (
|
|
54
|
+
return _jsx(FetcherMyProfile, {});
|
|
58
55
|
};
|
|
59
|
-
exports.ProfileDataInitialization = ProfileDataInitialization;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const next_zustand_1 = require("next-zustand");
|
|
5
|
-
const shallow_1 = require("zustand/shallow");
|
|
6
|
-
const core_1 = require("@ludo.ninja/core");
|
|
1
|
+
import { createProvider } from 'next-zustand';
|
|
2
|
+
import { shallow } from 'zustand/shallow';
|
|
3
|
+
import { ProfileEntity } from '@ludo.ninja/core';
|
|
7
4
|
const initialUserExp = {
|
|
8
5
|
xps: 0,
|
|
9
6
|
level: 1,
|
|
10
7
|
levelMaxXps: 0,
|
|
11
8
|
levelMinXps: 0,
|
|
12
9
|
};
|
|
13
|
-
const creators =
|
|
10
|
+
const creators = createProvider()((setState) => ({
|
|
14
11
|
user: null,
|
|
15
12
|
isSignedIn: false,
|
|
16
13
|
setUser: (user) => {
|
|
@@ -44,7 +41,7 @@ const creators = (0, next_zustand_1.createProvider)()((setState) => ({
|
|
|
44
41
|
};
|
|
45
42
|
return {
|
|
46
43
|
profileObject: newProfileObject,
|
|
47
|
-
profileData: new
|
|
44
|
+
profileData: new ProfileEntity(newProfileObject),
|
|
48
45
|
};
|
|
49
46
|
});
|
|
50
47
|
},
|
|
@@ -52,7 +49,7 @@ const creators = (0, next_zustand_1.createProvider)()((setState) => ({
|
|
|
52
49
|
setProfileData: (profileObject) => {
|
|
53
50
|
if (profileObject) {
|
|
54
51
|
setState({
|
|
55
|
-
profileData: new
|
|
52
|
+
profileData: new ProfileEntity(profileObject),
|
|
56
53
|
profileObject,
|
|
57
54
|
});
|
|
58
55
|
}
|
|
@@ -68,6 +65,6 @@ const creators = (0, next_zustand_1.createProvider)()((setState) => ({
|
|
|
68
65
|
setInviteCodes: (inviteCodes) => {
|
|
69
66
|
setState({ inviteCodes });
|
|
70
67
|
},
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
}), shallow);
|
|
69
|
+
export const UserProvider = creators.Provider;
|
|
70
|
+
export const useUserStore = creators.getUseStore();
|
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
18
|
-
const CardsError_1 = __importDefault(require("../../system/CardsHolderWithSkeleton/CardsHolder/CardsError"));
|
|
19
|
-
const CardsNoResults_1 = __importDefault(require("../../system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults"));
|
|
20
|
-
const CardsSkeleton_1 = require("../../system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton");
|
|
21
|
-
const CardsHolderLoader_1 = __importDefault(require("../../system/CardsHolderWithSkeleton/CardsHolderLoader"));
|
|
22
|
-
const SCardsRow = styled_components_1.default.div `
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { Virtuoso } from 'react-virtuoso';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { adaptiveValueCalc, getAdaptiveValue, } from '@ludo.ninja/ui/build/utils/4k';
|
|
6
|
+
import { ProfileSkeleton } from "../../components/profile/profileSkeleton";
|
|
7
|
+
import { useVirtuosoInitialScroll } from "../sessionScroll/useVirtuosoInitialScroll";
|
|
8
|
+
import { VirtuosoToTopBtn, useVirtuosoToTopBtnInitialize, } from "./VirtuosoToTopBtn";
|
|
9
|
+
import { useSubscribeVirtuosoScrollToHeader } from "./useSubscribeVirtuosoScrollToHeader";
|
|
10
|
+
import { useVirtuosoData } from "./useVirtuosoData";
|
|
11
|
+
import { ScreenWidth, mediaQuery } from "../../styles/ScreenWidth";
|
|
12
|
+
import CardsError from "../../system/CardsHolderWithSkeleton/CardsHolder/CardsError";
|
|
13
|
+
import CardsNoResults from "../../system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults";
|
|
14
|
+
import { CardSkeleton } from "../../system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton";
|
|
15
|
+
import CardsHolderLoader from "../../system/CardsHolderWithSkeleton/CardsHolderLoader";
|
|
16
|
+
const SCardsRow = styled.div `
|
|
23
17
|
display: flex;
|
|
24
18
|
width: 1080px;
|
|
25
19
|
margin: 0 auto;
|
|
26
20
|
|
|
27
|
-
${
|
|
21
|
+
${mediaQuery.maxWidthTablet} {
|
|
28
22
|
width: 704px;
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
${
|
|
25
|
+
${mediaQuery.mobile} {
|
|
32
26
|
width: 320px;
|
|
33
27
|
}
|
|
34
|
-
${
|
|
35
|
-
width: ${
|
|
28
|
+
${mediaQuery.minWidthFourK} {
|
|
29
|
+
width: ${adaptiveValueCalc(1080)};
|
|
36
30
|
}
|
|
37
31
|
`;
|
|
38
|
-
const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions, isLoading, error, refetchQuery, loadMore, renderCreation, notFoundText, isNextLoading, headerSlot, isProfileCards, }) => {
|
|
39
|
-
const { onScroll } =
|
|
40
|
-
const virtuoso =
|
|
41
|
-
const virtuosoToTopBtnInitialize =
|
|
42
|
-
const { virtuosoData, placeholderData } =
|
|
32
|
+
export const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions, isLoading, error, refetchQuery, loadMore, renderCreation, notFoundText, isNextLoading, headerSlot, isProfileCards, }) => {
|
|
33
|
+
const { onScroll } = useSubscribeVirtuosoScrollToHeader();
|
|
34
|
+
const virtuoso = useRef(null);
|
|
35
|
+
const virtuosoToTopBtnInitialize = useVirtuosoToTopBtnInitialize();
|
|
36
|
+
const { virtuosoData, placeholderData } = useVirtuosoData({
|
|
43
37
|
activeTab,
|
|
44
38
|
isMobile,
|
|
45
39
|
creations,
|
|
@@ -47,7 +41,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
47
41
|
windowDimensions.windowWidth < 1200 &&
|
|
48
42
|
isProfileCards,
|
|
49
43
|
});
|
|
50
|
-
const { updateScroll, setScrollTop } =
|
|
44
|
+
const { updateScroll, setScrollTop } = useVirtuosoInitialScroll({
|
|
51
45
|
virtuoso,
|
|
52
46
|
virtuosoData,
|
|
53
47
|
activeTab,
|
|
@@ -59,8 +53,8 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
59
53
|
return 12;
|
|
60
54
|
if (width && width < 1200)
|
|
61
55
|
return 16;
|
|
62
|
-
if (width && width >=
|
|
63
|
-
return
|
|
56
|
+
if (width && width >= ScreenWidth.FOUR_K_MIN) {
|
|
57
|
+
return getAdaptiveValue({
|
|
64
58
|
windowWidth: width,
|
|
65
59
|
currentSize: 24,
|
|
66
60
|
});
|
|
@@ -71,7 +65,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
71
65
|
return {
|
|
72
66
|
totalCount: placeholderData.length,
|
|
73
67
|
itemContent: (index) => {
|
|
74
|
-
return ((
|
|
68
|
+
return (_jsx(SCardsRow, { style: {
|
|
75
69
|
paddingBottom: (() => {
|
|
76
70
|
if (index === virtuosoData.creationPacks.length - 1) {
|
|
77
71
|
const width = windowDimensions?.windowWidth;
|
|
@@ -83,7 +77,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
83
77
|
return getGapCards();
|
|
84
78
|
})(),
|
|
85
79
|
gap: getGapCards(),
|
|
86
|
-
}, children: placeholderData[index].map((_, ind) => isProfileCards ? ((
|
|
80
|
+
}, children: placeholderData[index].map((_, ind) => isProfileCards ? (_jsx(ProfileSkeleton, {}, ind)) : (_jsx(CardSkeleton, {}, ind))) }));
|
|
87
81
|
},
|
|
88
82
|
};
|
|
89
83
|
}
|
|
@@ -91,7 +85,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
91
85
|
return {
|
|
92
86
|
totalCount: 1,
|
|
93
87
|
itemContent: () => {
|
|
94
|
-
return (
|
|
88
|
+
return _jsx(CardsError, { refetch: refetchQuery });
|
|
95
89
|
},
|
|
96
90
|
};
|
|
97
91
|
}
|
|
@@ -99,7 +93,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
99
93
|
return {
|
|
100
94
|
totalCount: 1,
|
|
101
95
|
itemContent: () => {
|
|
102
|
-
return (
|
|
96
|
+
return _jsx(CardsNoResults, { noFoundText: notFoundText });
|
|
103
97
|
},
|
|
104
98
|
};
|
|
105
99
|
}
|
|
@@ -107,7 +101,7 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
107
101
|
totalCount: virtuosoData.creationPacks.length,
|
|
108
102
|
itemContent: (index) => {
|
|
109
103
|
const data = virtuosoData.creationPacks[index];
|
|
110
|
-
return ((
|
|
104
|
+
return (_jsx(SCardsRow, { style: {
|
|
111
105
|
paddingBottom: (() => {
|
|
112
106
|
if (index === virtuosoData.creationPacks.length - 1) {
|
|
113
107
|
const width = windowDimensions?.windowWidth;
|
|
@@ -123,13 +117,12 @@ const VirtuosoPageBuilder = ({ activeTab, isMobile, creations, windowDimensions,
|
|
|
123
117
|
},
|
|
124
118
|
};
|
|
125
119
|
})();
|
|
126
|
-
return ((
|
|
120
|
+
return (_jsxs(_Fragment, { children: [_jsx(Virtuoso, { ref: virtuoso, style: { height: 'var(--app-height)' }, onScroll: (e) => {
|
|
127
121
|
setScrollTop(e.currentTarget.scrollTop);
|
|
128
122
|
onScroll(e.currentTarget.scrollTop);
|
|
129
123
|
virtuosoToTopBtnInitialize.onScroll(e.currentTarget.scrollTop);
|
|
130
124
|
}, totalCount: virtuosoBody.totalCount, endReached: loadMore, overscan: 200, itemContent: virtuosoBody.itemContent, components: {
|
|
131
125
|
Header: () => headerSlot,
|
|
132
|
-
Footer: () => (isNextLoading ? (
|
|
133
|
-
} }), virtuosoToTopBtnInitialize.isShowBtn && ((
|
|
126
|
+
Footer: () => (isNextLoading ? _jsx(CardsHolderLoader, {}) : null),
|
|
127
|
+
} }), virtuosoToTopBtnInitialize.isShowBtn && (_jsx(VirtuosoToTopBtn, { virtuoso: virtuoso }))] }));
|
|
134
128
|
};
|
|
135
|
-
exports.VirtuosoPageBuilder = VirtuosoPageBuilder;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const useVirtuosoToTopBtnInitialize = () => {
|
|
8
|
-
const [isShowBtn, setIsShowBtn] = (0, react_1.useState)(false);
|
|
9
|
-
const oldScrollY = (0, react_1.useRef)(0);
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { ToTopBtnWithCustomHandler } from "../../components/toTopBtn";
|
|
4
|
+
export const useVirtuosoToTopBtnInitialize = () => {
|
|
5
|
+
const [isShowBtn, setIsShowBtn] = useState(false);
|
|
6
|
+
const oldScrollY = useRef(0);
|
|
10
7
|
const offsetPixels = 600;
|
|
11
8
|
return {
|
|
12
9
|
isShowBtn,
|
|
@@ -24,8 +21,7 @@ const useVirtuosoToTopBtnInitialize = () => {
|
|
|
24
21
|
},
|
|
25
22
|
};
|
|
26
23
|
};
|
|
27
|
-
|
|
28
|
-
const VirtuosoToTopBtn = ({ virtuoso, }) => {
|
|
24
|
+
export const VirtuosoToTopBtn = ({ virtuoso, }) => {
|
|
29
25
|
const handleClickFunction = () => {
|
|
30
26
|
virtuoso.current?.scrollToIndex({
|
|
31
27
|
index: 0,
|
|
@@ -33,6 +29,5 @@ const VirtuosoToTopBtn = ({ virtuoso, }) => {
|
|
|
33
29
|
align: 'end',
|
|
34
30
|
});
|
|
35
31
|
};
|
|
36
|
-
return ((
|
|
32
|
+
return (_jsx(ToTopBtnWithCustomHandler, { handleClickFunction: handleClickFunction }));
|
|
37
33
|
};
|
|
38
|
-
exports.VirtuosoToTopBtn = VirtuosoToTopBtn;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const useSubscribeVirtuosoScrollToHeader = () => {
|
|
6
|
-
const lastScrollY = (0, react_1.useRef)(0);
|
|
7
|
-
const scrollDirection = (0, react_1.useRef)('up');
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
export const useSubscribeVirtuosoScrollToHeader = () => {
|
|
3
|
+
const lastScrollY = useRef(0);
|
|
4
|
+
const scrollDirection = useRef('up');
|
|
8
5
|
return {
|
|
9
6
|
onScroll(scrollY) {
|
|
10
7
|
const direction = scrollY > lastScrollY.current ? 'down' : 'up';
|
|
@@ -24,4 +21,3 @@ const useSubscribeVirtuosoScrollToHeader = () => {
|
|
|
24
21
|
},
|
|
25
22
|
};
|
|
26
23
|
};
|
|
27
|
-
exports.useSubscribeVirtuosoScrollToHeader = useSubscribeVirtuosoScrollToHeader;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const getPageSizeAssets_1 = require("../../utils/getPageSizeAssets");
|
|
6
|
-
const useVirtuosoData = ({ activeTab, creations, isMobile, isThreeColumn, isProfileCards, }) => {
|
|
7
|
-
const virtuosoData = (0, react_1.useMemo)(() => {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { getPageSize } from "../../utils/getPageSizeAssets";
|
|
3
|
+
export const useVirtuosoData = ({ activeTab, creations, isMobile, isThreeColumn, isProfileCards, }) => {
|
|
4
|
+
const virtuosoData = useMemo(() => {
|
|
8
5
|
let columnCount = isMobile ? 2 : isThreeColumn ? 3 : 4;
|
|
9
6
|
if (isProfileCards) {
|
|
10
7
|
columnCount = isMobile ? 1 : 2;
|
|
@@ -22,12 +19,12 @@ const useVirtuosoData = ({ activeTab, creations, isMobile, isThreeColumn, isProf
|
|
|
22
19
|
});
|
|
23
20
|
return { creationPacks, creations };
|
|
24
21
|
}, [isMobile, creations, isProfileCards]);
|
|
25
|
-
const placeholderData =
|
|
22
|
+
const placeholderData = useMemo(() => {
|
|
26
23
|
const columnCount = isMobile ? 2 : isThreeColumn ? 3 : 4;
|
|
27
24
|
const creationPacks = [[]];
|
|
28
25
|
let indexPack = 0;
|
|
29
26
|
Array.from({
|
|
30
|
-
length:
|
|
27
|
+
length: getPageSize({
|
|
31
28
|
scrollTab: activeTab?.value,
|
|
32
29
|
}),
|
|
33
30
|
}).forEach((_, index) => {
|
|
@@ -46,4 +43,3 @@ const useVirtuosoData = ({ activeTab, creations, isMobile, isThreeColumn, isProf
|
|
|
46
43
|
placeholderData,
|
|
47
44
|
};
|
|
48
45
|
};
|
|
49
|
-
exports.useVirtuosoData = useVirtuosoData;
|