@hhgtech/hhg-components 1.19.0-beta-5 → 1.19.0-beta-7
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/.eslintrc.json +53 -0
- package/package.json +5 -2
- package/src/assets/svg/Spotlight.svg +12 -0
- package/src/assets/svg/StarEmptyIcon.tsx +19 -0
- package/src/assets/svg/StarFullIcon.tsx +21 -0
- package/src/assets/svg/StarHalfIcon.tsx +35 -0
- package/src/assets/svg/arrowDoor.svg +9 -0
- package/src/assets/svg/calendar.svg +3 -0
- package/src/assets/svg/calendarArrowLeft.svg +3 -0
- package/src/assets/svg/calendarArrowRight.svg +3 -0
- package/src/assets/svg/check.svg +3 -0
- package/src/assets/svg/chevronDown.svg +3 -0
- package/src/assets/svg/chevronRight.svg +3 -0
- package/src/assets/svg/chevronRightActive.svg +3 -0
- package/src/assets/svg/chevronRightWhite.svg +3 -0
- package/src/assets/svg/chevronUpBlue.svg +3 -0
- package/src/assets/svg/closeLight.svg +4 -0
- package/src/assets/svg/closeWhite.svg +4 -0
- package/src/assets/svg/community.svg +1 -0
- package/src/assets/svg/discover.png +0 -0
- package/src/assets/svg/facebook.svg +4 -0
- package/src/assets/svg/hamburgerMenu.svg +5 -0
- package/src/assets/svg/hamburgerMenuNew.svg +1 -0
- package/src/assets/svg/hamburgerMenuNewWithSearch.svg +1 -0
- package/src/assets/svg/healthTools.png +0 -0
- package/src/assets/svg/helloCare-thumbnail.png +0 -0
- package/src/assets/svg/index.ts +63 -0
- package/src/assets/svg/info-light.svg +5 -0
- package/src/assets/svg/instagram.svg +1 -0
- package/src/assets/svg/linkedin.svg +1 -0
- package/src/assets/svg/lock.png +0 -0
- package/src/assets/svg/login.svg +1 -0
- package/src/assets/svg/sehat-badge.png +0 -0
- package/src/assets/svg/together.png +0 -0
- package/src/assets/svg/youtube.svg +4 -0
- package/src/assets/svg/zalo.png +0 -0
- package/src/cache/core.ts +52 -0
- package/src/cache/index.ts +1 -0
- package/src/care/api/paths.ts +11 -0
- package/src/care/api/utils.ts +32 -0
- package/src/care/components/atoms/icons/index.tsx +170 -0
- package/src/care/components/organisms/bookingSearchBar/constants.ts +9 -0
- package/src/care/components/organisms/bookingSearchBar/index.stories.tsx +127 -0
- package/src/care/components/organisms/bookingSearchBar/index.styled.ts +51 -0
- package/src/care/components/organisms/bookingSearchBar/index.test.tsx +556 -0
- package/src/care/components/organisms/bookingSearchBar/index.tsx +448 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/index.styled.ts +94 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/index.tsx +132 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/liSkeleton.tsx +52 -0
- package/src/care/components/organisms/bookingSearchBar/mobileFakeInput/index.tsx +68 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.stories.tsx +22 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.styled.ts +41 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.tsx +48 -0
- package/src/care/components/organisms/bookingSearchBar/reducer.ts +293 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/icons.tsx +37 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.stories.tsx +155 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.styled.ts +89 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.tsx +234 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.stories.tsx +55 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.styled.ts +75 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.tsx +86 -0
- package/src/care/components/organisms/bookingSearchBar/searchInputs/index.styled.ts +42 -0
- package/src/care/components/organisms/bookingSearchBar/searchInputs/index.tsx +219 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/index.stories.tsx +55 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/index.tsx +62 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/mockData.ts +169 -0
- package/src/care/components/organisms/bookingSearchBar/searchSubmitIcon/index.tsx +73 -0
- package/src/care/components/organisms/bookingSearchBar/types.ts +12 -0
- package/src/care/components/organisms/bookingSearchBar/useAnimatedPlaceholder.ts +86 -0
- package/src/care/components/organisms/bookingSearchBar/useSearchBarApi.ts +150 -0
- package/src/care/components/organisms/bookingSearchBar/utils/Typewriter.ts +437 -0
- package/src/care/index.ts +6 -0
- package/src/care/interfaces/constants.ts +75 -0
- package/src/care/interfaces/types.ts +258 -0
- package/src/components/atoms/alert/__snapshots__/index.test.tsx.snap +130 -0
- package/src/components/atoms/alert/index.stories.tsx +21 -0
- package/src/components/atoms/alert/index.styled.tsx +44 -0
- package/src/components/atoms/alert/index.test.tsx +28 -0
- package/src/components/atoms/alert/index.tsx +47 -0
- package/src/components/atoms/avatar/index.stories.tsx +49 -0
- package/src/components/atoms/avatar/index.styled.tsx +96 -0
- package/src/components/atoms/avatar/index.tsx +91 -0
- package/src/components/atoms/badge/__snapshots__/index.test.tsx.snap +61 -0
- package/src/components/atoms/badge/index.stories.tsx +71 -0
- package/src/components/atoms/badge/index.styled.tsx +138 -0
- package/src/components/atoms/badge/index.test.tsx +27 -0
- package/src/components/atoms/badge/index.tsx +45 -0
- package/src/components/atoms/borderHeading/index.stories.tsx +38 -0
- package/src/components/atoms/borderHeading/index.styled.tsx +50 -0
- package/src/components/atoms/borderHeading/index.tsx +39 -0
- package/src/components/atoms/button/__snapshots__/index.test.tsx.snap +57 -0
- package/src/components/atoms/button/index.stories.tsx +107 -0
- package/src/components/atoms/button/index.styled.tsx +335 -0
- package/src/components/atoms/button/index.test.tsx +25 -0
- package/src/components/atoms/button/index.tsx +207 -0
- package/src/components/atoms/checkbox/__snapshots__/index.test.tsx.snap +120 -0
- package/src/components/atoms/checkbox/index.stories.tsx +30 -0
- package/src/components/atoms/checkbox/index.styled.tsx +90 -0
- package/src/components/atoms/checkbox/index.test.tsx +31 -0
- package/src/components/atoms/checkbox/index.tsx +48 -0
- package/src/components/atoms/container/index.styled.tsx +16 -0
- package/src/components/atoms/container/index.tsx +21 -0
- package/src/components/atoms/displayWrapper/index.styled.tsx +19 -0
- package/src/components/atoms/displayWrapper/index.tsx +66 -0
- package/src/components/atoms/divider/__snapshots__/index.test.tsx.snap +14 -0
- package/src/components/atoms/divider/index.stories.tsx +19 -0
- package/src/components/atoms/divider/index.styled.tsx +10 -0
- package/src/components/atoms/divider/index.test.tsx +22 -0
- package/src/components/atoms/divider/index.tsx +34 -0
- package/src/components/atoms/fileDropdown/__snapshots__/index.test.tsx.snap +143 -0
- package/src/components/atoms/fileDropdown/index.stories.tsx +41 -0
- package/src/components/atoms/fileDropdown/index.styled.tsx +112 -0
- package/src/components/atoms/fileDropdown/index.test.tsx +46 -0
- package/src/components/atoms/fileDropdown/index.tsx +200 -0
- package/src/components/atoms/flag/__snapshots__/index.test.tsx.snap +59 -0
- package/src/components/atoms/flag/icons/cambodia.tsx +24 -0
- package/src/components/atoms/flag/icons/english.tsx +195 -0
- package/src/components/atoms/flag/icons/india.tsx +24 -0
- package/src/components/atoms/flag/icons/indonesia.tsx +55 -0
- package/src/components/atoms/flag/icons/malaysia.tsx +89 -0
- package/src/components/atoms/flag/icons/myanmar.tsx +105 -0
- package/src/components/atoms/flag/icons/philippines.tsx +24 -0
- package/src/components/atoms/flag/icons/taiwan.tsx +154 -0
- package/src/components/atoms/flag/icons/thailand.tsx +55 -0
- package/src/components/atoms/flag/icons/vietnam.tsx +57 -0
- package/src/components/atoms/flag/index.stories.tsx +30 -0
- package/src/components/atoms/flag/index.styled.tsx +18 -0
- package/src/components/atoms/flag/index.test.tsx +21 -0
- package/src/components/atoms/flag/index.tsx +150 -0
- package/src/components/atoms/grid/__snapshots__/index.test.tsx.snap +38 -0
- package/src/components/atoms/grid/index.stories.tsx +50 -0
- package/src/components/atoms/grid/index.styled.tsx +34 -0
- package/src/components/atoms/grid/index.test.tsx +26 -0
- package/src/components/atoms/grid/index.tsx +61 -0
- package/src/components/atoms/heading/__snapshots__/index.test.tsx.snap +38 -0
- package/src/components/atoms/heading/index.stories.tsx +27 -0
- package/src/components/atoms/heading/index.styled.tsx +108 -0
- package/src/components/atoms/heading/index.test.tsx +23 -0
- package/src/components/atoms/heading/index.tsx +59 -0
- package/src/components/atoms/icons/Ask.tsx +54 -0
- package/src/components/atoms/icons/BarChart.tsx +39 -0
- package/src/components/atoms/icons/Booking.tsx +37 -0
- package/src/components/atoms/icons/Bookmark.tsx +44 -0
- package/src/components/atoms/icons/Community.tsx +46 -0
- package/src/components/atoms/icons/EditSpecial.tsx +30 -0
- package/src/components/atoms/icons/Family.tsx +37 -0
- package/src/components/atoms/icons/Font.tsx +37 -0
- package/src/components/atoms/icons/Heart.tsx +37 -0
- package/src/components/atoms/icons/Home.tsx +54 -0
- package/src/components/atoms/icons/Like.tsx +49 -0
- package/src/components/atoms/icons/MyCommunity.tsx +37 -0
- package/src/components/atoms/icons/PlusSpecial.tsx +30 -0
- package/src/components/atoms/icons/Recalculate.tsx +37 -0
- package/src/components/atoms/icons/Scale.tsx +44 -0
- package/src/components/atoms/icons/Share.tsx +37 -0
- package/src/components/atoms/icons/Stethoscope.tsx +37 -0
- package/src/components/atoms/icons/index.stories.tsx +50 -0
- package/src/components/atoms/icons/index.ts +46 -0
- package/src/components/atoms/index.ts +33 -0
- package/src/components/atoms/input/__snapshots__/index.test.tsx.snap +137 -0
- package/src/components/atoms/input/delete.svg +3 -0
- package/src/components/atoms/input/index.stories.tsx +50 -0
- package/src/components/atoms/input/index.styled.tsx +124 -0
- package/src/components/atoms/input/index.test.tsx +23 -0
- package/src/components/atoms/input/index.tsx +140 -0
- package/src/components/atoms/label/__snapshots__/index.test.tsx.snap +21 -0
- package/src/components/atoms/label/index.stories.tsx +16 -0
- package/src/components/atoms/label/index.test.tsx +25 -0
- package/src/components/atoms/label/index.tsx +37 -0
- package/src/components/atoms/logo/__snapshots__/index.test.tsx.snap +99 -0
- package/src/components/atoms/logo/index.stories.tsx +84 -0
- package/src/components/atoms/logo/index.test.tsx +18 -0
- package/src/components/atoms/logo/index.tsx +1915 -0
- package/src/components/atoms/marryBabyText/index.styled.tsx +86 -0
- package/src/components/atoms/marryBabyText/index.tsx +57 -0
- package/src/components/atoms/pagination/__snapshots__/index.test.tsx.snap +185 -0
- package/src/components/atoms/pagination/index.stories.tsx +92 -0
- package/src/components/atoms/pagination/index.styled.tsx +73 -0
- package/src/components/atoms/pagination/index.test.tsx +26 -0
- package/src/components/atoms/pagination/index.tsx +286 -0
- package/src/components/atoms/progress/index.stories.tsx +55 -0
- package/src/components/atoms/progress/index.styled.tsx +30 -0
- package/src/components/atoms/progress/index.tsx +29 -0
- package/src/components/atoms/pureInput/__snapshots__/index.test.tsx.snap +135 -0
- package/src/components/atoms/pureInput/delete.svg +3 -0
- package/src/components/atoms/pureInput/index.stories.tsx +54 -0
- package/src/components/atoms/pureInput/index.styled.tsx +123 -0
- package/src/components/atoms/pureInput/index.test.tsx +29 -0
- package/src/components/atoms/pureInput/index.tsx +162 -0
- package/src/components/atoms/radio/__snapshots__/index.test.tsx.snap +163 -0
- package/src/components/atoms/radio/index.stories.tsx +48 -0
- package/src/components/atoms/radio/index.styled.tsx +133 -0
- package/src/components/atoms/radio/index.test.tsx +31 -0
- package/src/components/atoms/radio/index.tsx +66 -0
- package/src/components/atoms/rateStars/index.stories.tsx +71 -0
- package/src/components/atoms/rateStars/index.styled.tsx +17 -0
- package/src/components/atoms/rateStars/index.tsx +101 -0
- package/src/components/atoms/shadow/__snapshots__/index.test.tsx.snap +37 -0
- package/src/components/atoms/shadow/index.stories.tsx +55 -0
- package/src/components/atoms/shadow/index.styled.tsx +31 -0
- package/src/components/atoms/shadow/index.test.tsx +25 -0
- package/src/components/atoms/shadow/index.tsx +20 -0
- package/src/components/atoms/slider/__snapshots__/index.test.tsx.snap +172 -0
- package/src/components/atoms/slider/index.stories.tsx +22 -0
- package/src/components/atoms/slider/index.styled.tsx +68 -0
- package/src/components/atoms/slider/index.test.tsx +27 -0
- package/src/components/atoms/slider/index.tsx +140 -0
- package/src/components/atoms/tag/__snapshots__/index.test.tsx.snap +72 -0
- package/src/components/atoms/tag/index.stories.tsx +54 -0
- package/src/components/atoms/tag/index.styled.tsx +184 -0
- package/src/components/atoms/tag/index.test.tsx +23 -0
- package/src/components/atoms/tag/index.tsx +72 -0
- package/src/components/atoms/text/index.stories.tsx +24 -0
- package/src/components/atoms/text/index.styled.tsx +231 -0
- package/src/components/atoms/text/index.tsx +99 -0
- package/src/components/atoms/textArea/index.stories.tsx +30 -0
- package/src/components/atoms/textArea/index.tsx +86 -0
- package/src/components/atoms/textDivider/index.tsx +48 -0
- package/src/components/atoms/toggle/__snapshots__/index.test.tsx.snap +73 -0
- package/src/components/atoms/toggle/index.stories.tsx +38 -0
- package/src/components/atoms/toggle/index.styled.tsx +55 -0
- package/src/components/atoms/toggle/index.test.tsx +27 -0
- package/src/components/atoms/toggle/index.tsx +28 -0
- package/src/components/atoms/underlinedLink/index.stories.tsx +35 -0
- package/src/components/atoms/underlinedLink/index.styled.tsx +66 -0
- package/src/components/atoms/underlinedLink/index.text.tsx +23 -0
- package/src/components/atoms/underlinedLink/index.tsx +30 -0
- package/src/components/atoms/uploader/__snapshots__/index.test.tsx.snap +170 -0
- package/src/components/atoms/uploader/index.stories.tsx +128 -0
- package/src/components/atoms/uploader/index.styled.tsx +53 -0
- package/src/components/atoms/uploader/index.test.tsx +96 -0
- package/src/components/atoms/uploader/index.tsx +107 -0
- package/src/components/index.ts +3 -0
- package/src/components/molecules/ampNextPage/index.tsx +48 -0
- package/src/components/molecules/articleCard/bookmark.png +0 -0
- package/src/components/molecules/articleCard/bookmarked.png +0 -0
- package/src/components/molecules/articleCard/index.stories.tsx +222 -0
- package/src/components/molecules/articleCard/index.styled.tsx +391 -0
- package/src/components/molecules/articleCard/index.tsx +430 -0
- package/src/components/molecules/breadcrumbs/__snapshots__/index.test.tsx.snap +173 -0
- package/src/components/molecules/breadcrumbs/index.stories.tsx +79 -0
- package/src/components/molecules/breadcrumbs/index.styled.tsx +99 -0
- package/src/components/molecules/breadcrumbs/index.test.tsx +45 -0
- package/src/components/molecules/breadcrumbs/index.tsx +141 -0
- package/src/components/molecules/carousel/index.stories.tsx +40 -0
- package/src/components/molecules/carousel/index.styled.tsx +115 -0
- package/src/components/molecules/carousel/index.tsx +178 -0
- package/src/components/molecules/categoryCard/index.stories.tsx +19 -0
- package/src/components/molecules/categoryCard/index.styled.tsx +38 -0
- package/src/components/molecules/categoryCard/index.tsx +51 -0
- package/src/components/molecules/checkboxGroup/__snapshots__/index.test.tsx.snap +214 -0
- package/src/components/molecules/checkboxGroup/index.stories.tsx +118 -0
- package/src/components/molecules/checkboxGroup/index.styled.tsx +27 -0
- package/src/components/molecules/checkboxGroup/index.test.tsx +36 -0
- package/src/components/molecules/checkboxGroup/index.tsx +66 -0
- package/src/components/molecules/cookieAcceptConfirm/__snapshots__/index.test.tsx.snap +152 -0
- package/src/components/molecules/cookieAcceptConfirm/index.stories.tsx +23 -0
- package/src/components/molecules/cookieAcceptConfirm/index.styled.tsx +101 -0
- package/src/components/molecules/cookieAcceptConfirm/index.test.tsx +23 -0
- package/src/components/molecules/cookieAcceptConfirm/index.tsx +78 -0
- package/src/components/molecules/cookieAcceptConfirm/info.svg +3 -0
- package/src/components/molecules/datePicker/__snapshots__/index.test.tsx.snap +377 -0
- package/src/components/molecules/datePicker/index.stories.tsx +55 -0
- package/src/components/molecules/datePicker/index.styled.tsx +374 -0
- package/src/components/molecules/datePicker/index.test.tsx +46 -0
- package/src/components/molecules/datePicker/index.tsx +361 -0
- package/src/components/molecules/dateRangePicker/calendar/index.styled.ts +122 -0
- package/src/components/molecules/dateRangePicker/calendar/index.tsx +247 -0
- package/src/components/molecules/dateRangePicker/index.stories.tsx +45 -0
- package/src/components/molecules/dateRangePicker/index.styled.ts +36 -0
- package/src/components/molecules/dateRangePicker/index.tsx +103 -0
- package/src/components/molecules/dateRangePicker/types.ts +4 -0
- package/src/components/molecules/dateRangePicker/utils.ts +26 -0
- package/src/components/molecules/doctorInfo/index.stories.tsx +20 -0
- package/src/components/molecules/doctorInfo/index.tsx +54 -0
- package/src/components/molecules/dropdown/__snapshots__/index.test.tsx.snap +133 -0
- package/src/components/molecules/dropdown/index.stories.tsx +158 -0
- package/src/components/molecules/dropdown/index.styled.tsx +149 -0
- package/src/components/molecules/dropdown/index.test.tsx +45 -0
- package/src/components/molecules/dropdown/index.tsx +143 -0
- package/src/components/molecules/dropdownSearch/index.stories.tsx +66 -0
- package/src/components/molecules/dropdownSearch/index.styled.tsx +157 -0
- package/src/components/molecules/dropdownSearch/index.tsx +169 -0
- package/src/components/molecules/dropdownSearch/search.svg +4 -0
- package/src/components/molecules/floatButtonGroup/add-period.svg +9 -0
- package/src/components/molecules/floatButtonGroup/index.stories.tsx +72 -0
- package/src/components/molecules/floatButtonGroup/index.styled.tsx +310 -0
- package/src/components/molecules/floatButtonGroup/index.tsx +155 -0
- package/src/components/molecules/iconText/__snapshots__/index.test.tsx.snap +64 -0
- package/src/components/molecules/iconText/index.stories.tsx +22 -0
- package/src/components/molecules/iconText/index.styled.tsx +47 -0
- package/src/components/molecules/iconText/index.test.tsx +31 -0
- package/src/components/molecules/iconText/index.tsx +33 -0
- package/src/components/molecules/index.ts +39 -0
- package/src/components/molecules/languageSwitcher/index.stories.tsx +32 -0
- package/src/components/molecules/languageSwitcher/index.styled.tsx +23 -0
- package/src/components/molecules/languageSwitcher/index.tsx +68 -0
- package/src/components/molecules/languageSwitcher/tooltipSelection/index.styled.tsx +69 -0
- package/src/components/molecules/languageSwitcher/tooltipSelection/index.tsx +84 -0
- package/src/components/molecules/mobileBottomNavigation/MobileBottomNavigationIcon.tsx +51 -0
- package/src/components/molecules/mobileBottomNavigation/index.stories.tsx +173 -0
- package/src/components/molecules/mobileBottomNavigation/index.styled.tsx +150 -0
- package/src/components/molecules/mobileBottomNavigation/index.tsx +41 -0
- package/src/components/molecules/modal/__snapshots__/index.test.tsx.snap +3 -0
- package/src/components/molecules/modal/index.stories.tsx +139 -0
- package/src/components/molecules/modal/index.styled.tsx +146 -0
- package/src/components/molecules/modal/index.test.tsx +26 -0
- package/src/components/molecules/modal/index.tsx +147 -0
- package/src/components/molecules/popup/__snapshots__/index.test.tsx.snap +102 -0
- package/src/components/molecules/popup/index.stories.tsx +21 -0
- package/src/components/molecules/popup/index.styled.tsx +90 -0
- package/src/components/molecules/popup/index.test.tsx +26 -0
- package/src/components/molecules/popup/index.tsx +45 -0
- package/src/components/molecules/progressBar/__snapshots__/index.test.tsx.snap +167 -0
- package/src/components/molecules/progressBar/index.stories.tsx +72 -0
- package/src/components/molecules/progressBar/index.styled.tsx +182 -0
- package/src/components/molecules/progressBar/index.test.tsx +75 -0
- package/src/components/molecules/progressBar/index.tsx +245 -0
- package/src/components/molecules/radioGroup/__snapshots__/index.test.tsx.snap +290 -0
- package/src/components/molecules/radioGroup/index.stories.tsx +131 -0
- package/src/components/molecules/radioGroup/index.styled.tsx +75 -0
- package/src/components/molecules/radioGroup/index.test.tsx +33 -0
- package/src/components/molecules/radioGroup/index.tsx +80 -0
- package/src/components/molecules/scrollList/index.stories.tsx +113 -0
- package/src/components/molecules/scrollList/index.styled.tsx +140 -0
- package/src/components/molecules/scrollList/index.tsx +786 -0
- package/src/components/molecules/seoHead/index.tsx +382 -0
- package/src/components/molecules/sidemenu/__snapshots__/index.test.tsx.snap +273 -0
- package/src/components/molecules/sidemenu/index.stories.tsx +156 -0
- package/src/components/molecules/sidemenu/index.test.tsx +56 -0
- package/src/components/molecules/sidemenu/index.tsx +4 -0
- package/src/components/molecules/sidemenu/menuLink.tsx +78 -0
- package/src/components/molecules/sidemenu/sideHeader.tsx +85 -0
- package/src/components/molecules/sidemenu/sideMenu.tsx +39 -0
- package/src/components/molecules/sidemenu/test.tsx +94 -0
- package/src/components/molecules/sidemenu/userInfo.tsx +44 -0
- package/src/components/molecules/starsRatingBox/index.stories.tsx +121 -0
- package/src/components/molecules/starsRatingBox/index.styled.tsx +23 -0
- package/src/components/molecules/starsRatingBox/index.tsx +83 -0
- package/src/components/molecules/statisticCard/__snapshots__/index.test.tsx.snap +86 -0
- package/src/components/molecules/statisticCard/index.stories.tsx +40 -0
- package/src/components/molecules/statisticCard/index.styled.tsx +47 -0
- package/src/components/molecules/statisticCard/index.test.tsx +44 -0
- package/src/components/molecules/statisticCard/index.tsx +48 -0
- package/src/components/molecules/surveyQuestionCard/__snapshots__/index.test.tsx.snap +743 -0
- package/src/components/molecules/surveyQuestionCard/index.stories.tsx +115 -0
- package/src/components/molecules/surveyQuestionCard/index.styled.tsx +220 -0
- package/src/components/molecules/surveyQuestionCard/index.test.tsx +53 -0
- package/src/components/molecules/surveyQuestionCard/index.tsx +2 -0
- package/src/components/molecules/surveyQuestionCard/surveyQuestionCard.tsx +213 -0
- package/src/components/molecules/surveyQuestionCard/surveyQuestionContent.tsx +200 -0
- package/src/components/molecules/surveyQuestionCard/surveyRadio.tsx +69 -0
- package/src/components/molecules/surveyQuestionCard/surveyThankyouCard.tsx +129 -0
- package/src/components/molecules/table/__snapshots__/index.test.tsx.snap +56 -0
- package/src/components/molecules/table/index.stories.tsx +264 -0
- package/src/components/molecules/table/index.test.tsx +29 -0
- package/src/components/molecules/table/index.tsx +5 -0
- package/src/components/molecules/table/table.tsx +38 -0
- package/src/components/molecules/table/tableBody.tsx +46 -0
- package/src/components/molecules/table/tableCell.tsx +47 -0
- package/src/components/molecules/table/tableHead.tsx +46 -0
- package/src/components/molecules/table/tableRow.tsx +45 -0
- package/src/components/molecules/tabs/__snapshots__/index.test.tsx.snap +104 -0
- package/src/components/molecules/tabs/index.stories.tsx +45 -0
- package/src/components/molecules/tabs/index.styled.tsx +58 -0
- package/src/components/molecules/tabs/index.test.tsx +49 -0
- package/src/components/molecules/tabs/index.tsx +89 -0
- package/src/components/organisms/footer/discoverFooter/index.styled.tsx +286 -0
- package/src/components/organisms/footer/discoverFooter/index.tsx +448 -0
- package/src/components/organisms/footer/index.stories.tsx +207 -0
- package/src/components/organisms/footer/index.tsx +70 -0
- package/src/components/organisms/footer/maryBabyFooter/index.styled.tsx +502 -0
- package/src/components/organisms/footer/maryBabyFooter/index.tsx +393 -0
- package/src/components/organisms/index.ts +31 -0
- package/src/components/organisms/navigationBookingButton/index.styled.tsx +11 -0
- package/src/components/organisms/navigationBookingButton/index.tsx +53 -0
- package/src/components/organisms/navigationLayout/CustomFooter.tsx +154 -0
- package/src/components/organisms/navigationLayout/ampSideBar/index.styled.tsx +151 -0
- package/src/components/organisms/navigationLayout/ampSideBar/index.tsx +276 -0
- package/src/components/organisms/navigationLayout/assets/check.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronDown.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronRightWhite.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronUpBlue.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/closeLight.svg +4 -0
- package/src/components/organisms/navigationLayout/assets/closeWhite.svg +4 -0
- package/src/components/organisms/navigationLayout/assets/hamburgerMenu.svg +5 -0
- package/src/components/organisms/navigationLayout/assets/index.js +19 -0
- package/src/components/organisms/navigationLayout/assets/info-light.svg +5 -0
- package/src/components/organisms/navigationLayout/constants.ts +958 -0
- package/src/components/organisms/navigationLayout/footer/index.styled.tsx +286 -0
- package/src/components/organisms/navigationLayout/footer/index.tsx +449 -0
- package/src/components/organisms/navigationLayout/index.stories.tsx +273 -0
- package/src/components/organisms/navigationLayout/index.styled.tsx +153 -0
- package/src/components/organisms/navigationLayout/index.tsx +1272 -0
- package/src/components/organisms/navigationLayout/languageWrapper.tsx +19 -0
- package/src/components/organisms/navigationLayout/languages/default.ts +63 -0
- package/src/components/organisms/navigationLayout/layout.tsx +406 -0
- package/src/components/organisms/navigationLayout/marryBabyText/index.styled.tsx +86 -0
- package/src/components/organisms/navigationLayout/marryBabyText/index.tsx +57 -0
- package/src/components/organisms/navigationLayout/maryBabyFooter/index.styled.tsx +502 -0
- package/src/components/organisms/navigationLayout/maryBabyFooter/index.tsx +383 -0
- package/src/components/organisms/navigationLayout/menuCareList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCareList/index.styled.tsx +156 -0
- package/src/components/organisms/navigationLayout/menuCareList/index.tsx +266 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/helloSites.tsx +419 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/index.styled.tsx +196 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/index.tsx +92 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/marryBaby.styled.tsx +151 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/marryBaby.tsx +409 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/index.styled.tsx +147 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/index.tsx +141 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/spotlightSkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/helloSites.tsx +309 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/index.styled.tsx +162 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/index.tsx +80 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/marryBaby.styled.tsx +119 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/marryBaby.tsx +181 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/helloSites.tsx +364 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/index.styled.tsx +176 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/index.tsx +83 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/marryBaby.tsx +166 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/marrybaby.styled.tsx +118 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/cardSkeleton.tsx +32 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/index.styled.tsx +46 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/index.tsx +52 -0
- package/src/components/organisms/navigationLayout/menuServiceList/categoriesSubList.tsx +121 -0
- package/src/components/organisms/navigationLayout/menuServiceList/communitySubList.tsx +143 -0
- package/src/components/organisms/navigationLayout/menuServiceList/index.styled.tsx +460 -0
- package/src/components/organisms/navigationLayout/menuServiceList/index.tsx +746 -0
- package/src/components/organisms/navigationLayout/menuServiceList/marryBabyMobileMenuSection.tsx +239 -0
- package/src/components/organisms/navigationLayout/navigationBar/ArrowLeftPopupIcon.tsx +21 -0
- package/src/components/organisms/navigationLayout/navigationBar/ClosePopupIcon.tsx +20 -0
- package/src/components/organisms/navigationLayout/navigationBar/HamburgerIcon.tsx +43 -0
- package/src/components/organisms/navigationLayout/navigationBar/NavigationBar.types.ts +99 -0
- package/src/components/organisms/navigationLayout/navigationBar/NavigationBarMobile.tsx +503 -0
- package/src/components/organisms/navigationLayout/navigationBar/SearchIcon.tsx +22 -0
- package/src/components/organisms/navigationLayout/navigationBar/index.styled.tsx +540 -0
- package/src/components/organisms/navigationLayout/navigationBar/index.tsx +798 -0
- package/src/components/organisms/navigationLayout/navigationLogoutPopup/index.styled.tsx +87 -0
- package/src/components/organisms/navigationLayout/navigationLogoutPopup/index.tsx +95 -0
- package/src/components/organisms/navigationLayout/profilePopup/index.tsx +102 -0
- package/src/components/organisms/navigationLayout/profilePopupWrapper/index.styled.tsx +164 -0
- package/src/components/organisms/navigationLayout/profilePopupWrapper/index.tsx +58 -0
- package/src/components/organisms/navigationLayout/siteWide/index.styled.tsx +116 -0
- package/src/components/organisms/navigationLayout/siteWide/index.tsx +162 -0
- package/src/components/organisms/navigationLayout/sponsoredBy/index.styled.tsx +119 -0
- package/src/components/organisms/navigationLayout/sponsoredBy/index.tsx +254 -0
- package/src/components/organisms/navigationLayout/tooltipSelection/index.styled.tsx +66 -0
- package/src/components/organisms/navigationLayout/tooltipSelection/index.tsx +81 -0
- package/src/components/organisms/navigationLayout/types.ts +322 -0
- package/src/components/organisms/navigationLayout/utils.tsx +424 -0
- package/src/components/organisms/navigationLogoutPopup/index.stories.tsx +34 -0
- package/src/components/organisms/navigationLogoutPopup/index.styled.tsx +87 -0
- package/src/components/organisms/navigationLogoutPopup/index.tsx +78 -0
- package/src/components/organisms/navigationProfileButton/index.stories.tsx +51 -0
- package/src/components/organisms/navigationProfileButton/index.styled.tsx +254 -0
- package/src/components/organisms/navigationProfileButton/index.tsx +217 -0
- package/src/components/organisms/navigationProfileButton/popupWrapper.tsx +58 -0
- package/src/components/organisms/navigationProfileButton/profilePopup.tsx +97 -0
- package/src/components/organisms/navigationV2/components/atoms/ArrowLeftPopupIcon.tsx +21 -0
- package/src/components/organisms/navigationV2/components/atoms/ClosePopupIcon.tsx +21 -0
- package/src/components/organisms/navigationV2/components/atoms/HamburgerIcon.tsx +58 -0
- package/src/components/organisms/navigationV2/components/atoms/ItemNav/index.styled.tsx +63 -0
- package/src/components/organisms/navigationV2/components/atoms/ItemNav/index.tsx +71 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/btnClosePopup.tsx +30 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/index.styled.tsx +62 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/index.tsx +45 -0
- package/src/components/organisms/navigationV2/components/atoms/SearchIcon.tsx +22 -0
- package/src/components/organisms/navigationV2/components/atoms/searchInput/index.tsx +45 -0
- package/src/components/organisms/navigationV2/components/molecules/Categories/index.styled.tsx +74 -0
- package/src/components/organisms/navigationV2/components/molecules/Categories/index.tsx +115 -0
- package/src/components/organisms/navigationV2/components/molecules/Spotlights/index.styled.tsx +40 -0
- package/src/components/organisms/navigationV2/components/molecules/Spotlights/index.tsx +60 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/Item/index.styled.tsx +155 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/Item/index.tsx +103 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/careSpotlights.tsx +40 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/index.styled.tsx +29 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/index.tsx +65 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/Item/index.styled.tsx +46 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/Item/index.tsx +50 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/categorySpotlights.tsx +59 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/index.styled.tsx +30 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/index.tsx +64 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/Item/index.styled.tsx +89 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/Item/index.tsx +91 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/communitySpotlights.tsx +49 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/index.styled.tsx +42 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/index.tsx +56 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/Item/index.styled.tsx +104 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/Item/index.tsx +99 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/index.styled.tsx +18 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/index.tsx +65 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/toolSpotlights.tsx +41 -0
- package/src/components/organisms/navigationV2/components/molecules/menuServiceList/index.styled.tsx +358 -0
- package/src/components/organisms/navigationV2/components/molecules/menuServiceList/index.tsx +88 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/hamburgerMenu.tsx +74 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/index.styled.tsx +214 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/index.tsx +283 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/navigationProfileButtonWithContext.tsx +50 -0
- package/src/components/organisms/navigationV2/components/molecules/spotlightNoData/index.styled.tsx +70 -0
- package/src/components/organisms/navigationV2/components/molecules/spotlightNoData/index.tsx +74 -0
- package/src/components/organisms/navigationV2/constants.ts +277 -0
- package/src/components/organisms/navigationV2/hooks/useHeaderHeight.tsx +84 -0
- package/src/components/organisms/navigationV2/hooks/useInsider.tsx +67 -0
- package/src/components/organisms/navigationV2/hooks/useNavConfig.tsx +99 -0
- package/src/components/organisms/navigationV2/hooks/useNavServices.tsx +73 -0
- package/src/components/organisms/navigationV2/index.stories.tsx +287 -0
- package/src/components/organisms/navigationV2/index.styled.tsx +30 -0
- package/src/components/organisms/navigationV2/index.tsx +320 -0
- package/src/components/organisms/navigationV2/navigationContext.tsx +38 -0
- package/src/components/organisms/navigationV2/types.ts +307 -0
- package/src/components/organisms/navigationV2/utils.tsx +400 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-chevronDown.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-chevronRight.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-eCom.svg +22 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-helpCircle.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-logOut.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myBooking.svg +36 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myCommunity.svg +19 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myFamily.svg +15 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myHealth.svg +13 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-mySaved.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-ambassador.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-doctor.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-expert.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-influencer.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-member.svg +8 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-settingsWheel.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-arrowRight.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-lock.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-logOut.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-myCommunity.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-myHealth.svg +6 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-mySaved.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-ambassador.svg +40 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-doctor.svg +40 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-expert.svg +27 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-influencer.svg +33 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-member.svg +33 -0
- package/src/components/organisms/userProfileNavigation/constants.ts +23 -0
- package/src/components/organisms/userProfileNavigation/index.stories.tsx +79 -0
- package/src/components/organisms/userProfileNavigation/index.styled.ts +60 -0
- package/src/components/organisms/userProfileNavigation/index.tsx +219 -0
- package/src/components/organisms/userProfileNavigation/navHeader/index.styled.ts +76 -0
- package/src/components/organisms/userProfileNavigation/navHeader/index.tsx +68 -0
- package/src/components/organisms/userProfileNavigation/navMenu/index.styled.ts +115 -0
- package/src/components/organisms/userProfileNavigation/navMenu/index.tsx +79 -0
- package/src/components/organisms/userProfileNavigation/navMenu/items.ts +38 -0
- package/src/components/organisms/userProfileNavigation/navigationCard/index.styled.ts +51 -0
- package/src/components/organisms/userProfileNavigation/navigationCard/index.tsx +96 -0
- package/src/components/organisms/userProfileNavigation/types.ts +35 -0
- package/src/components/organisms/userProfileNavigation/userStats/index.styled.ts +110 -0
- package/src/components/organisms/userProfileNavigation/userStats/index.tsx +78 -0
- package/src/core.ts +7 -0
- package/src/docs/releases/getReleases.js +56 -0
- package/src/docs/releases/index.stories.mdx +9 -0
- package/src/ecom/dataFormatter/index.ts +933 -0
- package/src/ecom/dataFormatter/lib/apiTypes.ts +623 -0
- package/src/ecom/dataFormatter/lib/dataTypes.ts +571 -0
- package/src/ecom/dataFormatter/lib/utils.ts +40 -0
- package/src/ecom/index.tsx +5 -0
- package/src/ecom/interfaces/constants.ts +1000 -0
- package/src/ecom/interfaces/types.ts +194 -0
- package/src/hooks/useCSSFocusPopupHelper.ts +32 -0
- package/src/hooks/useDragScroll.ts +55 -0
- package/src/hooks/useDropdownSearch.tsx +52 -0
- package/src/hooks/useFbDataLayer.tsx +49 -0
- package/src/hooks/useGeolocation.ts +86 -0
- package/src/hooks/useGetIsMobile.ts +20 -0
- package/src/hooks/useImagesPicker.ts +56 -0
- package/src/hooks/useIsInit.ts +9 -0
- package/src/hooks/useOutsideClick.ts +20 -0
- package/src/hooks/useScreenSize.ts +35 -0
- package/src/hooks/useScrollbarSize.ts +74 -0
- package/src/hooks/useTranslations.tsx +41 -0
- package/src/i18n/en-PH.json +235 -0
- package/src/i18n/hi-IN.json +235 -0
- package/src/i18n/id-ID.json +235 -0
- package/src/i18n/index.ts +3 -0
- package/src/i18n/km-KH.json +235 -0
- package/src/i18n/ms-MY.json +235 -0
- package/src/i18n/my-MM.json +235 -0
- package/src/i18n/th-TH.json +235 -0
- package/src/i18n/tl-PH.json +235 -0
- package/src/i18n/translations.ts +47 -0
- package/src/i18n/translationsContext.ts +12 -0
- package/src/i18n/translationsProvider.tsx +66 -0
- package/src/i18n/vi-VN.json +242 -0
- package/src/i18n/zh-TW.json +235 -0
- package/src/index.ts +12 -0
- package/src/interfaces/constants.ts +402 -0
- package/src/interfaces/types.ts +85 -0
- package/src/misc/cookieHelper.tsx +31 -0
- package/src/misc/lazyLoad.ts +7 -0
- package/src/misc/mockTheme.tsx +11 -0
- package/src/misc/number.ts +24 -0
- package/src/misc/routing.tsx +45 -0
- package/src/misc/theme.ts +186 -0
- package/src/misc/utils.ts +214 -0
- package/src/test/testTranslationProvider.tsx +14 -0
- package/src/together/api/dataTransform.ts +650 -0
- package/src/together/api/paths.ts +163 -0
- package/src/together/api/utils.ts +399 -0
- package/src/together/assets/images/avatar-default.png +0 -0
- package/src/together/assets/images/icon-whatsapp.png +0 -0
- package/src/together/assets/images/icon-zalo.png +0 -0
- package/src/together/assets/marrybaby/svg/comment.svg +4 -0
- package/src/together/assets/marrybaby/svg/commentSolid.svg +5 -0
- package/src/together/assets/marrybaby/svg/commentWhite.svg +4 -0
- package/src/together/assets/marrybaby/svg/copy.svg +1 -0
- package/src/together/assets/marrybaby/svg/facebook.svg +9 -0
- package/src/together/assets/marrybaby/svg/heart.svg +4 -0
- package/src/together/assets/marrybaby/svg/heartSolid.svg +4 -0
- package/src/together/assets/marrybaby/svg/linkedin.svg +6 -0
- package/src/together/assets/marrybaby/svg/loading.svg +15 -0
- package/src/together/assets/marrybaby/svg/messenger.svg +17 -0
- package/src/together/assets/marrybaby/svg/more.svg +6 -0
- package/src/together/assets/marrybaby/svg/moreSolid.svg +6 -0
- package/src/together/assets/marrybaby/svg/pin.svg +6 -0
- package/src/together/assets/marrybaby/svg/pinOrange.svg +6 -0
- package/src/together/assets/marrybaby/svg/share.svg +5 -0
- package/src/together/assets/marrybaby/svg/share2.svg +5 -0
- package/src/together/assets/marrybaby/svg/sortBy.svg +5 -0
- package/src/together/assets/marrybaby/svg/twitter.svg +4 -0
- package/src/together/assets/marrybaby/svg/zalo.png +0 -0
- package/src/together/assets/svg/bullet-point.svg +3 -0
- package/src/together/assets/svg/chevronRightActive.svg +3 -0
- package/src/together/assets/svg/close-circle-line.svg +5 -0
- package/src/together/assets/svg/closeLight copy.svg +4 -0
- package/src/together/assets/svg/closeLight.svg +4 -0
- package/src/together/assets/svg/delete.svg +13 -0
- package/src/together/assets/svg/icon-alert-circle-primary.svg +5 -0
- package/src/together/assets/svg/icon-alert-circle-warning.svg +5 -0
- package/src/together/assets/svg/icon-alert-circle.svg +5 -0
- package/src/together/assets/svg/icon-arrow-circle-upgrade.svg +3 -0
- package/src/together/assets/svg/icon-arrow-left.svg +4 -0
- package/src/together/assets/svg/icon-arrow-right-circle.svg +5 -0
- package/src/together/assets/svg/icon-bell-off.svg +7 -0
- package/src/together/assets/svg/icon-bell-on.svg +4 -0
- package/src/together/assets/svg/icon-bookmark-fill.svg +3 -0
- package/src/together/assets/svg/icon-bookmark.svg +3 -0
- package/src/together/assets/svg/icon-cancel.svg +13 -0
- package/src/together/assets/svg/icon-check-gray.svg +3 -0
- package/src/together/assets/svg/icon-check-pink.svg +3 -0
- package/src/together/assets/svg/icon-check-success.svg +4 -0
- package/src/together/assets/svg/icon-check.svg +4 -0
- package/src/together/assets/svg/icon-chevron-left-dark.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right-dark.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right-white.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right.svg +3 -0
- package/src/together/assets/svg/icon-close-circle-line.svg +5 -0
- package/src/together/assets/svg/icon-close-circle.svg +5 -0
- package/src/together/assets/svg/icon-close.svg +4 -0
- package/src/together/assets/svg/icon-edit.svg +3 -0
- package/src/together/assets/svg/icon-enter.svg +4 -0
- package/src/together/assets/svg/icon-facebook.svg +3 -0
- package/src/together/assets/svg/icon-heart-empty.svg +3 -0
- package/src/together/assets/svg/icon-heart-fill-red.svg +3 -0
- package/src/together/assets/svg/icon-heart-fill.svg +3 -0
- package/src/together/assets/svg/icon-kebab.svg +5 -0
- package/src/together/assets/svg/icon-link.svg +4 -0
- package/src/together/assets/svg/icon-linkedin.svg +4 -0
- package/src/together/assets/svg/icon-pin-gray.svg +4 -0
- package/src/together/assets/svg/icon-pin-yellow.svg +4 -0
- package/src/together/assets/svg/icon-pin.svg +4 -0
- package/src/together/assets/svg/icon-reply-arrow.svg +3 -0
- package/src/together/assets/svg/icon-reply-circle-empty.svg +3 -0
- package/src/together/assets/svg/icon-reply-circle-fill.svg +3 -0
- package/src/together/assets/svg/icon-share-on-media.svg +7 -0
- package/src/together/assets/svg/icon-sort-arrow.svg +4 -0
- package/src/together/assets/svg/icon-tab-edit-2.svg +4 -0
- package/src/together/assets/svg/icon-tab-edit-primary.svg +4 -0
- package/src/together/assets/svg/icon-trash-bin.svg +6 -0
- package/src/together/assets/svg/icon-twitter.svg +4 -0
- package/src/together/assets/svg/loading.svg +7 -0
- package/src/together/assets/svg/reviewer-author.svg +12 -0
- package/src/together/assets/svg/reviewer-editor.svg +12 -0
- package/src/together/assets/svg/reviewer-expert.svg +5 -0
- package/src/together/assets/svg/reviewer-fact-check.svg +4 -0
- package/src/together/assets/svg/reviewer-medical.svg +4 -0
- package/src/together/components/atoms/cardLink/index.styled.tsx +64 -0
- package/src/together/components/atoms/cardLink/index.tsx +149 -0
- package/src/together/components/atoms/cardReactions/index.styled.tsx +96 -0
- package/src/together/components/atoms/cardReactions/index.tsx +221 -0
- package/src/together/components/atoms/index.tsx +8 -0
- package/src/together/components/atoms/labelSortPin/index.styled.tsx +78 -0
- package/src/together/components/atoms/labelSortPin/index.tsx +50 -0
- package/src/together/components/atoms/labelSortPin/labelPin.tsx +47 -0
- package/src/together/components/atoms/labelSortPin/labelSorting.tsx +127 -0
- package/src/together/components/atoms/loading/index.styled.tsx +42 -0
- package/src/together/components/atoms/loading/index.tsx +25 -0
- package/src/together/components/atoms/loading/loadingCard.tsx +38 -0
- package/src/together/components/atoms/tagTopic/index.styled.tsx +33 -0
- package/src/together/components/atoms/tagTopic/index.tsx +57 -0
- package/src/together/components/atoms/userAvatar/index.styled.tsx +39 -0
- package/src/together/components/atoms/userAvatar/index.tsx +62 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/formatDistance.ts +112 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/index.ts +16 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/types.ts +37 -0
- package/src/together/components/molecules/cardAuthor/index.styled.tsx +164 -0
- package/src/together/components/molecules/cardAuthor/index.tsx +314 -0
- package/src/together/components/molecules/createNewPostContent/index.stories.tsx +114 -0
- package/src/together/components/molecules/createNewPostContent/index.styled.tsx +73 -0
- package/src/together/components/molecules/createNewPostContent/index.tsx +351 -0
- package/src/together/components/molecules/createPostDescription/editor.tsx +915 -0
- package/src/together/components/molecules/createPostDescription/index.styled.tsx +328 -0
- package/src/together/components/molecules/createPostDescription/index.tsx +163 -0
- package/src/together/components/molecules/createPostTitle/index.styled.tsx +62 -0
- package/src/together/components/molecules/createPostTitle/index.tsx +133 -0
- package/src/together/components/molecules/index.tsx +18 -0
- package/src/together/components/molecules/inputCommentBar/index.styled.tsx +227 -0
- package/src/together/components/molecules/inputCommentBar/index.tsx +341 -0
- package/src/together/components/molecules/inputCommentBar/mainInputTriggerContext.tsx +26 -0
- package/src/together/components/molecules/popupDanger/index.styled.tsx +174 -0
- package/src/together/components/molecules/popupDanger/index.tsx +113 -0
- package/src/together/components/molecules/popupDoctor/index.styled.tsx +185 -0
- package/src/together/components/molecules/popupDoctor/index.tsx +271 -0
- package/src/together/components/molecules/popupExpert/index.styled.tsx +175 -0
- package/src/together/components/molecules/popupExpert/index.tsx +216 -0
- package/src/together/components/molecules/popupFrame/index.styled.tsx +76 -0
- package/src/together/components/molecules/popupFrame/index.tsx +43 -0
- package/src/together/components/molecules/popupFrame/popupShare.tsx +178 -0
- package/src/together/components/molecules/popupHospital/index.styled.tsx +173 -0
- package/src/together/components/molecules/popupHospital/index.tsx +249 -0
- package/src/together/components/molecules/postContent/index.styled.tsx +66 -0
- package/src/together/components/molecules/postContent/index.tsx +125 -0
- package/src/together/components/molecules/postImagePreview/imagePreviewPopup.tsx +73 -0
- package/src/together/components/molecules/postImagePreview/index.styled.tsx +154 -0
- package/src/together/components/molecules/postImagePreview/index.tsx +115 -0
- package/src/together/components/molecules/postImagePreview/postSingleImageViewPopup/index.styled.tsx +84 -0
- package/src/together/components/molecules/postImagePreview/postSingleImageViewPopup/index.tsx +83 -0
- package/src/together/components/molecules/shareBox/index.stories.tsx +36 -0
- package/src/together/components/molecules/shareBox/index.styled.tsx +141 -0
- package/src/together/components/molecules/shareBox/index.tsx +188 -0
- package/src/together/components/molecules/socialLinkPreview/index.styled.tsx +39 -0
- package/src/together/components/molecules/socialLinkPreview/index.tsx +206 -0
- package/src/together/components/molecules/submitReportForm/index.styled.tsx +34 -0
- package/src/together/components/molecules/submitReportForm/index.tsx +84 -0
- package/src/together/components/molecules/topicSelectList/index.stories.tsx +93 -0
- package/src/together/components/molecules/topicSelectList/index.styled.tsx +53 -0
- package/src/together/components/molecules/topicSelectList/index.tsx +186 -0
- package/src/together/components/organisms/cardPost/cardPostPopover.tsx +293 -0
- package/src/together/components/organisms/cardPost/index.stories.tsx +212 -0
- package/src/together/components/organisms/cardPost/index.styled.tsx +181 -0
- package/src/together/components/organisms/cardPost/index.tsx +458 -0
- package/src/together/components/organisms/cardReply/cardReplyPopover.tsx +122 -0
- package/src/together/components/organisms/cardReply/index.styled.tsx +199 -0
- package/src/together/components/organisms/cardReply/index.tsx +362 -0
- package/src/together/components/organisms/index.tsx +5 -0
- package/src/together/components/organisms/popoverMenu/index.styled.tsx +313 -0
- package/src/together/components/organisms/popoverMenu/index.tsx +102 -0
- package/src/together/components/organisms/popoverMenu/treePopoverMenu.tsx +156 -0
- package/src/together/hooks/useTogetherAuthRequiredAction.tsx +124 -0
- package/src/together/index.ts +12 -0
- package/src/together/interfaces/constants.ts +306 -0
- package/src/together/interfaces/types.ts +1418 -0
- package/src/together/togetherComponentGlobalContext.tsx +150 -0
- package/src/together/utils/apiActions/comment.tsx +168 -0
- package/src/together/utils/apiActions/community.ts +59 -0
- package/src/together/utils/apiActions/post.ts +234 -0
- package/src/together/utils/apiActions/topic.ts +40 -0
- package/src/together/utils/notification.ts +20 -0
- package/src/together/utils/post.ts +351 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react'
|
|
2
|
+
|
|
3
|
+
import { LOCALIZED_SLUGS } from 'care/interfaces/constants'
|
|
4
|
+
import { LocaleType } from 'interfaces/types'
|
|
5
|
+
import formatString from 'string-format'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
CARE_PATHS,
|
|
10
|
+
DISCOVER_PATHS,
|
|
11
|
+
domainLocales,
|
|
12
|
+
MARRY_BABY_PATH,
|
|
13
|
+
TOGETHER_PATHS,
|
|
14
|
+
} from './constants'
|
|
15
|
+
import { defaultTranslation } from './languages/default'
|
|
16
|
+
// import { defaultTranslation } from './languages/default'
|
|
17
|
+
import {
|
|
18
|
+
CategoryHealthToolApi,
|
|
19
|
+
Community,
|
|
20
|
+
CommunityApi,
|
|
21
|
+
HealthTool,
|
|
22
|
+
HealthToolApi,
|
|
23
|
+
HealthToolByCategory,
|
|
24
|
+
LocalisedSlugsType,
|
|
25
|
+
NavContext,
|
|
26
|
+
SpotlightSummary,
|
|
27
|
+
SpotlightSummaryApi,
|
|
28
|
+
TopicApi,
|
|
29
|
+
} from './types'
|
|
30
|
+
|
|
31
|
+
const BREAK_POINT = 768
|
|
32
|
+
|
|
33
|
+
export const spLayout = () => {
|
|
34
|
+
return (style: TemplateStringsArray) =>
|
|
35
|
+
`@media (max-width: ${BREAK_POINT - 1}px) { ${style} }`
|
|
36
|
+
}
|
|
37
|
+
export const pcLayout = () => {
|
|
38
|
+
return (style: TemplateStringsArray) =>
|
|
39
|
+
`@media (min-width: ${BREAK_POINT}px) { ${style} }`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const NaContext = createContext({} as NavContext)
|
|
43
|
+
|
|
44
|
+
export const useTranslation = () => {
|
|
45
|
+
const naContext = useContext(NaContext)
|
|
46
|
+
|
|
47
|
+
return (key: string, option?: { [key: string]: any }) => {
|
|
48
|
+
const translation = naContext.translation || {}
|
|
49
|
+
|
|
50
|
+
const translationContent = translation[key] || defaultTranslation[key]
|
|
51
|
+
|
|
52
|
+
return translationContent
|
|
53
|
+
? option
|
|
54
|
+
? formatString(translationContent, option)
|
|
55
|
+
: translationContent
|
|
56
|
+
: (() => {
|
|
57
|
+
throw Error('missing translation ' + key)
|
|
58
|
+
})()
|
|
59
|
+
// key
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const formatCommunity = (community: CommunityApi): Community => {
|
|
64
|
+
if (!community) return {} as Community
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
title: community?.name || '',
|
|
68
|
+
thumbnail: community?.thumbnail || '',
|
|
69
|
+
communitySlug: community?.slug || '',
|
|
70
|
+
communityId: community?.id,
|
|
71
|
+
color: community?.color,
|
|
72
|
+
} as Community
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const formatTogetherTopic = (topic: TopicApi): Community => {
|
|
76
|
+
if (!topic) return {} as Community
|
|
77
|
+
return {
|
|
78
|
+
title: topic?.name || '',
|
|
79
|
+
thumbnail: topic?.thumbnail || '',
|
|
80
|
+
communitySlug: `${topic?.community?.slug}/${topic?.slug}`,
|
|
81
|
+
communityId: topic?.id,
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const formatSponsor = (sponsor: any): any => {
|
|
86
|
+
if (!sponsor) return {} as any
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
title: sponsor.title,
|
|
90
|
+
logo: sponsor.logo,
|
|
91
|
+
link: sponsor.link,
|
|
92
|
+
} as any
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const formatReviewedCategory = (data: any): any => {
|
|
96
|
+
return {
|
|
97
|
+
postTitle: data.post_title,
|
|
98
|
+
permalink: data.permalink,
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const formatFaqsCategory = (data: any): any => {
|
|
103
|
+
return {
|
|
104
|
+
title: data.title,
|
|
105
|
+
content: data.content,
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const formatCategory = (category: any): any => {
|
|
110
|
+
if (!category) return {} as any
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
termId: category.term_id || null,
|
|
114
|
+
sponsor: category.sponsor ? formatSponsor(category.sponsor) : null,
|
|
115
|
+
isSponsored: category.is_sponsored || null,
|
|
116
|
+
categoryName: category.cat_name || category.name || null,
|
|
117
|
+
name: category.name || null,
|
|
118
|
+
iconUrl: category.icon || '',
|
|
119
|
+
slugName: category.category_nicename || null,
|
|
120
|
+
description: category.description || null,
|
|
121
|
+
featureImage: category.thumbnail || category.image || null,
|
|
122
|
+
displayName: category.name || null,
|
|
123
|
+
parent: category.parent || null,
|
|
124
|
+
permalink: category.permalink || null,
|
|
125
|
+
slug: category.slug || null,
|
|
126
|
+
childCates:
|
|
127
|
+
category.child_cates?.map((childCate) => {
|
|
128
|
+
return formatCategory(childCate)
|
|
129
|
+
}) || [],
|
|
130
|
+
thumnailColor:
|
|
131
|
+
category.thumnail_color ||
|
|
132
|
+
['#FFEAF1', '#E0E9FB', '#FFF9EB', '#F2FCF7', '#F3F3F3'][
|
|
133
|
+
(Math.random() * 5) | 0
|
|
134
|
+
],
|
|
135
|
+
colorFeatureImage: category.color_feature_image || null,
|
|
136
|
+
imageColor: category.image_color || null,
|
|
137
|
+
textColor: category.text_color || null,
|
|
138
|
+
catParent: category.cat_parent?.name
|
|
139
|
+
? {
|
|
140
|
+
name: category.cat_parent.name,
|
|
141
|
+
permalink: category.cat_parent.permalink,
|
|
142
|
+
}
|
|
143
|
+
: {},
|
|
144
|
+
metaTag: category.meta_tag || '',
|
|
145
|
+
reviewedBy: category.reviewed_by
|
|
146
|
+
? formatReviewedCategory(category.reviewed_by)
|
|
147
|
+
: null,
|
|
148
|
+
reviewedDate: category.reviewed_date || '',
|
|
149
|
+
faqs: category.faqs
|
|
150
|
+
? category.faqs.map((faq) => formatFaqsCategory(faq))
|
|
151
|
+
: null,
|
|
152
|
+
} as any
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const formatHealthTool = (healthTool: HealthToolApi): HealthTool => {
|
|
156
|
+
if (!healthTool) return {} as HealthTool
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
icon: healthTool.icon,
|
|
160
|
+
link:
|
|
161
|
+
// healthTool.link.startsWith('http')
|
|
162
|
+
// ?
|
|
163
|
+
healthTool.link,
|
|
164
|
+
// : '/health-tools' + healthTool.link,
|
|
165
|
+
subtitle: healthTool.subtitle,
|
|
166
|
+
title: healthTool.title,
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export const formatHealthToolTypeCategory = (
|
|
170
|
+
category: CategoryHealthToolApi,
|
|
171
|
+
): HealthToolByCategory => {
|
|
172
|
+
if (!category) return {} as HealthToolByCategory
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
termId: category?.term_id || 0,
|
|
176
|
+
name: category?.name || '',
|
|
177
|
+
healthTools:
|
|
178
|
+
category?.health_tools?.map((tool: HealthTool) =>
|
|
179
|
+
formatHealthTool(tool),
|
|
180
|
+
) ?? [],
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export const getCareDefaultSpecialtiesApiPath = (
|
|
185
|
+
locale: LocaleType,
|
|
186
|
+
apiDomain?: string,
|
|
187
|
+
params?: { [key: string]: string | number },
|
|
188
|
+
) => {
|
|
189
|
+
const apiUrl =
|
|
190
|
+
apiDomain || 'https://service-health-care.hellohealthgroup.com/'
|
|
191
|
+
return (
|
|
192
|
+
apiUrl +
|
|
193
|
+
formatString(CARE_PATHS.SPECIALTIES, {
|
|
194
|
+
...params,
|
|
195
|
+
domain: domainLocales[locale],
|
|
196
|
+
})
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const getDiscoverDefaultCategoriesApiPath = (
|
|
201
|
+
locale: LocaleType,
|
|
202
|
+
apiDomain?: string,
|
|
203
|
+
params?: { [key: string]: string | number },
|
|
204
|
+
) => {
|
|
205
|
+
const apiUrl = apiDomain || `https://wp.${domainLocales[locale]}/`
|
|
206
|
+
return (
|
|
207
|
+
apiUrl +
|
|
208
|
+
'wp-json/api/' +
|
|
209
|
+
formatString(DISCOVER_PATHS.CATEGORIES, { ...params })
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export const getDiscoverDefaultHealthToolsApiPath = (
|
|
214
|
+
locale: LocaleType,
|
|
215
|
+
apiDomain?: string,
|
|
216
|
+
params?: { [key: string]: string | number },
|
|
217
|
+
) => {
|
|
218
|
+
const apiUrl = apiDomain || `https://wp.${domainLocales[locale]}/`
|
|
219
|
+
return (
|
|
220
|
+
apiUrl +
|
|
221
|
+
'wp-json/api/' +
|
|
222
|
+
formatString(DISCOVER_PATHS.HEALTH_TOOLS, { ...params })
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
export const getDiscoverDefaultHealthToolsByCategoryApiPath = (
|
|
226
|
+
locale: LocaleType,
|
|
227
|
+
apiDomain?: string,
|
|
228
|
+
params?: { [key: string]: string | number },
|
|
229
|
+
) => {
|
|
230
|
+
const apiUrl = apiDomain || `https://wp.${domainLocales[locale]}/`
|
|
231
|
+
return (
|
|
232
|
+
apiUrl +
|
|
233
|
+
'wp-json/api/' +
|
|
234
|
+
formatString(DISCOVER_PATHS.HEALTH_TOOLS_BY_CATEGORY, { ...params })
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export const getDiscoverDefaultSpotlightsApiPath = (
|
|
239
|
+
locale: LocaleType,
|
|
240
|
+
apiDomain?: string,
|
|
241
|
+
params?: { [key: string]: string | number },
|
|
242
|
+
) => {
|
|
243
|
+
const apiUrl = apiDomain || `https://wp.${domainLocales[locale]}/`
|
|
244
|
+
return (
|
|
245
|
+
apiUrl +
|
|
246
|
+
'wp-json/api/' +
|
|
247
|
+
formatString(DISCOVER_PATHS.SPOTLIGHTS, {
|
|
248
|
+
...params,
|
|
249
|
+
})
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export const getDiscoverDefaultFooterApiPath = (
|
|
254
|
+
locale: LocaleType,
|
|
255
|
+
apiDomain?: string,
|
|
256
|
+
params?: { [key: string]: string | number },
|
|
257
|
+
) => {
|
|
258
|
+
const apiUrl = apiDomain || `https://wp.${domainLocales[locale]}/`
|
|
259
|
+
return (
|
|
260
|
+
apiUrl +
|
|
261
|
+
'wp-json/api/' +
|
|
262
|
+
formatString(DISCOVER_PATHS.FOOTER, {
|
|
263
|
+
...params,
|
|
264
|
+
})
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export const getTogetherDefaultCommunitiesApiPath = (
|
|
269
|
+
locale: LocaleType,
|
|
270
|
+
apiDomain?: string,
|
|
271
|
+
params?: { [key: string]: string | number },
|
|
272
|
+
) => {
|
|
273
|
+
const apiUrl = apiDomain || `https://together.hellohealthgroup.com/`
|
|
274
|
+
return (
|
|
275
|
+
apiUrl +
|
|
276
|
+
'api/v1/' +
|
|
277
|
+
formatString(TOGETHER_PATHS.COMMUNITIES, {
|
|
278
|
+
...params,
|
|
279
|
+
websiteUrl: `https://${domainLocales[locale]}`,
|
|
280
|
+
})
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export const getTogetherUserPostsApiPath = (
|
|
285
|
+
locale: LocaleType,
|
|
286
|
+
isMarryBaby: boolean,
|
|
287
|
+
apiDomain?: string,
|
|
288
|
+
params?: { [key: string]: string | number },
|
|
289
|
+
) => {
|
|
290
|
+
const apiUrl = apiDomain || `https://together.hellohealthgroup.com/`
|
|
291
|
+
return (
|
|
292
|
+
apiUrl +
|
|
293
|
+
'api/v1/' +
|
|
294
|
+
formatString(TOGETHER_PATHS.GET_USER_POSTS, {
|
|
295
|
+
...params,
|
|
296
|
+
websiteUrl: isMarryBaby
|
|
297
|
+
? 'https://marrybaby.vn'
|
|
298
|
+
: `https://${domainLocales[locale]}`,
|
|
299
|
+
})
|
|
300
|
+
)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export const getTogetherMarryBabyCommunitiesApiPath = (
|
|
304
|
+
locale: LocaleType,
|
|
305
|
+
apiDomain?: string,
|
|
306
|
+
params?: { [key: string]: string | number },
|
|
307
|
+
) => {
|
|
308
|
+
const apiUrl = apiDomain || `https://together.hellohealthgroup.com/`
|
|
309
|
+
return (
|
|
310
|
+
apiUrl +
|
|
311
|
+
'api/v1/' +
|
|
312
|
+
formatString(TOGETHER_PATHS.COMMUNITIES, {
|
|
313
|
+
...params,
|
|
314
|
+
websiteUrl: `https://marrybaby.vn`,
|
|
315
|
+
})
|
|
316
|
+
)
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export const getTogetherDefaultCommunitiesSubMenuApiPath = (
|
|
320
|
+
locale: LocaleType,
|
|
321
|
+
apiDomain?: string,
|
|
322
|
+
params?: { [key: string]: string | number },
|
|
323
|
+
) => {
|
|
324
|
+
const apiUrl = apiDomain || `https://together.hellohealthgroup.com/`
|
|
325
|
+
return (
|
|
326
|
+
apiUrl +
|
|
327
|
+
'api/v1/' +
|
|
328
|
+
formatString(TOGETHER_PATHS.MENU_TOPIC, {
|
|
329
|
+
...params,
|
|
330
|
+
websiteUrl: `https://${domainLocales[locale]}`,
|
|
331
|
+
})
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export const getTogetherMarryBabyCommunitiesSubMenuApiPath = (
|
|
336
|
+
locale: LocaleType,
|
|
337
|
+
apiDomain?: string,
|
|
338
|
+
params?: { [key: string]: string | number },
|
|
339
|
+
) => {
|
|
340
|
+
const apiUrl = apiDomain || `https://together.hellohealthgroup.com/`
|
|
341
|
+
return (
|
|
342
|
+
apiUrl +
|
|
343
|
+
'api/v1/' +
|
|
344
|
+
formatString(TOGETHER_PATHS.MENU_TOPIC, {
|
|
345
|
+
...params,
|
|
346
|
+
websiteUrl: `https://marrybaby.vn`,
|
|
347
|
+
})
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export const getMarryBabyDefaultFooterApiPath = (
|
|
352
|
+
locale: LocaleType,
|
|
353
|
+
apiDomain?: string,
|
|
354
|
+
params?: { [key: string]: string | number },
|
|
355
|
+
) => {
|
|
356
|
+
const apiUrl = apiDomain || `https://staging.marrybaby.vn/`
|
|
357
|
+
return (
|
|
358
|
+
apiUrl +
|
|
359
|
+
'wp-json/api/' +
|
|
360
|
+
formatString(MARRY_BABY_PATH.FOOTER, {
|
|
361
|
+
...params,
|
|
362
|
+
})
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export const getMarryBabyDefaultHealthToolsApiPath = (
|
|
367
|
+
locale: LocaleType,
|
|
368
|
+
apiDomain?: string,
|
|
369
|
+
params?: { [key: string]: string | number },
|
|
370
|
+
) => {
|
|
371
|
+
const apiUrl = apiDomain || `https://staging.marrybaby.vn/`
|
|
372
|
+
return (
|
|
373
|
+
apiUrl +
|
|
374
|
+
'wp-json/api/' +
|
|
375
|
+
formatString(MARRY_BABY_PATH.HEALTH_TOOLS, {
|
|
376
|
+
...params,
|
|
377
|
+
})
|
|
378
|
+
)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export const getCareSearchUrl = ({
|
|
382
|
+
type,
|
|
383
|
+
specialtySlug,
|
|
384
|
+
locale,
|
|
385
|
+
}: {
|
|
386
|
+
type: LocalisedSlugsType
|
|
387
|
+
cityId?: string | number
|
|
388
|
+
specialtySlug: string
|
|
389
|
+
locale: LocaleType
|
|
390
|
+
}) => {
|
|
391
|
+
return `/${LOCALIZED_SLUGS[locale].ALL}/${
|
|
392
|
+
LOCALIZED_SLUGS[locale]?.[type] || 'doctor'
|
|
393
|
+
}/${specialtySlug ?? ''}`
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export const formatSpotlightsList = (
|
|
397
|
+
spotlight: SpotlightSummaryApi,
|
|
398
|
+
): SpotlightSummary => {
|
|
399
|
+
if (!spotlight) return {} as SpotlightSummary
|
|
400
|
+
|
|
401
|
+
return {
|
|
402
|
+
id: spotlight.ID,
|
|
403
|
+
name: spotlight.name,
|
|
404
|
+
permalink: spotlight.permalink,
|
|
405
|
+
image: spotlight?.small_banner || spotlight?.image || '',
|
|
406
|
+
imageMedium: spotlight?.image_medium || null,
|
|
407
|
+
imageThumbnail: spotlight?.image_thumbnail || null,
|
|
408
|
+
startDate: spotlight?.start_date,
|
|
409
|
+
endDate: spotlight?.end_date,
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export const checkAvailableSpotlight = (spotlight: SpotlightSummary) => {
|
|
414
|
+
const today = new Date()
|
|
415
|
+
if (spotlight?.startDate) {
|
|
416
|
+
const startDate = new Date(spotlight.startDate)
|
|
417
|
+
if (today.getTime() < startDate.getTime()) return false
|
|
418
|
+
}
|
|
419
|
+
if (spotlight?.endDate) {
|
|
420
|
+
const endDate = new Date(spotlight.endDate)
|
|
421
|
+
if (today.getTime() > endDate.getTime()) return false
|
|
422
|
+
}
|
|
423
|
+
return true
|
|
424
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
|
|
5
|
+
import { NavigationLogoutPopup, Props } from '.'
|
|
6
|
+
import { Button } from '../../atoms'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
component: NavigationLogoutPopup,
|
|
10
|
+
title: 'Organisms/NavigationLogoutPopup',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Template: Story<Props> = (args) => {
|
|
14
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Button size="md" onClick={() => setIsOpen(true)}>
|
|
18
|
+
Logout
|
|
19
|
+
</Button>
|
|
20
|
+
<NavigationLogoutPopup
|
|
21
|
+
{...args}
|
|
22
|
+
openLogoutPopup={isOpen}
|
|
23
|
+
onCloseHandler={() => setIsOpen(false)}
|
|
24
|
+
/>
|
|
25
|
+
</>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Normal = Template.bind({})
|
|
30
|
+
|
|
31
|
+
Normal.args = {
|
|
32
|
+
basePath: '/',
|
|
33
|
+
siteType: 'helloSites',
|
|
34
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ThemeProps } from 'misc/theme'
|
|
2
|
+
import { MediaQueries } from 'misc/utils'
|
|
3
|
+
import styled from 'styled-components'
|
|
4
|
+
|
|
5
|
+
export const StyledPopup = styled.div`
|
|
6
|
+
background-color: white;
|
|
7
|
+
text-align: center;
|
|
8
|
+
.cancle-img {
|
|
9
|
+
margin-top: 24px;
|
|
10
|
+
${MediaQueries.mbDown} {
|
|
11
|
+
width: 80px;
|
|
12
|
+
height: 80px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
${MediaQueries.mbUp} {
|
|
16
|
+
width: 100px;
|
|
17
|
+
height: 100px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
h2 {
|
|
22
|
+
margin-top: 32px;
|
|
23
|
+
color: ${(props: ThemeProps) => props.theme.colors.gray800};
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
${MediaQueries.mbDown} {
|
|
27
|
+
font-size: 24px;
|
|
28
|
+
line-height: 32px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${MediaQueries.mbUp} {
|
|
32
|
+
font-size: 32px;
|
|
33
|
+
line-height: 42px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
p {
|
|
38
|
+
margin-top: 8px;
|
|
39
|
+
color: ${(props: ThemeProps) => props.theme.colors.gray600};
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: normal;
|
|
42
|
+
${MediaQueries.mbDown} {
|
|
43
|
+
font-size: 16px;
|
|
44
|
+
line-height: 24px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
${MediaQueries.mbUp} {
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
line-height: 24px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`
|
|
53
|
+
type StyledButtonGroupProps = {
|
|
54
|
+
siteType: 'helloSites' | 'marryBaby'
|
|
55
|
+
}
|
|
56
|
+
export const StyledButtonGroup = styled.div<StyledButtonGroupProps>`
|
|
57
|
+
display: flex;
|
|
58
|
+
|
|
59
|
+
${MediaQueries.mbDown} {
|
|
60
|
+
margin-top: 24px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
${MediaQueries.mbUp} {
|
|
64
|
+
margin-top: 32px;
|
|
65
|
+
}
|
|
66
|
+
justify-content: space-around;
|
|
67
|
+
button {
|
|
68
|
+
flex: 1;
|
|
69
|
+
margin: 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
${(props) =>
|
|
73
|
+
props.siteType === 'marryBaby'
|
|
74
|
+
? `
|
|
75
|
+
.cancel-button {
|
|
76
|
+
background-color: #E55C8A;
|
|
77
|
+
}
|
|
78
|
+
.cancel-button:hover {
|
|
79
|
+
background-color: #E55C8A !important;
|
|
80
|
+
}
|
|
81
|
+
.logout-button {
|
|
82
|
+
border-color: #E55C8A;
|
|
83
|
+
color: #E55C8A;
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
: ''}
|
|
87
|
+
`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
|
|
4
|
+
import { ArrowDoorIcon, CloseLightIcon } from 'assets/svg'
|
|
5
|
+
import { Button } from 'components/atoms/button'
|
|
6
|
+
import { Popup } from 'components/molecules/popup'
|
|
7
|
+
import { useTranslations } from 'src/hooks/useTranslations'
|
|
8
|
+
|
|
9
|
+
import { StyledPopup, StyledButtonGroup } from './index.styled'
|
|
10
|
+
|
|
11
|
+
export type Props = {
|
|
12
|
+
openLogoutPopup: boolean
|
|
13
|
+
onCloseHandler: () => void
|
|
14
|
+
onLogoutHandler: () => void
|
|
15
|
+
siteType: 'helloSites' | 'marryBaby'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const NavigationLogoutPopup = ({
|
|
19
|
+
openLogoutPopup,
|
|
20
|
+
onCloseHandler,
|
|
21
|
+
onLogoutHandler,
|
|
22
|
+
siteType = 'helloSites',
|
|
23
|
+
}: Props) => {
|
|
24
|
+
const { t } = useTranslations()
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
document.body.classList.toggle('noscroll', openLogoutPopup)
|
|
28
|
+
}, [openLogoutPopup])
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Popup
|
|
32
|
+
type="confirm"
|
|
33
|
+
isOpen={openLogoutPopup}
|
|
34
|
+
closeIcon={
|
|
35
|
+
<img
|
|
36
|
+
src={CloseLightIcon}
|
|
37
|
+
style={{ width: 24, height: 24 }}
|
|
38
|
+
alt="close-icon"
|
|
39
|
+
/>
|
|
40
|
+
}
|
|
41
|
+
onClose={onCloseHandler}
|
|
42
|
+
>
|
|
43
|
+
<StyledPopup>
|
|
44
|
+
{siteType === 'helloSites' && (
|
|
45
|
+
<img src={ArrowDoorIcon} className="cancle-img" alt="close-account" />
|
|
46
|
+
)}
|
|
47
|
+
<h2>
|
|
48
|
+
{t(
|
|
49
|
+
siteType === 'helloSites'
|
|
50
|
+
? 'logout.popup.ask1'
|
|
51
|
+
: 'logout.popup.ask.mb',
|
|
52
|
+
)}
|
|
53
|
+
</h2>
|
|
54
|
+
<p>{t('logout.popup.ask2')}</p>
|
|
55
|
+
<StyledButtonGroup siteType={siteType}>
|
|
56
|
+
<Button
|
|
57
|
+
className="logout-button"
|
|
58
|
+
color="tertiary"
|
|
59
|
+
size="lg"
|
|
60
|
+
onClick={onLogoutHandler}
|
|
61
|
+
>
|
|
62
|
+
{t('logout.popup.button.logout')}
|
|
63
|
+
</Button>
|
|
64
|
+
<Button
|
|
65
|
+
className="cancel-button"
|
|
66
|
+
color="primary"
|
|
67
|
+
size="lg"
|
|
68
|
+
onClick={onCloseHandler}
|
|
69
|
+
>
|
|
70
|
+
{t('logout.popup.button.cancel')}
|
|
71
|
+
</Button>
|
|
72
|
+
</StyledButtonGroup>
|
|
73
|
+
</StyledPopup>
|
|
74
|
+
</Popup>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { NavigationLogoutPopup }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
|
|
5
|
+
import { NavigationProfileButton, Props } from '.'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: NavigationProfileButton,
|
|
9
|
+
title: 'Organisms/NavigationProfileButton',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Template: Story<Props> = (args) => <NavigationProfileButton {...args} />
|
|
13
|
+
|
|
14
|
+
const defaultProps = {
|
|
15
|
+
siteType: 'helloSites',
|
|
16
|
+
userInfo: {
|
|
17
|
+
name: 'Lorem Ipsum',
|
|
18
|
+
username: 'Lorem Ipsum',
|
|
19
|
+
avatar: '',
|
|
20
|
+
email: 'loremipsum@gmail.com',
|
|
21
|
+
role: 'User',
|
|
22
|
+
id: 1,
|
|
23
|
+
bookmarks: [],
|
|
24
|
+
total_bookmark: 0,
|
|
25
|
+
},
|
|
26
|
+
isAmp: false,
|
|
27
|
+
goToLogin: () => false,
|
|
28
|
+
SSO_URL: '/',
|
|
29
|
+
locale: 'vi-VN',
|
|
30
|
+
currentUrl: '/',
|
|
31
|
+
isMinifyLogin: true,
|
|
32
|
+
|
|
33
|
+
ENABLE_CARE_PROFILE_MENU_LOCALES: ['vi-VN'],
|
|
34
|
+
ENABLE_COMMUNITY_PROFILE_MENU_LOCALES: ['vi-VN'],
|
|
35
|
+
ENABLE_ECOM_PROFILE_MENU_LOCALES: ['vi-VN'],
|
|
36
|
+
isUserProfileNavigatorMenuHidden: false,
|
|
37
|
+
isMyHealthEnabled: true,
|
|
38
|
+
UP_BASEPATH: '/',
|
|
39
|
+
togetherApiDomain: '/',
|
|
40
|
+
dispatchLogout: () => false,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const LoggedIn = Template.bind({})
|
|
44
|
+
LoggedIn.args = {
|
|
45
|
+
...defaultProps,
|
|
46
|
+
}
|
|
47
|
+
export const LoggedOut = Template.bind({})
|
|
48
|
+
LoggedOut.args = {
|
|
49
|
+
...defaultProps,
|
|
50
|
+
userInfo: undefined,
|
|
51
|
+
}
|