@redneckz/wildless-cms-uni-blocks 0.6.40 → 0.6.42
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +161 -47
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/bundle/hooks/useLocation.d.ts +6 -0
- package/bundle/hooks/useRegions.d.ts +6 -0
- package/bundle/model/LogoType.d.ts +5 -0
- package/bundle/services/sitemap/SitemapProps.d.ts +10 -4
- package/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/bundle/ui-kit/Logo/Logo.d.ts +2 -5
- package/bundle/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/bundle/utils/groupBy.d.ts +1 -0
- package/dist/components/Blocks.js +6 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/dist/components/Calculator/constants.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +2 -2
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderBurger.js +4 -3
- package/dist/components/Header/HeaderBurger.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.d.ts +2 -0
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +8 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/dist/hooks/useCachedAsyncData.js +25 -0
- package/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/dist/hooks/useLocation.d.ts +6 -0
- package/dist/hooks/useLocation.js +26 -0
- package/dist/hooks/useLocation.js.map +1 -0
- package/dist/hooks/useRegions.d.ts +6 -0
- package/dist/hooks/useRegions.js +11 -0
- package/dist/hooks/useRegions.js.map +1 -0
- package/dist/model/LogoType.d.ts +5 -0
- package/dist/model/LogoType.js +2 -0
- package/dist/model/LogoType.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +10 -4
- package/dist/ui-kit/Location/Location.d.ts +19 -0
- package/dist/ui-kit/Location/Location.js +44 -0
- package/dist/ui-kit/Location/Location.js.map +1 -0
- package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/dist/ui-kit/Location/SearchBar.js +9 -0
- package/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/dist/ui-kit/Logo/Logo.d.ts +2 -5
- package/dist/ui-kit/Logo/Logo.js +3 -21
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/dist/ui-kit/Logo/Logo.mobile.js +4 -15
- package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/dist/ui-kit/Logo/renderImage.js +20 -0
- package/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/utils/groupBy.d.ts +1 -0
- package/dist/utils/groupBy.js +13 -0
- package/dist/utils/groupBy.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +6 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.fixture.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/lib/components/Calculator/constants.js +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +2 -2
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderBurger.js +4 -3
- package/lib/components/Header/HeaderBurger.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.d.ts +2 -0
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
- package/lib/components/ProductTile/ProductTile.js +8 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/lib/hooks/useCachedAsyncData.js +22 -0
- package/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/lib/hooks/useLocation.d.ts +6 -0
- package/lib/hooks/useLocation.js +23 -0
- package/lib/hooks/useLocation.js.map +1 -0
- package/lib/hooks/useRegions.d.ts +6 -0
- package/lib/hooks/useRegions.js +8 -0
- package/lib/hooks/useRegions.js.map +1 -0
- package/lib/model/LogoType.d.ts +5 -0
- package/lib/model/LogoType.js +2 -0
- package/lib/model/LogoType.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +10 -4
- package/lib/ui-kit/Location/Location.d.ts +19 -0
- package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
- package/lib/ui-kit/Location/Location.js +42 -0
- package/lib/ui-kit/Location/Location.js.map +1 -0
- package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/lib/ui-kit/Location/SearchBar.js +7 -0
- package/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/lib/ui-kit/Logo/Logo.d.ts +2 -5
- package/lib/ui-kit/Logo/Logo.js +4 -22
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/lib/ui-kit/Logo/Logo.mobile.js +5 -16
- package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/lib/ui-kit/Logo/renderImage.d.ts +5 -0
- package/lib/ui-kit/Logo/renderImage.js +17 -0
- package/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/lib/ui-kit/Logo/renderTitle.d.ts +2 -0
- package/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/utils/groupBy.d.ts +1 -0
- package/lib/utils/groupBy.js +10 -0
- package/lib/utils/groupBy.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +65 -26
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/bundle/hooks/useLocation.d.ts +6 -0
- package/mobile/bundle/hooks/useRegions.d.ts +6 -0
- package/mobile/bundle/model/LogoType.d.ts +5 -0
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/bundle/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/bundle/utils/groupBy.d.ts +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/dist/components/Calculator/constants.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/dist/components/Header/Header.js +2 -2
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderBurger.js +4 -3
- package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +8 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
- package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/dist/hooks/useLocation.d.ts +6 -0
- package/mobile/dist/hooks/useLocation.js +26 -0
- package/mobile/dist/hooks/useLocation.js.map +1 -0
- package/mobile/dist/hooks/useRegions.d.ts +6 -0
- package/mobile/dist/hooks/useRegions.js +11 -0
- package/mobile/dist/hooks/useRegions.js.map +1 -0
- package/mobile/dist/model/LogoType.d.ts +5 -0
- package/mobile/dist/model/LogoType.js +2 -0
- package/mobile/dist/model/LogoType.js.map +1 -0
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/dist/ui-kit/Location/Location.js +44 -0
- package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
- package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/dist/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/dist/ui-kit/Logo/Logo.js +4 -15
- package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js +20 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/utils/groupBy.d.ts +1 -0
- package/mobile/dist/utils/groupBy.js +13 -0
- package/mobile/dist/utils/groupBy.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/lib/components/Calculator/constants.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/lib/components/Header/Header.js +2 -2
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderBurger.js +4 -3
- package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +8 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
- package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/lib/hooks/useLocation.d.ts +6 -0
- package/mobile/lib/hooks/useLocation.js +23 -0
- package/mobile/lib/hooks/useLocation.js.map +1 -0
- package/mobile/lib/hooks/useRegions.d.ts +6 -0
- package/mobile/lib/hooks/useRegions.js +8 -0
- package/mobile/lib/hooks/useRegions.js.map +1 -0
- package/mobile/lib/model/LogoType.d.ts +5 -0
- package/mobile/lib/model/LogoType.js +2 -0
- package/mobile/lib/model/LogoType.js.map +1 -0
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/lib/ui-kit/Location/Location.js +42 -0
- package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
- package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/lib/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/lib/ui-kit/Logo/Logo.js +5 -16
- package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/lib/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js +17 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/utils/groupBy.d.ts +1 -0
- package/mobile/lib/utils/groupBy.js +10 -0
- package/mobile/lib/utils/groupBy.js.map +1 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/mobile/src/components/Header/Header.tsx +2 -2
- package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/mobile/src/components/Header/HeaderTop.tsx +4 -2
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +2 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +34 -18
- package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
- package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
- package/mobile/src/hooks/useLocation.ts +48 -0
- package/mobile/src/hooks/useRegions.ts +16 -0
- package/mobile/src/model/LogoType.ts +6 -0
- package/mobile/src/services/sitemap/SitemapProps.ts +11 -4
- package/mobile/src/ui-kit/Location/Location.tsx +168 -0
- package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/mobile/src/ui-kit/Logo/Logo.tsx +16 -31
- package/mobile/src/ui-kit/Logo/renderImage.tsx +40 -0
- package/mobile/src/ui-kit/Logo/renderTitle.tsx +15 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/mobile/src/utils/groupBy.ts +10 -0
- package/package.json +2 -2
- package/src/components/Blocks.ts +6 -2
- package/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +18 -0
- package/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Carousel/Carousel.fixture.tsx +22 -4
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/src/components/Header/Header.mobile.tsx +2 -2
- package/src/components/Header/Header.tsx +6 -4
- package/src/components/Header/HeaderBurger.tsx +5 -7
- package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/src/components/Header/HeaderTop.tsx +4 -2
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/src/components/ProductTile/ProductTile.example.json +2 -1
- package/src/components/ProductTile/ProductTile.fixture.tsx +13 -0
- package/src/components/ProductTile/ProductTile.tsx +34 -18
- package/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/src/components/Recommendation/Recommendation.example.json +6 -5
- package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
- package/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/hooks/useCachedAsyncData.ts +37 -0
- package/src/hooks/useLocation.ts +48 -0
- package/src/hooks/useRegions.ts +16 -0
- package/src/model/LogoType.ts +6 -0
- package/src/services/sitemap/SitemapProps.ts +11 -4
- package/src/ui-kit/Location/Location.fixture.tsx +81 -0
- package/src/ui-kit/Location/Location.tsx +168 -0
- package/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/src/ui-kit/Logo/Logo.mobile.tsx +16 -31
- package/src/ui-kit/Logo/Logo.tsx +6 -43
- package/src/ui-kit/Logo/renderImage.tsx +40 -0
- package/src/ui-kit/Logo/renderTitle.tsx +15 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/src/utils/groupBy.ts +10 -0
- package/bundle/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.js +0 -21
- package/dist/hooks/useGeolocation.js.map +0 -1
- package/lib/hooks/useGeolocation.d.ts +0 -1
- package/lib/hooks/useGeolocation.js +0 -18
- package/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.js +0 -21
- package/mobile/dist/hooks/useGeolocation.js.map +0 -1
- package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
- package/mobile/lib/hooks/useGeolocation.js +0 -18
- package/mobile/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/src/hooks/useGeolocation.ts +0 -22
- package/src/hooks/useGeolocation.ts +0 -22
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BaseTile } from '../BaseTile/BaseTile';
|
|
2
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { BorderVersionStyleMap } from '../../model/BorderVersion';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
7
|
+
import { List } from '../../ui-kit/List/List';
|
|
8
|
+
import { renderButton } from '../../ui-kit/Button/ButtonSection';
|
|
9
|
+
import { SocialMedia } from '../Footer/SocialMedia';
|
|
10
|
+
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
11
|
+
import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
|
|
12
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
13
|
+
|
|
14
|
+
export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {}
|
|
15
|
+
|
|
16
|
+
export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
|
|
17
|
+
({
|
|
18
|
+
button,
|
|
19
|
+
className = '',
|
|
20
|
+
description,
|
|
21
|
+
image,
|
|
22
|
+
items = [],
|
|
23
|
+
socialMedia = [],
|
|
24
|
+
title,
|
|
25
|
+
version = 'primary',
|
|
26
|
+
...rest
|
|
27
|
+
}) => {
|
|
28
|
+
const tileTitle = title ? (
|
|
29
|
+
<Heading headingType="h5" as="h3" className="mb-3.5 z-10" title={title} />
|
|
30
|
+
) : null;
|
|
31
|
+
const tileImage = image?.src ? (
|
|
32
|
+
<Img className="absolute bottom-0 right-0 m-0" image={image} />
|
|
33
|
+
) : null;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<BlockWrapper
|
|
37
|
+
className={`relative text-left border border-solid box-border p-7 min-w-[524px]
|
|
38
|
+
${BorderVersionStyleMap[version]}
|
|
39
|
+
${VersionStyleMap[version]}
|
|
40
|
+
${className}`}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
<BaseTile className="flex justify-between" title={tileTitle} image={tileImage}>
|
|
44
|
+
<div className="h-full flex flex-col justify-between">
|
|
45
|
+
{description ? <span className="mb-2">{description}</span> : null}
|
|
46
|
+
{items.length ? (
|
|
47
|
+
<List
|
|
48
|
+
className="text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]"
|
|
49
|
+
items={items}
|
|
50
|
+
version={version}
|
|
51
|
+
/>
|
|
52
|
+
) : null}
|
|
53
|
+
{socialMedia.length ? (
|
|
54
|
+
<SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
|
|
55
|
+
) : null}
|
|
56
|
+
{button?.text ? <div className="pt-2 mt-16">{renderButton({ button })}</div> : null}
|
|
57
|
+
</div>
|
|
58
|
+
</BaseTile>
|
|
59
|
+
</BlockWrapper>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
4
|
+
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Карточка рекомендаций
|
|
10
|
+
*/
|
|
11
|
+
export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
|
|
12
|
+
/**
|
|
13
|
+
* @title Соц сети
|
|
14
|
+
* @minItems 3
|
|
15
|
+
* @default [
|
|
16
|
+
* { "href": "https://t.me" },
|
|
17
|
+
* { "href": "https://vk.com" },
|
|
18
|
+
* { "href": "https://ok.ru" },
|
|
19
|
+
* ]
|
|
20
|
+
*/
|
|
21
|
+
socialMedia?: LinkCommonProps[];
|
|
22
|
+
/**
|
|
23
|
+
* @default {
|
|
24
|
+
* "format": "webp",
|
|
25
|
+
* "size": {
|
|
26
|
+
* "width": 290
|
|
27
|
+
* },
|
|
28
|
+
* "sources": [{
|
|
29
|
+
* "media": 1279,
|
|
30
|
+
* "width": 174,
|
|
31
|
+
* "format": "webp",
|
|
32
|
+
* "alignment": "southeast"
|
|
33
|
+
* }]
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
image?: Picture;
|
|
37
|
+
/**
|
|
38
|
+
* @default {
|
|
39
|
+
* "text": "",
|
|
40
|
+
* "version": "secondary"
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
button?: ButtonProps;
|
|
44
|
+
version?: BlockVersion;
|
|
45
|
+
}
|
|
@@ -22,7 +22,7 @@ export const Header = JSX<HeaderProps>(({ className = '', bgColor = 'bg-white',
|
|
|
22
22
|
const router = useRouter();
|
|
23
23
|
|
|
24
24
|
const fallback: Fallback | undefined = rest.options?.page?.fallback;
|
|
25
|
-
const { topItems, dispositions, defaultLocation } = useSWRResource<SitemapDataProps>(
|
|
25
|
+
const { topItems, dispositions, defaultLocation, logo } = useSWRResource<SitemapDataProps>(
|
|
26
26
|
projectSettings.SITEMAP || 'sitemap',
|
|
27
27
|
fallback,
|
|
28
28
|
);
|
|
@@ -36,7 +36,7 @@ export const Header = JSX<HeaderProps>(({ className = '', bgColor = 'bg-white',
|
|
|
36
36
|
return (
|
|
37
37
|
<header className={`${bgColor} ${className}`}>
|
|
38
38
|
<div className="container px-4 py-0 box-border">
|
|
39
|
-
<HeaderTop onClick={handleBurgerMenuShow} bgColor={bgColor} />
|
|
39
|
+
<HeaderTop onClick={handleBurgerMenuShow} bgColor={bgColor} logo={logo} />
|
|
40
40
|
<nav className="flex items-center m-0 p-0 overflow-y-hidden w-full h-12">
|
|
41
41
|
<div className="flex no-scrollbar horizontal-list h-full items-center">
|
|
42
42
|
{subItems?.map((_, i) => (
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
3
|
import type { VNode } from '../../model/VNode';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
6
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
6
7
|
import type { DispositionItem } from './HeaderContent';
|
|
7
8
|
|
|
8
9
|
export interface HeaderBurgerProps {
|
|
@@ -14,7 +15,7 @@ export interface HeaderBurgerProps {
|
|
|
14
15
|
|
|
15
16
|
export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
16
17
|
({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
17
|
-
const [
|
|
18
|
+
const [location] = useLocation(defaultLocation);
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
|
|
@@ -24,10 +25,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
24
25
|
>
|
|
25
26
|
<Img image="CloseIcon" width="24" height="24" asSVG />
|
|
26
27
|
</button>
|
|
27
|
-
<button
|
|
28
|
-
onClick={getCity}
|
|
29
|
-
className="flex items-center text-s text-secondary-text p-0 mb-4 bg-transparent cursor-pointer"
|
|
30
|
-
>
|
|
28
|
+
<button className="flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer">
|
|
31
29
|
<Img
|
|
32
30
|
image="GeolocationIcon"
|
|
33
31
|
width="20"
|
|
@@ -35,7 +33,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
35
33
|
className="text-primary-main box-border mr-2"
|
|
36
34
|
asSVG
|
|
37
35
|
/>
|
|
38
|
-
{
|
|
36
|
+
<Text color="text-secondary-text">{location.name}</Text>
|
|
39
37
|
</button>
|
|
40
38
|
{children}
|
|
41
39
|
<div className="mb-7">{burgerSubMenu?.map(renderBurgerSubMenuItem)}</div>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
4
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
4
5
|
import type { IconVersion } from '../../model/IconVersion';
|
|
6
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
5
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
+
import { Location } from '../../ui-kit/Location/Location';
|
|
6
9
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
7
10
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
8
11
|
|
|
@@ -10,6 +13,7 @@ interface HeaderSecondaryMenuContent {
|
|
|
10
13
|
defaultLocation?: string;
|
|
11
14
|
officesLink?: string;
|
|
12
15
|
bgColor?: BgColorVersion;
|
|
16
|
+
foreignOffices?: ForeignOffice[];
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
@@ -30,8 +34,23 @@ const LINKS_ICON_VERSION_MAP: Record<BgColorVersion, IconVersion> = {
|
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
33
|
-
({
|
|
34
|
-
|
|
37
|
+
({
|
|
38
|
+
className,
|
|
39
|
+
officesLink,
|
|
40
|
+
defaultLocation = 'Москва',
|
|
41
|
+
foreignOffices,
|
|
42
|
+
bgColor = 'bg-white',
|
|
43
|
+
}) => {
|
|
44
|
+
const [isShowLocationModal, setShowLocationModal] = useState<boolean>(false);
|
|
45
|
+
|
|
46
|
+
const [location, onChangeLocation] = useLocation(defaultLocation);
|
|
47
|
+
|
|
48
|
+
const showLocationModal = () => {
|
|
49
|
+
setShowLocationModal(true);
|
|
50
|
+
};
|
|
51
|
+
const hideLocationModal = () => {
|
|
52
|
+
setShowLocationModal(false);
|
|
53
|
+
};
|
|
35
54
|
|
|
36
55
|
return (
|
|
37
56
|
<div className={`flex items-center ${className || ''}`}>
|
|
@@ -39,9 +58,9 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
39
58
|
className="mr-5"
|
|
40
59
|
flat={true}
|
|
41
60
|
href="#"
|
|
42
|
-
text={
|
|
61
|
+
text={location.name}
|
|
43
62
|
ariaLabel="Местоположение"
|
|
44
|
-
onClick={
|
|
63
|
+
onClick={showLocationModal}
|
|
45
64
|
bgColor={bgColor}
|
|
46
65
|
/>
|
|
47
66
|
{officesLink ? (
|
|
@@ -76,6 +95,14 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
76
95
|
asSVG
|
|
77
96
|
/>
|
|
78
97
|
</HeaderSecondaryMenuButton>
|
|
98
|
+
{isShowLocationModal ? (
|
|
99
|
+
<Location
|
|
100
|
+
currentLocation={location}
|
|
101
|
+
foreignOffices={foreignOffices}
|
|
102
|
+
onChangeLocation={onChangeLocation}
|
|
103
|
+
close={hideLocationModal}
|
|
104
|
+
/>
|
|
105
|
+
) : null}
|
|
79
106
|
</div>
|
|
80
107
|
);
|
|
81
108
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
3
|
+
import type { LogoType } from '../../model/LogoType';
|
|
3
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
4
5
|
import { Logo } from '../../ui-kit/Logo/Logo';
|
|
5
6
|
|
|
6
7
|
export interface HeaderTopProps {
|
|
7
8
|
onClick: () => void;
|
|
8
9
|
bgColor?: BgColorVersion;
|
|
10
|
+
logo?: LogoType;
|
|
9
11
|
}
|
|
10
|
-
export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
|
|
12
|
+
export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor, logo }) => (
|
|
11
13
|
<div className="flex items-center justify-between border-0 border-b border-main-divider h-12">
|
|
12
14
|
<div className="flex items-center">
|
|
13
15
|
<button
|
|
@@ -23,7 +25,7 @@ export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
|
|
|
23
25
|
asSVG
|
|
24
26
|
/>
|
|
25
27
|
</button>
|
|
26
|
-
<Logo className="mr-8" bgColor={bgColor} />
|
|
28
|
+
<Logo className="mr-8" bgColor={bgColor} logo={logo} />
|
|
27
29
|
</div>
|
|
28
30
|
<button
|
|
29
31
|
className={`${
|
|
@@ -22,30 +22,33 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
22
22
|
benefits = [],
|
|
23
23
|
buttons,
|
|
24
24
|
image,
|
|
25
|
+
isImageOnRightSide = true,
|
|
25
26
|
version = 'primary',
|
|
26
27
|
...rest
|
|
27
28
|
}) => (
|
|
28
29
|
<BlockWrapper
|
|
29
|
-
className={`overflow-hidden font-sans p-9 box-border relative
|
|
30
|
-
${
|
|
30
|
+
className={`overflow-hidden font-sans p-9 box-border relative min-h-[364px]
|
|
31
|
+
${VersionStyleMap[version]} ${getTileRightPadding(className)} ${className}`}
|
|
31
32
|
{...rest}
|
|
32
33
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
<div className={`flex flex-col ${isImageOnRightSide ? '' : 'items-end'}`}>
|
|
35
|
+
<Headline
|
|
36
|
+
className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
|
|
37
|
+
as="h2"
|
|
38
|
+
title={title}
|
|
39
|
+
description={description}
|
|
40
|
+
headlineVersion={headlineVersion}
|
|
41
|
+
bgColorHeadline={version}
|
|
42
|
+
align="left"
|
|
43
|
+
{...rest}
|
|
44
|
+
/>
|
|
45
|
+
{renderBenefits(benefits, version, image)}
|
|
46
|
+
{additionalDescription ? renderAdditionalDescription(additionalDescription, image) : null}
|
|
47
|
+
{buttons?.length ? (
|
|
48
|
+
<ButtonSection buttons={buttons} className="mt-5 gap-4 z-10 text-l" />
|
|
49
|
+
) : null}
|
|
50
|
+
</div>
|
|
51
|
+
{renderImage(image, isImageOnRightSide)}
|
|
49
52
|
</BlockWrapper>
|
|
50
53
|
),
|
|
51
54
|
);
|
|
@@ -87,3 +90,16 @@ function renderAdditionalDescription(additionalDescription: string, image?: Pict
|
|
|
87
90
|
<div className={`text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`}>{additionalDescription}</div>
|
|
88
91
|
);
|
|
89
92
|
}
|
|
93
|
+
|
|
94
|
+
function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
95
|
+
if (!image?.src) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Img
|
|
101
|
+
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
102
|
+
image={image}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"title": "Заголовок 2",
|
|
30
30
|
"description": "Описание 2",
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
"button": {
|
|
32
|
+
"href": "",
|
|
33
|
+
"text": "Подробнее",
|
|
34
|
+
"target": "_self",
|
|
35
|
+
"version": "primary"
|
|
36
|
+
}
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
"image": {
|
|
@@ -41,7 +41,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
41
41
|
<SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
|
|
42
42
|
) : null}
|
|
43
43
|
{button?.text ? (
|
|
44
|
-
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16' })}</div>
|
|
44
|
+
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16 px-5' })}</div>
|
|
45
45
|
) : null}
|
|
46
46
|
</div>
|
|
47
47
|
</BaseTile>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import type { AsyncDataResponse, Fetcher } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
3
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
4
|
+
|
|
5
|
+
const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
|
|
6
|
+
|
|
7
|
+
export function useCachedAsyncData<Data = any>(
|
|
8
|
+
key: string,
|
|
9
|
+
fetcher: Fetcher<Data, string>,
|
|
10
|
+
storage: any = globalThis?.localStorage,
|
|
11
|
+
): AsyncDataResponse<Data> {
|
|
12
|
+
const cachedFetcher: typeof fetcher = useCallback(
|
|
13
|
+
async (...args) => {
|
|
14
|
+
const storageKey = `async:${key}`;
|
|
15
|
+
const storageData: string = storage.getItem(storageKey);
|
|
16
|
+
|
|
17
|
+
const cachedData = getParsedData(storageData);
|
|
18
|
+
if (cachedData) {
|
|
19
|
+
return cachedData;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const data = await fetcher(...args);
|
|
23
|
+
storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
},
|
|
27
|
+
[key, fetcher],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return useAsyncData(key, cachedFetcher);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getParsedData(storageData: string) {
|
|
34
|
+
const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
|
|
35
|
+
|
|
36
|
+
return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
|
|
37
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { fetchJSONUnsafe } from '../utils/fetchJSON';
|
|
3
|
+
import { useCachedAsyncData } from './useCachedAsyncData';
|
|
4
|
+
|
|
5
|
+
const REGION_URL = '/api/v1/region';
|
|
6
|
+
|
|
7
|
+
export interface RegionData {
|
|
8
|
+
id?: number;
|
|
9
|
+
code?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface LocationStorageData {
|
|
14
|
+
manual?: boolean;
|
|
15
|
+
region: RegionData;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const localStorageLocation = globalThis?.localStorage.getItem('location');
|
|
19
|
+
const currentLocation: LocationStorageData | null = localStorageLocation
|
|
20
|
+
? JSON.parse(localStorageLocation)
|
|
21
|
+
: null;
|
|
22
|
+
|
|
23
|
+
export function useLocation(
|
|
24
|
+
defaultLocation: string,
|
|
25
|
+
): [RegionData, (newLocation: RegionData) => void] {
|
|
26
|
+
const [location, setLocation] = useState<RegionData>(
|
|
27
|
+
currentLocation?.region ?? { name: defaultLocation },
|
|
28
|
+
);
|
|
29
|
+
const { data } = useCachedAsyncData<RegionData>(REGION_URL, fetchJSONUnsafe);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setLocation(
|
|
33
|
+
currentLocation?.region && currentLocation?.manual
|
|
34
|
+
? currentLocation.region
|
|
35
|
+
: data || { name: defaultLocation },
|
|
36
|
+
);
|
|
37
|
+
}, [data]);
|
|
38
|
+
|
|
39
|
+
const onChangeLocation = useCallback(
|
|
40
|
+
(region: RegionData) => {
|
|
41
|
+
globalThis?.localStorage.setItem('location', JSON.stringify({ manual: true, region }));
|
|
42
|
+
setLocation(region);
|
|
43
|
+
},
|
|
44
|
+
[setLocation],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return [location, onChangeLocation];
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { fetchJSONUnsafe } from '../utils/fetchJSON';
|
|
3
|
+
|
|
4
|
+
const REGIONS_URL = '/api/v1/regions';
|
|
5
|
+
|
|
6
|
+
export interface Region {
|
|
7
|
+
id?: number;
|
|
8
|
+
code?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function useRegions(): Region[] {
|
|
13
|
+
const { data } = useAsyncData<Region[]>(REGIONS_URL, fetchJSONUnsafe);
|
|
14
|
+
|
|
15
|
+
return data || [];
|
|
16
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
|
+
import type { LogoType } from '../../model/LogoType';
|
|
2
3
|
import type { Picture } from '../../model/Picture';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -19,13 +20,19 @@ export interface DispositionItem extends LinkProps {
|
|
|
19
20
|
icon?: Picture;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @title Представительства за рубежом
|
|
25
|
+
* @required ["text", "href"]
|
|
26
|
+
*/
|
|
27
|
+
export interface ForeignOffice extends LinkProps {
|
|
28
|
+
icon?: Picture;
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
export interface SitemapDataProps {
|
|
23
32
|
topItems?: TopMenuItem[];
|
|
24
33
|
dispositions?: DispositionItem[];
|
|
25
|
-
logo?:
|
|
26
|
-
|
|
27
|
-
title?: string;
|
|
28
|
-
};
|
|
34
|
+
logo?: LogoType;
|
|
35
|
+
foreignOffices?: ForeignOffice[];
|
|
29
36
|
defaultLocation?: string;
|
|
30
37
|
officesLink?: string;
|
|
31
38
|
}
|