@ludo.ninja/components 1.1.1 → 1.1.3
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/README.md +1 -1
- package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +71 -124
- package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.jsx +75 -199
- package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.js +27 -35
- package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.js +28 -38
- package/dist/api/subscriptions/SubscriberInviteNotification.jsx +29 -49
- package/dist/components/CreationCard/CardHead.jsx +103 -277
- package/dist/components/CreationCard/index.jsx +32 -211
- package/dist/components/addWalletsRedirectPage/index.jsx +15 -66
- package/dist/components/assetPage/assetLikes/index.jsx +43 -98
- package/dist/components/assetPage/assetNft/index.jsx +19 -61
- package/dist/components/assetPage/assetWrapper/index.jsx +35 -170
- package/dist/components/assetPage/audioVideoPlayer/index.jsx +149 -462
- package/dist/components/assetPage/category/index.jsx +16 -89
- package/dist/components/assetPage/description/index.jsx +17 -70
- package/dist/components/assetPage/detailsAccordeon/index.jsx +18 -81
- package/dist/components/assetPage/figCaption/index.jsx +147 -445
- package/dist/components/assetPage/information/index.jsx +42 -194
- package/dist/components/assetPage/marketPlaces/index.jsx +20 -109
- package/dist/components/assetPage/media/AssetImage/index.jsx +54 -256
- package/dist/components/assetPage/moreDropDown/index.jsx +38 -224
- package/dist/components/assetPage/participants/index.jsx +91 -404
- package/dist/components/assetPage/priceRank/index.jsx +24 -177
- package/dist/components/assetPage/properties/index.jsx +17 -90
- package/dist/components/assetPage/slider/index.jsx +49 -183
- package/dist/components/assetPage/slider/slideItem.jsx +7 -48
- package/dist/components/assetPage/tittle/index.jsx +31 -134
- package/dist/components/assetPage/viewer3D/index.jsx +51 -216
- package/dist/components/banner/index.jsx +20 -71
- package/dist/components/base/Meta/index.jsx +48 -139
- package/dist/components/base/NoSSR/index.jsx +2 -10
- package/dist/components/collectionPage/collectionLike/index.jsx +23 -57
- package/dist/components/deleteDialog/index.jsx +78 -306
- package/dist/components/editProfile/Cropper/index.jsx +73 -235
- package/dist/components/editProfile/UserPicProfile/index.jsx +206 -462
- package/dist/components/favoriteList/add/addAssetToFavoriteList/index.jsx +57 -195
- package/dist/components/favoriteList/add/addCollectionToFavoriteList/index.jsx +55 -197
- package/dist/components/favoriteList/add/addCreationToFavoriteList/index.jsx +57 -197
- package/dist/components/filters/applyResetBtns/index.jsx +10 -55
- package/dist/components/filters/galleriesFiltersForm/index.jsx +51 -137
- package/dist/components/filters/index.jsx +57 -189
- package/dist/components/filters/mobileFilters/index.jsx +7 -26
- package/dist/components/filters/setsFiltersForm/index.jsx +43 -113
- package/dist/components/forms/form/index.jsx +92 -289
- package/dist/components/forms/formsNavigation/index.jsx +34 -146
- package/dist/components/forms/formsTemplate/index.jsx +697 -930
- package/dist/components/gallery/add/addAssetToGallery/index.jsx +57 -196
- package/dist/components/gallery/add/addCreationToGallery/index.jsx +69 -240
- package/dist/components/gradientLabel/index.jsx +6 -37
- package/dist/components/headers/components/MobileToggle/index.jsx +1 -1
- package/dist/components/headers/components/headerExperienceLabel/index.jsx +13 -43
- package/dist/components/headers/components/headerUserPic/index.jsx +11 -48
- package/dist/components/headers/header/index.jsx +14 -49
- package/dist/components/headers/headerSearch/index.jsx +19 -58
- package/dist/components/headers/headerSimple/index.jsx +13 -49
- package/dist/components/inviteCodesForms/getEarlyAccessForm/index.jsx +148 -326
- package/dist/components/inviteCodesForms/joinWaitListForm/index.jsx +103 -271
- package/dist/components/inviteCodesPage/components/index.jsx +0 -1
- package/dist/components/inviteCodesPage/components/inviteCodes/index.jsx +9 -25
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/index.jsx +9 -48
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/loader/index.jsx +11 -28
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/index.jsx +11 -30
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/loader/index.jsx +6 -21
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCopy/index.jsx +9 -32
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeDate/index.jsx +9 -29
- package/dist/components/inviteCodesPage/wrappers/index.jsx +0 -1
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/index.jsx +22 -137
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/loader/index.jsx +6 -22
- package/dist/components/inviteCodesPage/wrappers/unusedCodes/index.jsx +16 -40
- package/dist/components/inviteCodesPage/wrappers/usedCodes/index.jsx +21 -51
- package/dist/components/linkTabs/index.jsx +8 -56
- package/dist/components/linkTabs/linkTab/index.jsx +10 -83
- package/dist/components/myWallets/index.jsx +15 -56
- package/dist/components/myWallets/myWalletItem/index.jsx +90 -359
- package/dist/components/navigation/index.jsx +25 -156
- package/dist/components/profile/ProfileTabs.jsx +34 -61
- package/dist/components/profile/aboutText/index.jsx +53 -240
- package/dist/components/profile/addToGalleryBtns/index.jsx +16 -114
- package/dist/components/profile/followersSocial/followers/index.jsx +10 -70
- package/dist/components/profile/followersSocial/index.jsx +13 -37
- package/dist/components/profile/followersSocial/social/index.jsx +27 -80
- package/dist/components/profile/info/index.jsx +22 -86
- package/dist/components/profile/interests/index.jsx +33 -149
- package/dist/components/profile/jsonLd/index.jsx +3 -14
- package/dist/components/profile/pageHead/index.jsx +35 -106
- package/dist/components/profile/profileSkeleton/index.jsx +17 -51
- package/dist/components/profile/profileUserCards/index.jsx +7 -26
- package/dist/components/profile/profileUserCards/profileUserCard/index.jsx +101 -340
- package/dist/components/profile/rank/index.jsx +11 -78
- package/dist/components/profile/stats/index.jsx +9 -46
- package/dist/components/profile/wallets/index.jsx +34 -142
- package/dist/components/profile/wrapper/index.jsx +8 -16
- package/dist/components/registrationPage/index.jsx +0 -1
- package/dist/components/registrationPage/registrationSelectBox/index.jsx +10 -91
- package/dist/components/registrationPage/registrationSelection/index.jsx +33 -99
- package/dist/components/rewards/FAQ/index.jsx +77 -281
- package/dist/components/rewards/clarifications/index.jsx +23 -98
- package/dist/components/rewards/logoBottom/index.jsx +12 -46
- package/dist/components/rewards/prograssBar/index.jsx +12 -66
- package/dist/components/rewards/rewardsButton/index.jsx +6 -78
- package/dist/components/rewards/seasonBanner/index.jsx +11 -86
- package/dist/components/rewards/taskExpTab/index.jsx +30 -200
- package/dist/components/rewards/tasksGrid/index.jsx +117 -360
- package/dist/components/rewards/userExp/index.jsx +32 -256
- package/dist/components/search/SearchInputContainer.jsx +190 -476
- package/dist/components/search/index.jsx +37 -350
- package/dist/components/search/searchCategories/index.jsx +38 -75
- package/dist/components/search/searchCloseMoreButtons/index.jsx +35 -131
- package/dist/components/search/searchResultCaption/index.jsx +13 -71
- package/dist/components/search/searchSelectsGalleries/index.jsx +23 -103
- package/dist/components/search/searchSelectsSets/index.jsx +23 -101
- package/dist/components/search/searchSimpleInput/index.jsx +31 -201
- package/dist/components/search/searchSuggestions/index.jsx +68 -273
- package/dist/components/search/searchSuggestions/searchSuggestionsCaption/index.jsx +8 -59
- package/dist/components/search/searchSuggestions/searchSuggestionsFooter/index.jsx +8 -65
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/index.jsx +25 -111
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.jsx +21 -124
- package/dist/components/search/searchSuggestions/searchSuggestionsNotFound/index.jsx +8 -67
- package/dist/components/shareDialog/index.jsx +34 -277
- package/dist/components/showcaseAssets/showcaseSort/index.jsx +10 -48
- package/dist/components/sidebar/index.jsx +75 -278
- package/dist/components/sidebar/initializer.jsx +3 -13
- package/dist/components/sidebar/sidebarFilters/index.jsx +9 -42
- package/dist/components/sidebar/sidebarInviteCodeLabel/index.jsx +18 -95
- package/dist/components/socialButtons/index.jsx +15 -63
- package/dist/components/tabs/index.jsx +35 -95
- package/dist/components/toTopBtn/index.jsx +36 -112
- package/dist/dto/AssetEntity/index.js +194 -249
- package/dist/dto/AssetEntity/views/AssetAudio/index.jsx +27 -67
- package/dist/dto/AssetEntity/views/AssetImage/index.jsx +38 -79
- package/dist/dto/AssetEntity/views/AssetObject/index.jsx +58 -86
- package/dist/dto/AssetEntity/views/AssetOther/index.jsx +42 -87
- package/dist/dto/AssetEntity/views/AssetScreenshot/index.jsx +38 -81
- package/dist/dto/AssetEntity/views/AssetVideo/index.jsx +27 -67
- package/dist/dto/AssetEntity/views/index.js +0 -1
- package/dist/dto/Collection/CollectionCreationEntity/index.js +145 -161
- package/dist/dto/Collection/CollectionEntity/index.js +69 -87
- package/dist/dto/CreationEntity/index.js +152 -167
- package/dist/dto/GalleryEntityV2/index.js +65 -77
- package/dist/dto/common/ItemType/data.js +33 -41
- package/dist/dto/common/ItemType/index.jsx +27 -27
- package/dist/dto/common/ItemViews/CreationAudio/index.jsx +27 -68
- package/dist/dto/common/ItemViews/CreationImage/index.jsx +38 -72
- package/dist/dto/common/ItemViews/CreationObject/index.jsx +32 -66
- package/dist/dto/common/ItemViews/CreationOther/index.jsx +27 -67
- package/dist/dto/common/ItemViews/CreationVideo/index.jsx +27 -67
- package/dist/dto/common/Media/Audio/index.jsx +43 -76
- package/dist/dto/common/Media/Image/index.jsx +51 -78
- package/dist/dto/common/Media/Object/index.jsx +50 -77
- package/dist/dto/common/Media/Other/index.jsx +70 -100
- package/dist/dto/common/Media/Screenshot/index.jsx +51 -78
- package/dist/dto/common/Media/Video/index.jsx +43 -76
- package/dist/dto/common/Media/index.jsx +34 -41
- package/dist/hooks/apollo/index.jsx +4 -14
- package/dist/hooks/audio/useMultiAudio/index.jsx +46 -63
- package/dist/hooks/likes/index.js +153 -308
- package/dist/hooks/useToGalleryAsset/index.jsx +65 -109
- package/dist/layouts/GlobalLayout.jsx +10 -23
- package/dist/layouts/base/LWithRegularHeader/index.jsx +11 -29
- package/dist/layouts/base/LWithSearchHeader/index.jsx +6 -10
- package/dist/layouts/base/LWithSimpleHeader/index.jsx +6 -10
- package/dist/layouts/base/LWithoutHeader/index.jsx +10 -32
- package/dist/layouts/custom/accountLayout/index.jsx +3 -7
- package/dist/layouts/custom/formsLayout/index.jsx +3 -7
- package/dist/layouts/custom/mainLayout/index.jsx +3 -9
- package/dist/layouts/custom/searchLayout/index.jsx +3 -6
- package/dist/layouts/custom/simpleLayout/index.jsx +3 -9
- package/dist/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +257 -447
- package/dist/modules/gallery/ui/Description.jsx +32 -98
- package/dist/modules/gallery/ui/EditGallery.jsx +82 -242
- package/dist/modules/gallery/ui/GalleryDeleteIcon.jsx +13 -38
- package/dist/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.jsx +21 -107
- package/dist/modules/gallery/ui/chooseGalleryItems/index.jsx +71 -255
- package/dist/modules/gallery/ui/createGalleryForm/index.jsx +115 -323
- package/dist/modules/gallery/ui/editGalleryForm/index.jsx +129 -360
- package/dist/modules/gallery/ui/itemsPreview/index.jsx +153 -329
- package/dist/modules/notifications/index.jsx +0 -1
- package/dist/modules/virtuoso/VirtuosoPageBuilder.jsx +110 -204
- package/dist/modules/virtuoso/VirtuosoToTopBtn.jsx +27 -34
- package/dist/pages/index.jsx +5 -8
- package/dist/styles/animations/index.jsx +6 -34
- package/dist/styles/index.js +3 -1
- package/dist/styles/typography/index.jsx +1 -11
- package/dist/system/ActiveLink/index.jsx +25 -43
- package/dist/system/Alert/index.jsx +5 -11
- package/dist/system/BasicOverlay/index.jsx +6 -25
- package/dist/system/Buttons/IconButton/index.jsx +0 -1
- package/dist/system/Buttons/IconWithButton/index.jsx +0 -1
- package/dist/system/Buttons/MainButton/index.jsx +0 -1
- package/dist/system/Buttons/SecondaryButton/index.jsx +0 -1
- package/dist/system/Cards/CardCheckbox/index.jsx +11 -69
- package/dist/system/Cards/CardContent/CardCategory/index.jsx +10 -60
- package/dist/system/Cards/CardContent/CardLikes/index.jsx +13 -43
- package/dist/system/Cards/CardContent/CardShowMore/index.jsx +17 -109
- package/dist/system/Cards/CardContent/index.jsx +31 -122
- package/dist/system/Cards/CardHeadIcons/index.jsx +107 -276
- package/dist/system/Cards/CardMedia/CardAudio/index.jsx +48 -95
- package/dist/system/Cards/CardMedia/CardImage/index.jsx +9 -34
- package/dist/system/Cards/CardMedia/CardVideo/index.jsx +40 -79
- package/dist/system/Cards/CardRank/index.jsx +14 -130
- package/dist/system/Cards/CardsGrid/index.jsx +35 -99
- package/dist/system/Cards/MultiMediaCard/index.jsx +50 -152
- package/dist/system/Cards/RegularCard/index.jsx +27 -128
- package/dist/system/Cards/Styles/Content.js +5 -36
- package/dist/system/Cards/Styles/Likes.js +5 -56
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsError/index.jsx +61 -197
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.jsx +9 -38
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.jsx +16 -62
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/index.jsx +22 -97
- package/dist/system/CardsHolderWithSkeleton/CardsHolderLoader/index.jsx +9 -49
- package/dist/system/CardsHolderWithSkeleton/index.jsx +7 -47
- package/dist/system/DropDown/DropDown.test.jsx +30 -43
- package/dist/system/DropDown/index.jsx +21 -62
- package/dist/system/Filters/type.js +5 -5
- package/dist/system/Flex/index.jsx +1 -1
- package/dist/system/Forms/Checkbox/Checkbox.test.jsx +55 -60
- package/dist/system/Forms/Checkbox/index.jsx +22 -93
- package/dist/system/Forms/DatePicker/index.jsx +20 -161
- package/dist/system/Forms/ErrorLabel/ErrorLabel.test.jsx +14 -17
- package/dist/system/Forms/ErrorLabel/index.jsx +7 -38
- package/dist/system/Forms/Input/Input.test.jsx +36 -48
- package/dist/system/Forms/Input/index.jsx +16 -121
- package/dist/system/Forms/RadioInput/index.jsx +17 -78
- package/dist/system/Forms/Selects/DesktopSelect/index.jsx +95 -352
- package/dist/system/Forms/Selects/MobileSelect/index.jsx +20 -53
- package/dist/system/Forms/TextArea/index.jsx +15 -113
- package/dist/system/Forms/index.js +0 -1
- package/dist/system/Img/ExternalImage/index.jsx +7 -40
- package/dist/system/Img/ImageInterceptor/ImageInterceptor.test.jsx +41 -70
- package/dist/system/Img/ImageInterceptor/index.jsx +20 -60
- package/dist/system/Img/Profilepic/index.jsx +21 -52
- package/dist/system/Img/Userpic/UserPic.test.jsx +50 -73
- package/dist/system/Img/Userpic/index.jsx +44 -142
- package/dist/system/Labels/ExperienceLabel/ExperienceLabel.test.jsx +41 -46
- package/dist/system/Labels/ExperienceLabel/index.jsx +18 -111
- package/dist/system/Labels/InviteLabel/InviteLabel.test.jsx +36 -41
- package/dist/system/Labels/InviteLabel/index.jsx +17 -67
- package/dist/system/Labels/SkeletonLabel/index.jsx +0 -1
- package/dist/system/Modals/Modal/Modal.test.jsx +22 -26
- package/dist/system/Modals/Modal/index.jsx +12 -84
- package/dist/system/Modals/ModalSidebar/ModalSidebar.test.jsx +21 -25
- package/dist/system/Modals/ModalSidebar/ModalSidebarPortal.jsx +7 -20
- package/dist/system/Modals/ModalSidebar/index.jsx +12 -80
- package/dist/system/Overlay/Overlay.test.jsx +33 -39
- package/dist/system/Overlay/index.jsx +9 -57
- package/dist/system/PageLoader/index.jsx +0 -1
- package/dist/system/Palete/index.jsx +0 -1
- package/dist/system/Tabs/TabNavLink/TabNavLink.test.jsx +22 -32
- package/dist/system/Tabs/TabNavLink/index.jsx +8 -67
- package/dist/system/Tabs/TabsNav/TabsNav.test.jsx +25 -47
- package/dist/system/Tabs/TabsNav/index.jsx +12 -45
- package/dist/system/Tabs/TabsPanel/TabsPanel.test.jsx +25 -39
- package/dist/system/Tabs/TabsPanel/index.jsx +7 -28
- package/dist/system/Text/index.jsx +1 -1
- package/dist/types/api/server-assets/queries/useFetchAssets/index.d.ts +5 -14
- package/dist/types/api/server-assets/queries/useFetchDynamicAssetLikes/index.d.ts +5 -8
- package/dist/types/api/server-assets/queries/useFetchDynamicAssetsLikes/index.d.ts +4 -7
- package/dist/types/api/server-experiences/queries/useFetchMyTasks/index.d.ts +20 -36
- package/dist/types/api/server-galleries/mutations/useAddChangeGalleryBanner/index.d.ts +1 -7
- package/dist/types/api/server-galleries/mutations/useAddCreationsToGallery/index.d.ts +3 -7
- package/dist/types/api/server-galleries/mutations/useDeleteGallery/index.d.ts +4 -7
- package/dist/types/api/server-galleries/mutations/useDeleteGalleryBanner/index.d.ts +2 -5
- package/dist/types/api/server-galleries/mutations/useRemoveAssetFromGallery/index.d.ts +3 -7
- package/dist/types/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.d.ts +3 -7
- package/dist/types/api/server-galleries/queries/useFetchGallery/index.d.ts +9 -20
- package/dist/types/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +5 -7
- package/dist/types/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +5 -7
- package/dist/types/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +7 -13
- package/dist/types/api/server-identities/mutations/useAddWalletElrond/index.d.ts +2 -8
- package/dist/types/api/server-identities/mutations/useAddWalletFlow/index.d.ts +1 -5
- package/dist/types/api/server-identities/mutations/useAddWalletMetamask/index.d.ts +3 -11
- package/dist/types/api/server-identities/mutations/useAddWalletSolana/index.d.ts +1 -5
- package/dist/types/api/server-identities/mutations/useAddWalletTezos/index.d.ts +1 -5
- package/dist/types/api/server-identities/mutations/useFollowProfile/index.d.ts +4 -13
- package/dist/types/api/server-identities/mutations/useUnfollowProfile/index.d.ts +4 -13
- package/dist/types/api/server-identities/queries/useFetchProfile/index.d.ts +10 -23
- package/dist/types/api/server-opportunities/mutations/useDislikeOpportunity.d.ts +1 -4
- package/dist/types/api/server-opportunities/mutations/useLikeOpportunity.d.ts +1 -4
- package/dist/types/api/server-opportunities/mutations/useOpenOpportunity/index.d.ts +1 -4
- package/dist/types/api/server-opportunities/queries/useGetOpportunities.d.ts +2 -41
- package/dist/types/api/server-preferences/mutations/useSaveUserExpectations/index.d.ts +1 -1
- package/dist/types/api/server-preferences/mutations/useSaveUserInterests/index.d.ts +1 -1
- package/dist/types/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.d.ts +7 -14
- package/dist/types/api/server-preferences/queries/useSearchResultBlockchainSelections/index.d.ts +8 -15
- package/dist/types/api/server-search/queries/useFetchCollection/index.d.ts +11 -25
- package/dist/types/api/subscriptions/SubscriberInviteNotification.d.ts +1 -3
- package/dist/types/components/assetPage/marketPlaces/index.d.ts +2 -6
- package/dist/types/components/assetPage/media/AssetImage/index.d.ts +6 -13
- package/dist/types/components/assetPage/slider/slideItem.d.ts +3 -8
- package/dist/types/components/banner/index.d.ts +0 -1
- package/dist/types/components/base/Meta/index.d.ts +1 -1
- package/dist/types/components/base/NoSSR/index.d.ts +2 -3
- package/dist/types/components/editProfile/Cropper/index.d.ts +15 -13
- package/dist/types/components/filters/applyResetBtns/index.d.ts +3 -7
- package/dist/types/components/filters/galleriesFiltersForm/index.d.ts +7 -16
- package/dist/types/components/filters/mobileFilters/index.d.ts +2 -5
- package/dist/types/components/filters/setsFiltersForm/index.d.ts +6 -14
- package/dist/types/components/headers/components/headerExperienceLabel/index.d.ts +3 -5
- package/dist/types/components/headers/components/headerUserPic/index.d.ts +2 -5
- package/dist/types/components/headers/header/index.d.ts +0 -1
- package/dist/types/components/inviteCodesForms/getEarlyAccessForm/index.d.ts +0 -1
- package/dist/types/components/inviteCodesForms/joinWaitListForm/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/components/inviteCodes/index.d.ts +3 -7
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCode/loader/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/loader/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/wrappers/resumeCodes/loader/index.d.ts +0 -1
- package/dist/types/components/linkTabs/index.d.ts +4 -9
- package/dist/types/components/myWallets/myWalletItem/index.d.ts +6 -14
- package/dist/types/components/profile/MultiversXAudit/MultiversXAudit.d.ts +1 -1
- package/dist/types/components/profile/followersSocial/index.d.ts +2 -11
- package/dist/types/components/profile/followersSocial/social/index.d.ts +1 -5
- package/dist/types/components/profile/interests/index.d.ts +0 -1
- package/dist/types/components/profile/jsonLd/index.d.ts +2 -6
- package/dist/types/components/profile/pageHead/index.d.ts +3 -8
- package/dist/types/components/profile/profileSkeleton/index.d.ts +2 -5
- package/dist/types/components/profile/profileUserCards/index.d.ts +2 -5
- package/dist/types/components/profile/stats/index.d.ts +1 -5
- package/dist/types/components/registrationPage/index.d.ts +0 -1
- package/dist/types/components/registrationPage/registrationSelectBox/index.d.ts +4 -5
- package/dist/types/components/rewards/prograssBar/index.d.ts +5 -9
- package/dist/types/components/rewards/rewardsButton/index.d.ts +1 -11
- package/dist/types/components/search/searchCategories/index.d.ts +0 -1
- package/dist/types/components/search/searchResultCaption/index.d.ts +4 -9
- package/dist/types/components/search/searchSelectsGalleries/index.d.ts +5 -12
- package/dist/types/components/search/searchSelectsSets/index.d.ts +4 -10
- package/dist/types/components/search/searchSuggestions/index.d.ts +6 -9
- package/dist/types/components/search/searchSuggestions/searchSuggestionsCaption/index.d.ts +2 -3
- package/dist/types/components/search/searchSuggestions/searchSuggestionsFooter/index.d.ts +0 -1
- package/dist/types/components/search/searchSuggestions/searchSuggestionsItem/index.d.ts +6 -7
- package/dist/types/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.d.ts +0 -1
- package/dist/types/components/search/searchSuggestions/searchSuggestionsNotFound/index.d.ts +2 -5
- package/dist/types/components/showcaseAssets/showcaseSort/index.d.ts +4 -10
- package/dist/types/components/sidebar/sidebarFilters/index.d.ts +4 -9
- package/dist/types/components/sidebar/sidebarInviteCodeLabel/index.d.ts +0 -1
- package/dist/types/components/tabs/index.d.ts +0 -1
- package/dist/types/dto/AssetEntity/index.d.ts +55 -62
- package/dist/types/dto/AssetEntity/interface.d.ts +32 -39
- package/dist/types/dto/AssetEntity/views/AssetImage/index.d.ts +4 -13
- package/dist/types/dto/AssetEntity/views/AssetOther/index.d.ts +5 -14
- package/dist/types/dto/AssetEntity/views/AssetScreenshot/index.d.ts +4 -13
- package/dist/types/dto/AssetEntity/views/index.d.ts +0 -1
- package/dist/types/dto/Collection/CollectionCreationEntity/interface.d.ts +18 -20
- package/dist/types/dto/Collection/CollectionEntity/index.d.ts +27 -33
- package/dist/types/dto/CreationEntity/interface.d.ts +24 -26
- package/dist/types/dto/GalleryEntityV2/index.d.ts +25 -27
- package/dist/types/dto/GalleryEntityV2/interface.d.ts +11 -13
- package/dist/types/dto/common/ItemType/data.d.ts +0 -1
- package/dist/types/dto/common/ItemType/index.d.ts +31 -31
- package/dist/types/dto/common/ItemViews/CreationImage/index.d.ts +4 -13
- package/dist/types/dto/common/ItemViews/CreationOther/index.d.ts +3 -11
- package/dist/types/dto/common/ItemViews/CreationVideo/index.d.ts +3 -11
- package/dist/types/dto/common/Media/Audio/index.d.ts +7 -15
- package/dist/types/dto/common/Media/Image/index.d.ts +7 -16
- package/dist/types/dto/common/Media/Object/index.d.ts +7 -16
- package/dist/types/dto/common/Media/Other/index.d.ts +7 -16
- package/dist/types/dto/common/Media/Screenshot/index.d.ts +7 -16
- package/dist/types/dto/common/Media/Video/index.d.ts +7 -15
- package/dist/types/dto/common/Media/index.d.ts +21 -30
- package/dist/types/dto/common/Media/interface.d.ts +20 -21
- package/dist/types/modules/gallery/api/useGetFavoriteGallery.d.ts +4 -6
- package/dist/types/modules/gallery/store.d.ts +17 -21
- package/dist/types/modules/gallery/ui/Description.d.ts +3 -7
- package/dist/types/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +4 -10
- package/dist/types/modules/gallery/ui/createGalleryForm/index.d.ts +8 -25
- package/dist/types/modules/gallery/ui/editGalleryForm/index.d.ts +6 -13
- package/dist/types/modules/notifications/CreatorNotifications.d.ts +1 -1
- package/dist/types/modules/notifications/index.d.ts +15 -18
- package/dist/types/modules/user/profileData/profileDataInitialization.d.ts +1 -3
- package/dist/types/pages/index.d.ts +1 -1
- package/dist/types/store/ui/index.d.ts +1 -4
- package/dist/types/store/ui/types.d.ts +27 -32
- package/dist/types/store/ui/utils.d.ts +2 -7
- package/dist/types/styles/animations/index.d.ts +2 -2
- package/dist/types/styles/index.d.ts +3 -1
- package/dist/types/styles/typography/index.d.ts +1 -11
- package/dist/types/system/ActiveLink/index.d.ts +5 -10
- package/dist/types/system/Alert/index.d.ts +1 -1
- package/dist/types/system/BasicOverlay/index.d.ts +0 -1
- package/dist/types/system/Buttons/IconButton/index.d.ts +0 -1
- package/dist/types/system/Buttons/IconWithButton/index.d.ts +0 -1
- package/dist/types/system/Buttons/MainButton/index.d.ts +0 -1
- package/dist/types/system/Buttons/SecondaryButton/index.d.ts +0 -1
- package/dist/types/system/Cards/CardCheckbox/index.d.ts +3 -7
- package/dist/types/system/Cards/CardContent/CardCategory/index.d.ts +2 -6
- package/dist/types/system/Cards/CardContent/CardShowMore/index.d.ts +5 -18
- package/dist/types/system/Cards/CardContent/index.d.ts +13 -27
- package/dist/types/system/Cards/CardMedia/CardImage/index.d.ts +4 -9
- package/dist/types/system/Cards/CardMedia/CardVideo/index.d.ts +4 -9
- package/dist/types/system/Cards/Styles/Content.d.ts +1 -11
- package/dist/types/system/Cards/Styles/Likes.d.ts +3 -13
- package/dist/types/system/CardsHolderWithSkeleton/CardsHolder/CardsError/index.d.ts +2 -5
- package/dist/types/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.d.ts +2 -5
- package/dist/types/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.d.ts +2 -5
- package/dist/types/system/DropDown/index.d.ts +5 -11
- package/dist/types/system/Filters/type.d.ts +9 -10
- package/dist/types/system/Forms/Checkbox/index.d.ts +14 -16
- package/dist/types/system/Forms/DatePicker/index.d.ts +7 -9
- package/dist/types/system/Forms/ErrorLabel/index.d.ts +2 -3
- package/dist/types/system/Forms/Input/index.d.ts +9 -22
- package/dist/types/system/Forms/RadioInput/index.d.ts +9 -20
- package/dist/types/system/Forms/Selects/MobileSelect/index.d.ts +7 -15
- package/dist/types/system/Forms/TextArea/index.d.ts +7 -10
- package/dist/types/system/Forms/index.d.ts +0 -1
- package/dist/types/system/Img/ExternalImage/index.d.ts +4 -11
- package/dist/types/system/Img/ImageInterceptor/index.d.ts +13 -25
- package/dist/types/system/Img/Userpic/index.d.ts +6 -13
- package/dist/types/system/Labels/ExperienceLabel/index.d.ts +4 -9
- package/dist/types/system/Labels/InviteLabel/index.d.ts +4 -9
- package/dist/types/system/Labels/SkeletonLabel/index.d.ts +0 -1
- package/dist/types/system/Modals/Modal/index.d.ts +0 -1
- package/dist/types/system/Modals/ModalSidebar/CreatorModalSidebarPortal.d.ts +1 -3
- package/dist/types/system/Modals/ModalSidebar/ModalSidebarPortal.d.ts +3 -7
- package/dist/types/system/Modals/ModalSidebar/index.d.ts +1 -12
- package/dist/types/system/Overlay/index.d.ts +0 -1
- package/dist/types/system/PageLoader/index.d.ts +0 -1
- package/dist/types/system/Palete/index.d.ts +0 -1
- package/dist/types/system/Tabs/TabNavLink/index.d.ts +6 -18
- package/dist/types/system/Tabs/TabsNav/index.d.ts +4 -16
- package/dist/types/system/Tabs/TabsPanel/index.d.ts +2 -3
- package/dist/types/utils/imageProportionsSize/index.d.ts +3 -7
- package/dist/types/utils/ui/index.d.ts +4 -7
- package/dist/utils/copyBtn/index.jsx +63 -223
- package/dist/utils/extractItemIds/index.jsx +5 -6
- package/dist/utils/imageProportionsSize/index.jsx +17 -27
- package/dist/utils/ui/index.jsx +2 -4
- package/package.json +1 -1
- package/src/styles/index.ts +5 -1
- /package/src/styles/colors/{index.tsx → index.ts} +0 -0
|
@@ -1,327 +1,172 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
1
37
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
38
|
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
4
|
-
|
|
5
39
|
import { useUiStore } from '@/store/ui';
|
|
6
|
-
|
|
7
40
|
import useDisLikeAsset from '@/api/server-assets/mutations/useDislikeAsset';
|
|
8
41
|
import useLikeAsset from '@/api/server-assets/mutations/useLikeAsset';
|
|
9
42
|
import useDislikeCollection from '@/api/server-collection/mutations/useDislikeCollection';
|
|
10
43
|
import useLikeCollection from '@/api/server-collection/mutations/useLikeCollection';
|
|
11
44
|
import { useRemoveAssetFromGalleryV2 } from '@/api/server-galleries/mutations/useRemoveAssetFromGallery';
|
|
12
45
|
import { useRemoveCollectionFromGalleryV2 } from '@/api/server-galleries/mutations/useRemoveCollectionFromGallery';
|
|
13
|
-
|
|
14
46
|
import { LabelKeys } from '@/dto/common/ItemType';
|
|
15
|
-
|
|
16
|
-
var __awaiter =
|
|
17
|
-
(this && this.__awaiter) ||
|
|
18
|
-
function (thisArg, _arguments, P, generator) {
|
|
19
|
-
function adopt(value) {
|
|
20
|
-
return value instanceof P
|
|
21
|
-
? value
|
|
22
|
-
: new P(function (resolve) {
|
|
23
|
-
resolve(value);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
27
|
-
function fulfilled(value) {
|
|
28
|
-
try {
|
|
29
|
-
step(generator.next(value));
|
|
30
|
-
} catch (e) {
|
|
31
|
-
reject(e);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function rejected(value) {
|
|
35
|
-
try {
|
|
36
|
-
step(generator['throw'](value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function step(result) {
|
|
42
|
-
result.done
|
|
43
|
-
? resolve(result.value)
|
|
44
|
-
: adopt(result.value).then(fulfilled, rejected);
|
|
45
|
-
}
|
|
46
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
var __generator =
|
|
50
|
-
(this && this.__generator) ||
|
|
51
|
-
function (thisArg, body) {
|
|
52
|
-
var _ = {
|
|
53
|
-
label: 0,
|
|
54
|
-
sent: function () {
|
|
55
|
-
if (t[0] & 1) throw t[1];
|
|
56
|
-
return t[1];
|
|
57
|
-
},
|
|
58
|
-
trys: [],
|
|
59
|
-
ops: [],
|
|
60
|
-
},
|
|
61
|
-
f,
|
|
62
|
-
y,
|
|
63
|
-
t,
|
|
64
|
-
g;
|
|
65
|
-
return (
|
|
66
|
-
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
|
|
67
|
-
typeof Symbol === 'function' &&
|
|
68
|
-
(g[Symbol.iterator] = function () {
|
|
69
|
-
return this;
|
|
70
|
-
}),
|
|
71
|
-
g
|
|
72
|
-
);
|
|
73
|
-
function verb(n) {
|
|
74
|
-
return function (v) {
|
|
75
|
-
return step([n, v]);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function step(op) {
|
|
79
|
-
if (f) throw new TypeError('Generator is already executing.');
|
|
80
|
-
while ((g && ((g = 0), op[0] && (_ = 0)), _))
|
|
81
|
-
try {
|
|
82
|
-
if (
|
|
83
|
-
((f = 1),
|
|
84
|
-
y &&
|
|
85
|
-
(t =
|
|
86
|
-
op[0] & 2
|
|
87
|
-
? y['return']
|
|
88
|
-
: op[0]
|
|
89
|
-
? y['throw'] || ((t = y['return']) && t.call(y), 0)
|
|
90
|
-
: y.next) &&
|
|
91
|
-
!(t = t.call(y, op[1])).done)
|
|
92
|
-
)
|
|
93
|
-
return t;
|
|
94
|
-
if (((y = 0), t)) op = [op[0] & 2, t.value];
|
|
95
|
-
switch (op[0]) {
|
|
96
|
-
case 0:
|
|
97
|
-
case 1:
|
|
98
|
-
t = op;
|
|
99
|
-
break;
|
|
100
|
-
case 4:
|
|
101
|
-
_.label++;
|
|
102
|
-
return { value: op[1], done: false };
|
|
103
|
-
case 5:
|
|
104
|
-
_.label++;
|
|
105
|
-
y = op[1];
|
|
106
|
-
op = [0];
|
|
107
|
-
continue;
|
|
108
|
-
case 7:
|
|
109
|
-
op = _.ops.pop();
|
|
110
|
-
_.trys.pop();
|
|
111
|
-
continue;
|
|
112
|
-
default:
|
|
113
|
-
if (
|
|
114
|
-
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
|
|
115
|
-
(op[0] === 6 || op[0] === 2)
|
|
116
|
-
) {
|
|
117
|
-
_ = 0;
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
121
|
-
_.label = op[1];
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
125
|
-
_.label = t[1];
|
|
126
|
-
t = op;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
if (t && _.label < t[2]) {
|
|
130
|
-
_.label = t[2];
|
|
131
|
-
_.ops.push(op);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
if (t[2]) _.ops.pop();
|
|
135
|
-
_.trys.pop();
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
op = body.call(thisArg, _);
|
|
139
|
-
} catch (e) {
|
|
140
|
-
op = [6, e];
|
|
141
|
-
y = 0;
|
|
142
|
-
} finally {
|
|
143
|
-
f = t = 0;
|
|
144
|
-
}
|
|
145
|
-
if (op[0] & 5) throw op[1];
|
|
146
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
47
|
// Component
|
|
151
48
|
var useLikes = function (_a) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
useEffect(
|
|
164
|
-
function () {
|
|
165
|
-
if (!isLoadingLikes) {
|
|
166
|
-
setLikes({
|
|
167
|
-
likesCount: defaultLikesCount,
|
|
168
|
-
isLiked: defaultIsLiked,
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
[isLoadingLikes]
|
|
173
|
-
);
|
|
174
|
-
var _c = useState(false),
|
|
175
|
-
isLoading = _c[0],
|
|
176
|
-
setIsLoading = _c[1];
|
|
177
|
-
var _d = useLikeAsset(),
|
|
178
|
-
likeAsset = _d.likeAsset,
|
|
179
|
-
errorLikeAsset = _d.errorLikeAsset;
|
|
180
|
-
var _e = useDisLikeAsset(),
|
|
181
|
-
dislikeAsset = _e.dislikeAsset,
|
|
182
|
-
errorDislikeAsset = _e.errorDislikeAsset;
|
|
183
|
-
var _f = useDislikeCollection(),
|
|
184
|
-
dislikeCollection = _f.dislikeCollection,
|
|
185
|
-
errorDislikeCollection = _f.errorDislikeCollection;
|
|
186
|
-
var _g = useLikeCollection(),
|
|
187
|
-
likeCollection = _g.likeCollection,
|
|
188
|
-
errorLikeCollection = _g.errorLikeCollection;
|
|
189
|
-
var openAlert = useUiStore(function (state) {
|
|
190
|
-
return state.openAlert;
|
|
191
|
-
});
|
|
192
|
-
var _h = useRemoveAssetFromGalleryV2(),
|
|
193
|
-
removeAssetFromGallery = _h.removeAssetFromGallery,
|
|
194
|
-
errorRemoveAsset = _h.errorRemoveAsset;
|
|
195
|
-
var _j = useRemoveCollectionFromGalleryV2(),
|
|
196
|
-
removeCollectionFromGallery = _j.removeCollectionFromGallery,
|
|
197
|
-
errorRemoveCollection = _j.errorRemoveCollection;
|
|
198
|
-
useEffect(
|
|
199
|
-
function () {
|
|
200
|
-
if (
|
|
201
|
-
errorLikeAsset ||
|
|
202
|
-
errorDislikeAsset ||
|
|
203
|
-
errorDislikeCollection ||
|
|
204
|
-
errorLikeCollection ||
|
|
205
|
-
errorRemoveAsset ||
|
|
206
|
-
errorRemoveCollection
|
|
207
|
-
) {
|
|
208
|
-
openAlert({
|
|
209
|
-
type: alertVariants.error,
|
|
210
|
-
caption: 'Oops, something went wrong.',
|
|
211
|
-
text: 'Please try another NFT',
|
|
212
|
-
});
|
|
213
|
-
setLikes({
|
|
214
|
-
likesCount: defaultLikesCount,
|
|
215
|
-
isLiked: false,
|
|
216
|
-
});
|
|
217
|
-
setIsLoading(false);
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
[
|
|
221
|
-
errorLikeAsset,
|
|
222
|
-
errorDislikeAsset,
|
|
223
|
-
errorDislikeCollection,
|
|
224
|
-
errorLikeCollection,
|
|
225
|
-
errorRemoveAsset,
|
|
226
|
-
errorRemoveCollection,
|
|
227
|
-
]
|
|
228
|
-
);
|
|
229
|
-
var addLike = function (id) {
|
|
230
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
231
|
-
return __generator(this, function (_a) {
|
|
232
|
-
switch (_a.label) {
|
|
233
|
-
case 0:
|
|
234
|
-
setIsLoading(true);
|
|
235
|
-
if (!(itemType === LabelKeys.asset)) return [3 /*break*/, 2];
|
|
236
|
-
return [4 /*yield*/, likeAsset({ assetId: id })];
|
|
237
|
-
case 1:
|
|
238
|
-
_a.sent();
|
|
239
|
-
return [3 /*break*/, 4];
|
|
240
|
-
case 2:
|
|
241
|
-
if (!(itemType === LabelKeys.collection)) return [3 /*break*/, 4];
|
|
242
|
-
return [4 /*yield*/, likeCollection({ collectionId: id })];
|
|
243
|
-
case 3:
|
|
244
|
-
_a.sent();
|
|
245
|
-
_a.label = 4;
|
|
246
|
-
case 4:
|
|
247
|
-
if (!errorLikeAsset || !errorLikeCollection) {
|
|
248
|
-
setLikes({
|
|
249
|
-
likesCount: likes.likesCount + 1,
|
|
250
|
-
isLiked: true,
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
setIsLoading(false);
|
|
254
|
-
return [2 /*return*/];
|
|
49
|
+
var defaultLikesCount = _a.defaultLikesCount, defaultIsLiked = _a.defaultIsLiked, itemType = _a.itemType, removeOnDislike = _a.removeOnDislike, isLoadingLikes = _a.isLoadingLikes;
|
|
50
|
+
var _b = useState({
|
|
51
|
+
likesCount: defaultLikesCount,
|
|
52
|
+
isLiked: defaultIsLiked,
|
|
53
|
+
}), likes = _b[0], setLikes = _b[1];
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
if (!isLoadingLikes) {
|
|
56
|
+
setLikes({
|
|
57
|
+
likesCount: defaultLikesCount,
|
|
58
|
+
isLiked: defaultIsLiked,
|
|
59
|
+
});
|
|
255
60
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
_a.sent();
|
|
280
|
-
removeOnDislike === null || removeOnDislike === void 0
|
|
281
|
-
? void 0
|
|
282
|
-
: removeOnDislike.removeFn(itemType);
|
|
283
|
-
_a.label = 3;
|
|
284
|
-
case 3:
|
|
285
|
-
return [3 /*break*/, 7];
|
|
286
|
-
case 4:
|
|
287
|
-
if (!(itemType === LabelKeys.collection)) return [3 /*break*/, 7];
|
|
288
|
-
return [4 /*yield*/, dislikeCollection({ collectionId: id })];
|
|
289
|
-
case 5:
|
|
290
|
-
_a.sent();
|
|
291
|
-
if (!(removeOnDislike && removeOnDislike.gallery))
|
|
292
|
-
return [3 /*break*/, 7];
|
|
293
|
-
return [
|
|
294
|
-
4 /*yield*/,
|
|
295
|
-
removeCollectionFromGallery({
|
|
296
|
-
galleryId: removeOnDislike.gallery.getGalleryId(),
|
|
297
|
-
collectionId: id,
|
|
298
|
-
}),
|
|
299
|
-
];
|
|
300
|
-
case 6:
|
|
301
|
-
_a.sent();
|
|
302
|
-
removeOnDislike === null || removeOnDislike === void 0
|
|
303
|
-
? void 0
|
|
304
|
-
: removeOnDislike.removeFn(itemType);
|
|
305
|
-
_a.label = 7;
|
|
306
|
-
case 7:
|
|
307
|
-
if (!errorDislikeAsset || !errorDislikeCollection) {
|
|
308
|
-
setLikes({
|
|
309
|
-
likesCount: likes.likesCount - 1,
|
|
61
|
+
}, [isLoadingLikes]);
|
|
62
|
+
var _c = useState(false), isLoading = _c[0], setIsLoading = _c[1];
|
|
63
|
+
var _d = useLikeAsset(), likeAsset = _d.likeAsset, errorLikeAsset = _d.errorLikeAsset;
|
|
64
|
+
var _e = useDisLikeAsset(), dislikeAsset = _e.dislikeAsset, errorDislikeAsset = _e.errorDislikeAsset;
|
|
65
|
+
var _f = useDislikeCollection(), dislikeCollection = _f.dislikeCollection, errorDislikeCollection = _f.errorDislikeCollection;
|
|
66
|
+
var _g = useLikeCollection(), likeCollection = _g.likeCollection, errorLikeCollection = _g.errorLikeCollection;
|
|
67
|
+
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
68
|
+
var _h = useRemoveAssetFromGalleryV2(), removeAssetFromGallery = _h.removeAssetFromGallery, errorRemoveAsset = _h.errorRemoveAsset;
|
|
69
|
+
var _j = useRemoveCollectionFromGalleryV2(), removeCollectionFromGallery = _j.removeCollectionFromGallery, errorRemoveCollection = _j.errorRemoveCollection;
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
if (errorLikeAsset ||
|
|
72
|
+
errorDislikeAsset ||
|
|
73
|
+
errorDislikeCollection ||
|
|
74
|
+
errorLikeCollection ||
|
|
75
|
+
errorRemoveAsset ||
|
|
76
|
+
errorRemoveCollection) {
|
|
77
|
+
openAlert({
|
|
78
|
+
type: alertVariants.error,
|
|
79
|
+
caption: 'Oops, something went wrong.',
|
|
80
|
+
text: 'Please try another NFT',
|
|
81
|
+
});
|
|
82
|
+
setLikes({
|
|
83
|
+
likesCount: defaultLikesCount,
|
|
310
84
|
isLiked: false,
|
|
311
|
-
|
|
312
|
-
}
|
|
85
|
+
});
|
|
313
86
|
setIsLoading(false);
|
|
314
|
-
return [2 /*return*/];
|
|
315
87
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
88
|
+
}, [
|
|
89
|
+
errorLikeAsset,
|
|
90
|
+
errorDislikeAsset,
|
|
91
|
+
errorDislikeCollection,
|
|
92
|
+
errorLikeCollection,
|
|
93
|
+
errorRemoveAsset,
|
|
94
|
+
errorRemoveCollection,
|
|
95
|
+
]);
|
|
96
|
+
var addLike = function (id) { return __awaiter(void 0, void 0, void 0, function () {
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
setIsLoading(true);
|
|
101
|
+
if (!(itemType === LabelKeys.asset)) return [3 /*break*/, 2];
|
|
102
|
+
return [4 /*yield*/, likeAsset({ assetId: id })];
|
|
103
|
+
case 1:
|
|
104
|
+
_a.sent();
|
|
105
|
+
return [3 /*break*/, 4];
|
|
106
|
+
case 2:
|
|
107
|
+
if (!(itemType === LabelKeys.collection)) return [3 /*break*/, 4];
|
|
108
|
+
return [4 /*yield*/, likeCollection({ collectionId: id })];
|
|
109
|
+
case 3:
|
|
110
|
+
_a.sent();
|
|
111
|
+
_a.label = 4;
|
|
112
|
+
case 4:
|
|
113
|
+
if (!errorLikeAsset || !errorLikeCollection) {
|
|
114
|
+
setLikes({
|
|
115
|
+
likesCount: likes.likesCount + 1,
|
|
116
|
+
isLiked: true,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
setIsLoading(false);
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); };
|
|
124
|
+
var deleteLike = function (id) { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
switch (_a.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
setIsLoading(true);
|
|
129
|
+
if (!(itemType === LabelKeys.asset)) return [3 /*break*/, 4];
|
|
130
|
+
return [4 /*yield*/, dislikeAsset({ assetId: id })];
|
|
131
|
+
case 1:
|
|
132
|
+
_a.sent();
|
|
133
|
+
if (!(removeOnDislike && removeOnDislike.gallery)) return [3 /*break*/, 3];
|
|
134
|
+
return [4 /*yield*/, removeAssetFromGallery({
|
|
135
|
+
galleryId: removeOnDislike.gallery.getGalleryId(),
|
|
136
|
+
assetId: id,
|
|
137
|
+
})];
|
|
138
|
+
case 2:
|
|
139
|
+
_a.sent();
|
|
140
|
+
removeOnDislike === null || removeOnDislike === void 0 ? void 0 : removeOnDislike.removeFn(itemType);
|
|
141
|
+
_a.label = 3;
|
|
142
|
+
case 3: return [3 /*break*/, 7];
|
|
143
|
+
case 4:
|
|
144
|
+
if (!(itemType === LabelKeys.collection)) return [3 /*break*/, 7];
|
|
145
|
+
return [4 /*yield*/, dislikeCollection({ collectionId: id })];
|
|
146
|
+
case 5:
|
|
147
|
+
_a.sent();
|
|
148
|
+
if (!(removeOnDislike && removeOnDislike.gallery)) return [3 /*break*/, 7];
|
|
149
|
+
return [4 /*yield*/, removeCollectionFromGallery({
|
|
150
|
+
galleryId: removeOnDislike.gallery.getGalleryId(),
|
|
151
|
+
collectionId: id,
|
|
152
|
+
})];
|
|
153
|
+
case 6:
|
|
154
|
+
_a.sent();
|
|
155
|
+
removeOnDislike === null || removeOnDislike === void 0 ? void 0 : removeOnDislike.removeFn(itemType);
|
|
156
|
+
_a.label = 7;
|
|
157
|
+
case 7:
|
|
158
|
+
if (!errorDislikeAsset || !errorDislikeCollection) {
|
|
159
|
+
setLikes({
|
|
160
|
+
likesCount: likes.likesCount - 1,
|
|
161
|
+
isLiked: false,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
setIsLoading(false);
|
|
165
|
+
return [2 /*return*/];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}); };
|
|
169
|
+
return { likes: likes, addLike: addLike, deleteLike: deleteLike, isLoading: isLoading };
|
|
325
170
|
};
|
|
326
171
|
// Export
|
|
327
172
|
export default useLikes;
|
|
@@ -1,139 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { shallow } from 'zustand/shallow';
|
|
4
|
-
import { createWithEqualityFn } from 'zustand/traditional';
|
|
5
|
-
|
|
6
|
-
import { useUiStore } from '@/store/ui';
|
|
7
|
-
|
|
8
|
-
import AddCreationToGallery from '@/components/gallery/add/addCreationToGallery';
|
|
9
|
-
|
|
10
|
-
var __assign =
|
|
11
|
-
(this && this.__assign) ||
|
|
12
|
-
function () {
|
|
13
|
-
__assign =
|
|
14
|
-
Object.assign ||
|
|
15
|
-
function (t) {
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
16
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
20
7
|
}
|
|
21
8
|
return t;
|
|
22
|
-
|
|
9
|
+
};
|
|
23
10
|
return __assign.apply(this, arguments);
|
|
24
|
-
|
|
25
|
-
var __spreadArray =
|
|
26
|
-
|
|
27
|
-
function (to, from, pack) {
|
|
28
|
-
if (pack || arguments.length === 2)
|
|
29
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
14
|
if (ar || !(i in from)) {
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
33
17
|
}
|
|
34
|
-
|
|
18
|
+
}
|
|
35
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
};
|
|
21
|
+
import { useEffect } from 'react';
|
|
22
|
+
import { shallow } from 'zustand/shallow';
|
|
23
|
+
import { createWithEqualityFn } from 'zustand/traditional';
|
|
24
|
+
import { useUiStore } from '@/store/ui';
|
|
25
|
+
import AddCreationToGallery from '@/components/gallery/add/addCreationToGallery';
|
|
38
26
|
export var getIsActiveCreation = function (creations, creation) {
|
|
39
|
-
|
|
40
|
-
return gCreation.getCreationId() === creation.getCreationId();
|
|
41
|
-
});
|
|
27
|
+
return !!creations.find(function (gCreation) { return gCreation.getCreationId() === creation.getCreationId(); });
|
|
42
28
|
};
|
|
43
|
-
export var useToGalleryStore = createWithEqualityFn()(function (
|
|
44
|
-
setState,
|
|
45
|
-
getState
|
|
46
|
-
) {
|
|
47
|
-
return {
|
|
29
|
+
export var useToGalleryStore = createWithEqualityFn()(function (setState, getState) { return ({
|
|
48
30
|
isActiveGalleryMode: false,
|
|
49
31
|
activateGalleryMode: function () {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
setState({
|
|
33
|
+
isActiveGalleryMode: true,
|
|
34
|
+
});
|
|
53
35
|
},
|
|
54
36
|
disableGalleryMode: function () {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
setState({
|
|
38
|
+
isActiveGalleryMode: false,
|
|
39
|
+
});
|
|
58
40
|
},
|
|
59
41
|
creationsToGallery: [],
|
|
60
42
|
addCreationToGallery: function (creation) {
|
|
61
|
-
|
|
62
|
-
return __assign(__assign({}, prev), {
|
|
63
|
-
creationsToGallery: __spreadArray(
|
|
64
|
-
__spreadArray([], prev.creationsToGallery, true),
|
|
65
|
-
[creation],
|
|
66
|
-
false
|
|
67
|
-
),
|
|
68
|
-
});
|
|
69
|
-
});
|
|
43
|
+
setState(function (prev) { return (__assign(__assign({}, prev), { creationsToGallery: __spreadArray(__spreadArray([], prev.creationsToGallery, true), [creation], false) })); });
|
|
70
44
|
},
|
|
71
45
|
removeCreationFromGallery: function (itemId) {
|
|
72
|
-
|
|
73
|
-
return __assign(__assign({}, prev), {
|
|
74
|
-
creationsToGallery: prev.creationsToGallery.filter(function (
|
|
75
|
-
pCreation
|
|
76
|
-
) {
|
|
77
|
-
return pCreation.getCreationId() !== itemId;
|
|
78
|
-
}),
|
|
79
|
-
});
|
|
80
|
-
});
|
|
46
|
+
setState(function (prev) { return (__assign(__assign({}, prev), { creationsToGallery: prev.creationsToGallery.filter(function (pCreation) { return pCreation.getCreationId() !== itemId; }) })); });
|
|
81
47
|
},
|
|
82
48
|
removeCreationFromGalleryWithCallback: function (itemId, closeCallback) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
49
|
+
setState(function (prev) {
|
|
50
|
+
var newCreations = prev.creationsToGallery.filter(function (pCreation) { return pCreation.getCreationId() !== itemId; });
|
|
51
|
+
if (!newCreations.length) {
|
|
52
|
+
closeCallback();
|
|
53
|
+
return {
|
|
54
|
+
creationsToGallery: newCreations,
|
|
55
|
+
isActiveGalleryMode: false,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
creationsToGallery: newCreations,
|
|
60
|
+
};
|
|
86
61
|
});
|
|
87
|
-
if (!newCreations.length) {
|
|
88
|
-
closeCallback();
|
|
89
|
-
return {
|
|
90
|
-
creationsToGallery: newCreations,
|
|
91
|
-
isActiveGalleryMode: false,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
creationsToGallery: newCreations,
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
62
|
},
|
|
99
63
|
toggleCreationToGallery: function (creation) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
addCreationToGallery(creation);
|
|
108
|
-
}
|
|
64
|
+
var _a = getState(), removeCreationFromGallery = _a.removeCreationFromGallery, addCreationToGallery = _a.addCreationToGallery, creationsToGallery = _a.creationsToGallery;
|
|
65
|
+
if (getIsActiveCreation(creationsToGallery, creation)) {
|
|
66
|
+
removeCreationFromGallery(creation.getCreationId());
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
addCreationToGallery(creation);
|
|
70
|
+
}
|
|
109
71
|
},
|
|
110
72
|
resetCreationsInGallery: function () {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
73
|
+
setState({
|
|
74
|
+
creationsToGallery: [],
|
|
75
|
+
isActiveGalleryMode: false,
|
|
76
|
+
});
|
|
115
77
|
},
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
shallow);
|
|
78
|
+
}); }, shallow);
|
|
119
79
|
export var useInitializeToGalleryAsset = function () {
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
80
|
+
var openModalSidebarPortal = useUiStore(function (state) { return state.openModalSidebarPortal; });
|
|
81
|
+
var resetCreationsInGallery = useToGalleryStore(function (state) { return ({
|
|
82
|
+
resetCreationsInGallery: state.resetCreationsInGallery,
|
|
83
|
+
}); }).resetCreationsInGallery;
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
return function () {
|
|
86
|
+
resetCreationsInGallery();
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
var handleAddToGallery = function () {
|
|
90
|
+
openModalSidebarPortal(<AddCreationToGallery />);
|
|
126
91
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return function () {
|
|
130
|
-
resetCreationsInGallery();
|
|
92
|
+
return {
|
|
93
|
+
handleAddToGallery: handleAddToGallery,
|
|
131
94
|
};
|
|
132
|
-
}, []);
|
|
133
|
-
var handleAddToGallery = function () {
|
|
134
|
-
openModalSidebarPortal(<AddCreationToGallery />);
|
|
135
|
-
};
|
|
136
|
-
return {
|
|
137
|
-
handleAddToGallery: handleAddToGallery,
|
|
138
|
-
};
|
|
139
95
|
};
|