@hhgtech/hhg-components 1.29.80 → 1.29.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{index-1250dd06.js → WhatsApp-46f4f408.js} +24 -276
- package/build/adapters.js +17 -16
- package/build/atoms.js +102 -0
- package/build/babyGrowth.js +162 -164
- package/build/cache.js +3 -3
- package/build/care.js +17 -17
- package/build/components.js +181 -163
- package/build/{constants-ca71f9e5.js → constants-223c01fc.js} +2 -2
- package/build/{constants-4e7c419e.js → constants-8743b014.js} +0 -136
- package/build/constants-a78fa8b3.js +318 -0
- package/build/constants-f182fc32.js +425 -0
- package/build/constants.js +3 -3
- package/build/{core-bb2587e7.js → core-9d69a722.js} +2 -2
- package/build/{dataTransform-469b75eb.js → dataTransform-ded2692d.js} +1 -1
- package/build/{index-5d9ad07e.js → dataTransform-e39297c1.js} +3 -52
- package/build/defaultClassWrapper-b7719693.js +21 -0
- package/build/ecom.js +5 -5
- package/build/esm/WhatsApp-c599b715.js +46 -0
- package/build/esm/adapters.js +17 -16
- package/build/esm/atoms.js +59 -0
- package/build/esm/babyGrowth.js +87 -89
- package/build/esm/cache.js +3 -3
- package/build/esm/care.js +17 -17
- package/build/esm/components.js +91 -73
- package/build/esm/constants-a5827634.js +307 -0
- package/build/esm/{constants-7661ce64.js → constants-bb470362.js} +2 -2
- package/build/esm/{constants-508ba335.js → constants-f6b2e49d.js} +1 -127
- package/build/esm/constants-fa475b0f.js +417 -0
- package/build/esm/constants.js +3 -3
- package/build/esm/{core-5a22b83e.js → core-80bfe8b7.js} +2 -2
- package/build/esm/{dataTransform-f5db5afb.js → dataTransform-55f67eed.js} +1 -1
- package/build/esm/{index-9b54376f.js → dataTransform-623716c3.js} +5 -53
- package/build/esm/defaultClassWrapper-00903c00.js +15 -0
- package/build/esm/ecom.js +5 -5
- package/build/esm/fixedBottomAdBlock-60a5d48f.js +3474 -0
- package/build/esm/footer.js +18 -18
- package/build/esm/gAssets.js +4 -4
- package/build/esm/{getDynamicHealthTool-09fda8b3.js → getDynamicHealthTool-82855adc.js} +4 -4
- package/build/esm/{getSocialList-96301dbb.js → getSocialList-7d2cf48d.js} +5 -6
- package/build/esm/healthToolsForm.js +40 -0
- package/build/esm/healthToolsForms.d.ts +7 -0
- package/build/esm/hooks.js +17 -17
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-da2b8f22.js → index-01405723.js} +12 -11
- package/build/esm/index-01b5d2e9.js +202 -0
- package/build/esm/index-02d3f05b.js +1681 -0
- package/build/esm/{index-82861dba.js → index-046778af.js} +2 -2
- package/build/esm/{index-df29c4e0.js → index-049e0270.js} +33 -5
- package/build/esm/index-07f3f47e.js +14 -0
- package/build/esm/index-0b745f46.js +1349 -0
- package/build/esm/{index-e68d4285.js → index-0ca9b175.js} +2 -2
- package/build/esm/{index-c4699d44.js → index-0cd3523c.js} +35 -176
- package/build/esm/index-0ee66974.js +95 -0
- package/build/esm/index-10ab6596.js +489 -0
- package/build/esm/{index-5773eb18.js → index-13d8dd4b.js} +6 -6
- package/build/esm/{index.styled-9e147e72.js → index-1c9b481b.js} +21 -3
- package/build/esm/index-1d3c6ce7.js +195 -0
- package/build/esm/{index-474e0ae5.js → index-21256394.js} +2 -13
- package/build/esm/{index-2d47a346.js → index-219e3a35.js} +11 -10
- package/build/esm/{index-679d5383.js → index-29908d2c.js} +1 -1
- package/build/esm/{utils-ff5d88a2.js → index-2dc7803d.js} +71 -105
- package/build/esm/{index-4dcdce19.js → index-5723381f.js} +2 -2
- package/build/esm/{index-c807ef87.js → index-6210f454.js} +3 -3
- package/build/esm/index-7a1ea734.js +100 -0
- package/build/esm/{index-53a86337.js → index-7c384ae6.js} +5 -5
- package/build/esm/index-8eb04f36.js +130 -0
- package/build/esm/index-8fcf671c.js +335 -0
- package/build/esm/{index-80f4d7df.js → index-9471fca1.js} +2 -2
- package/build/esm/{index-92eedeb0.js → index-9b3a8b6d.js} +12 -201
- package/build/esm/{index-3c7f109c.js → index-9b9c1499.js} +2 -2
- package/build/esm/index-9f99909b.js +54 -0
- package/build/esm/index-ac2a8f95.js +1114 -0
- package/build/esm/index-acf8b60e.js +42 -0
- package/build/esm/index-ad1c7c38.js +275 -0
- package/build/esm/{index-bcd13f1d.js → index-bcedec73.js} +13 -12
- package/build/esm/{index-ef855343.js → index-c013ba1b.js} +4 -4
- package/build/esm/index-c2584051.js +262 -0
- package/build/esm/{types-957334f2.js → index-c430773c.js} +559 -3519
- package/build/esm/index-cdc50618.js +25 -0
- package/build/esm/{index-77dddeb9.js → index-cfedca38.js} +2 -2
- package/build/esm/index-d6a5f5cf.js +557 -0
- package/build/esm/index-e0b0d6a2.js +847 -0
- package/build/esm/index-ea63e0d2.js +148 -0
- package/build/esm/{index-32e2b169.js → index-f22f6e6e.js} +65 -28
- package/build/esm/index-f4b938f2.js +18 -0
- package/build/esm/index-f660abb7.js +156 -0
- package/build/esm/index-fa67d66e.js +789 -0
- package/build/esm/index.js +98 -73
- package/build/esm/labelSorting-7351409a.js +47 -0
- package/build/esm/lead.js +23 -33
- package/build/esm/logoIcon-3a581efb.js +104 -0
- package/build/esm/mantine.js +22 -20
- package/build/esm/misc.js +21 -21
- package/build/esm/molecules.js +88 -0
- package/build/esm/navigation.js +37 -37
- package/build/esm/onboardingV2.js +26 -35
- package/build/esm/organisms.js +57 -0
- package/build/esm/pwg.js +19 -19
- package/build/esm/{routing-7bc3e320.js → routing-9e330438.js} +2 -2
- package/build/esm/subot.js +31 -27
- package/build/esm/surveyOrPremiumBanner.js +45 -0
- package/build/esm/surveyQuestionCard.js +13 -0
- package/build/esm/surveyThankyouCard-ec204631.js +446 -0
- package/build/esm/together.js +52 -45
- package/build/esm/togetherAtoms.js +41 -0
- package/build/esm/togetherComponentGlobalContext.js +12 -0
- package/build/esm/togetherMolecules.js +53 -0
- package/build/esm/togetherOrganisms.js +57 -0
- package/build/esm/treePopoverMenu-cb214db6.js +332 -0
- package/build/esm/types-721e7a66.js +5 -0
- package/build/esm/{types-ee1be1e3.js → types-ffcf5fb4.js} +13 -13
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-7e020652.js → useCategory-553bee0b.js} +5 -5
- package/build/esm/{useHealthToolCache-c70e4fd5.js → useHealthToolCache-6ce1724e.js} +2 -2
- package/build/esm/{useMantineLocale-1373e175.js → useMantineLocale-453f8013.js} +3 -3
- package/build/esm/{usePlacesAutocomplete-4bfe976e.js → usePlacesAutocomplete-8925d4fb.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +60 -0
- package/build/esm/{useTranslations-adad3b06.js → useTranslations-b970f667.js} +1 -1
- package/build/esm/{utils-dee27bfd.js → utils-3b29eb79.js} +8 -356
- package/build/esm/{utils-b14c10f9.js → utils-6d45bdd1.js} +1 -1
- package/build/esm/vaccination.js +18 -29
- package/build/fixedBottomAdBlock-0129a006.js +3521 -0
- package/build/footer.js +18 -18
- package/build/gAssets.js +4 -4
- package/build/{getDynamicHealthTool-357666f7.js → getDynamicHealthTool-f08b5fab.js} +4 -4
- package/build/{getSocialList-c1404aff.js → getSocialList-8cc32f7c.js} +8 -9
- package/build/healthToolsForm.js +54 -0
- package/build/healthToolsForms.d.ts +7 -0
- package/build/hooks.js +17 -17
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-00a78d81.js +565 -0
- package/build/index-077bf48f.js +803 -0
- package/build/{index-bf6e5e4e.js → index-0b727664.js} +5 -5
- package/build/{index-917c975c.js → index-10760994.js} +37 -9
- package/build/index-130e0f35.js +1693 -0
- package/build/{index-82a3ba38.js → index-16ed0d98.js} +68 -33
- package/build/{index-040620f6.js → index-1e1d8eb1.js} +13 -12
- package/build/{index-e60c98f8.js → index-1fdf2f01.js} +2 -2
- package/build/{index-61ef343d.js → index-206afefb.js} +4 -4
- package/build/{types-c8956642.js → index-2afbeb3d.js} +761 -3727
- package/build/{index.styled-8aca5145.js → index-2fd9063e.js} +22 -4
- package/build/index-33432b02.js +270 -0
- package/build/index-3eb666e6.js +202 -0
- package/build/{index-94a2b0f9.js → index-405faafa.js} +2 -2
- package/build/index-4357a324.js +136 -0
- package/build/index-466a2c32.js +1362 -0
- package/build/index-4b7d4b5b.js +156 -0
- package/build/{index-5029b5d8.js → index-4bc690c9.js} +1 -1
- package/build/index-4cdcdbbe.js +498 -0
- package/build/index-53e14542.js +102 -0
- package/build/{index-91027d35.js → index-54aeefca.js} +2 -2
- package/build/index-60f6d762.js +1127 -0
- package/build/{index-858f60e0.js → index-64d8db08.js} +2 -2
- package/build/index-6aeb5ff5.js +866 -0
- package/build/index-71843eb4.js +61 -0
- package/build/index-765ed75d.js +209 -0
- package/build/index-7953fb8e.js +167 -0
- package/build/{index-d710511f.js → index-7ecc69af.js} +12 -11
- package/build/index-82c85f9d.js +277 -0
- package/build/index-9e8877c0.js +25 -0
- package/build/index-a2664204.js +107 -0
- package/build/{index-c67602d7.js → index-a6a9855f.js} +1 -13
- package/build/index-a8680a58.js +49 -0
- package/build/{index-ed587907.js → index-a9bbb5aa.js} +11 -10
- package/build/{utils-263a60f7.js → index-a9bdf889.js} +76 -120
- package/build/{index-f0a532c7.js → index-b66ae554.js} +6 -6
- package/build/index-ca616373.js +20 -0
- package/build/{index-b0414701.js → index-d9919cd2.js} +57 -200
- package/build/index-dd074159.js +32 -0
- package/build/{index-94fd9ea6.js → index-dff7ee1b.js} +32 -222
- package/build/{index-3a03bb34.js → index-e3bbd009.js} +2 -2
- package/build/index-ec34e358.js +343 -0
- package/build/{index-8c826f3e.js → index-f222ee45.js} +2 -2
- package/build/{index-2b32b21e.js → index-fd3e1d16.js} +2 -2
- package/build/index.js +251 -226
- package/build/labelSorting-f86081b7.js +53 -0
- package/build/lead.js +29 -39
- package/build/logoIcon-21a16853.js +110 -0
- package/build/mantine.js +24 -23
- package/build/misc.js +21 -21
- package/build/molecules.js +149 -0
- package/build/navigation.js +37 -37
- package/build/onboardingV2.js +45 -54
- package/build/organisms.js +74 -0
- package/build/pwg.js +19 -19
- package/build/{routing-bc8197d8.js → routing-d6c9099a.js} +2 -2
- package/build/subot.js +115 -111
- package/build/surveyOrPremiumBanner.js +53 -0
- package/build/surveyQuestionCard.js +22 -0
- package/build/surveyThankyouCard-5b23b8f6.js +454 -0
- package/build/together.js +100 -93
- package/build/togetherAtoms.js +55 -0
- package/build/togetherComponentGlobalContext.js +26 -0
- package/build/togetherMolecules.js +86 -0
- package/build/togetherOrganisms.js +71 -0
- package/build/treePopoverMenu-c0cb395f.js +343 -0
- package/build/{types-6996fb20.js → types-8d9c5f21.js} +13 -13
- package/build/types-b25ffde0.js +7 -0
- package/build/types.js +1 -1
- package/build/{useCategory-7d1f8a7d.js → useCategory-b695fd3a.js} +5 -5
- package/build/{useHealthToolCache-b7dea4aa.js → useHealthToolCache-048807ea.js} +2 -2
- package/build/{useMantineLocale-b243f628.js → useMantineLocale-0d63dfea.js} +3 -3
- package/build/{usePlacesAutocomplete-08b86d2d.js → usePlacesAutocomplete-9520e525.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +70 -0
- package/build/{useTranslations-d5456a98.js → useTranslations-685f989b.js} +1 -1
- package/build/{utils-9f62698f.js → utils-169c6a7d.js} +16 -375
- package/build/{utils-d421a448.js → utils-1a00c0f8.js} +1 -1
- package/build/vaccination.js +58 -69
- package/package.json +1 -1
- package/build/Instagram-91ba1e26.js +0 -32
- package/build/esm/Instagram-319a8e34.js +0 -26
- package/build/esm/index-13bf84f4.js +0 -298
- package/build/esm/index-1a3f36c3.js +0 -1086
- package/build/esm/index-800b956a.js +0 -7245
- package/build/esm/index-aebf96f3.js +0 -33
- package/build/esm/index-d48b5db6.js +0 -71
- package/build/esm/index-d5b66388.js +0 -23
- package/build/esm/index.styles-0ef0135c.js +0 -1322
- package/build/index-0523771b.js +0 -7324
- package/build/index-20ebc0bd.js +0 -30
- package/build/index-dbf560f2.js +0 -1100
- package/build/index-efcbac97.js +0 -39
- package/build/index-f5103542.js +0 -77
- package/build/index.styles-2bdfde5f.js +0 -1361
- /package/build/{BMI_BOYS.percentile.monthly-c38ce03a.js → BMI_BOYS.percentile.monthly-1aa95e30.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-1eccee42.js → BMI_BOYS.percentile.weekly-61d78e1c.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0e7d5cb6.js → BMI_BOYS.percentile.yearly-f80e040e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-f72f392f.js → BMI_BOYS.zscore.monthly-a6c7c8ff.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-94fd04e6.js → BMI_BOYS.zscore.weekly-742f7028.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-90d5e091.js → BMI_BOYS.zscore.yearly-c19cccd5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-de3a9a14.js → BMI_GIRLS.percentile.monthly-089d3981.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-1e1ce2b7.js → BMI_GIRLS.percentile.weekly-0cc52cda.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-70a44f31.js → BMI_GIRLS.percentile.yearly-10bc603f.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-be4399a5.js → BMI_GIRLS.zscore.monthly-c3fe57f3.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-6121376b.js → BMI_GIRLS.zscore.weekly-b83a54db.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-822e7686.js → BMI_GIRLS.zscore.yearly-5f13cda2.js} +0 -0
- /package/build/{ChevronDown-f9d31306.js → ChevronDown-2fd86d66.js} +0 -0
- /package/build/{Close-27e0dcf1.js → Close-711196b0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5e094c3e.js → HEAD CIRCUM_BOYS.percentile.monthly-03b8d7fb.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-24f827d8.js → HEAD CIRCUM_BOYS.percentile.weekly-9ebd3eb6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-d7478410.js → HEAD CIRCUM_BOYS.percentile.yearly-8e97b738.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1123cad6.js → HEAD CIRCUM_BOYS.zscore.monthly-e7892261.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-a5b55615.js → HEAD CIRCUM_BOYS.zscore.weekly-47c5af84.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0d818764.js → HEAD CIRCUM_BOYS.zscore.yearly-9a1bc325.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-dddf5ad9.js → HEAD CIRCUM_GIRLS.percentile.monthly-d84491d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-a80d6989.js → HEAD CIRCUM_GIRLS.percentile.weekly-a6f38c3e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-01850b67.js → HEAD CIRCUM_GIRLS.percentile.yearly-5771d277.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-82890053.js → HEAD CIRCUM_GIRLS.zscore.monthly-e3633bcc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-069f8c8f.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b0ab1a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ae5ef237.js → HEAD CIRCUM_GIRLS.zscore.yearly-20f29cf1.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-d0da1664.js → HEIGHT_BOYS.percentile.monthly-57cc12ee.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-55446b8a.js → HEIGHT_BOYS.percentile.weekly-c788506a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-f2f5b19f.js → HEIGHT_BOYS.percentile.yearly-ac56c1f2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-e6ed98ef.js → HEIGHT_BOYS.zscore.monthly-1bb78253.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-d0d37479.js → HEIGHT_BOYS.zscore.weekly-22737c43.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-4023b808.js → HEIGHT_BOYS.zscore.yearly-90f6cd0a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-6d9aeadc.js → HEIGHT_GIRLS.percentile.monthly-019f80d2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-2087c9b4.js → HEIGHT_GIRLS.percentile.weekly-ceed9817.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-f98d8b05.js → HEIGHT_GIRLS.percentile.yearly-3e5192ac.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-99d299e3.js → HEIGHT_GIRLS.zscore.monthly-f8fca0b6.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-c46ed349.js → HEIGHT_GIRLS.zscore.weekly-827b17e8.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-fddefca4.js → HEIGHT_GIRLS.zscore.yearly-3cdb483d.js} +0 -0
- /package/build/{Visible-01dfaec9.js → Visible-515a4eec.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-cead8ece.js → WEIGHT_BOYS.percentile.monthly-2ecbd498.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-a97fa31a.js → WEIGHT_BOYS.percentile.weekly-75c9c25c.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-c2c41945.js → WEIGHT_BOYS.percentile.yearly-03e7cea6.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-d8de7dc2.js → WEIGHT_BOYS.zscore.monthly-2ff9fb56.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-41a6f6bf.js → WEIGHT_BOYS.zscore.weekly-e9f7fe2d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-5762fa8a.js → WEIGHT_BOYS.zscore.yearly-4a96f34f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-526fb18a.js → WEIGHT_GIRLS.percentile.monthly-5bf09e30.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-6c63ed2b.js → WEIGHT_GIRLS.percentile.weekly-f737ae23.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-0ecdbd3a.js → WEIGHT_GIRLS.percentile.yearly-56ebc8eb.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-0c353536.js → WEIGHT_GIRLS.zscore.monthly-4697d3b5.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-97898ff6.js → WEIGHT_GIRLS.zscore.weekly-3633820e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-cbebe807.js → WEIGHT_GIRLS.zscore.yearly-a9a04790.js} +0 -0
- /package/build/{animation-8605b5bb.js → animation-85d012ee.js} +0 -0
- /package/build/{cart-ab5762b8.js → cart-8877bd63.js} +0 -0
- /package/build/{cookieHelper-b2132ffc.js → cookieHelper-86ae022e.js} +0 -0
- /package/build/{doctor-f121fd79.js → doctor-2c14fed1.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-e507536d.js → BMI_BOYS.percentile.monthly-42ff2c64.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-3cbf7392.js → BMI_BOYS.percentile.weekly-b4a6c521.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-c7d54bc3.js → BMI_BOYS.percentile.yearly-d3bc1a77.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-4d09aca0.js → BMI_BOYS.zscore.monthly-c4506dfa.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-319b78c5.js → BMI_BOYS.zscore.weekly-ddf3b3f9.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-764732c5.js → BMI_BOYS.zscore.yearly-e0e3139e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-5a8e4069.js → BMI_GIRLS.percentile.monthly-96686bcc.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-a2fe6df1.js → BMI_GIRLS.percentile.weekly-c3106a65.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-810fe911.js → BMI_GIRLS.percentile.yearly-b38c1f1f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-afab03b0.js → BMI_GIRLS.zscore.monthly-f8a7836f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-8f4e7198.js → BMI_GIRLS.zscore.weekly-4c1fc771.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-7f043621.js → BMI_GIRLS.zscore.yearly-dce5e66a.js} +0 -0
- /package/build/esm/{ChevronDown-d24fd24b.js → ChevronDown-31ea3e19.js} +0 -0
- /package/build/esm/{Close-6243d246.js → Close-40d598bc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-91c12176.js → HEAD CIRCUM_BOYS.percentile.monthly-34e3fa1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-40e77c68.js → HEAD CIRCUM_BOYS.percentile.weekly-d3f3568f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-1a284ec4.js → HEAD CIRCUM_BOYS.percentile.yearly-dfae3ad2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-16f716a6.js → HEAD CIRCUM_BOYS.zscore.monthly-95840c2f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-07d20112.js → HEAD CIRCUM_BOYS.zscore.weekly-8b198c1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-1201a10a.js → HEAD CIRCUM_BOYS.zscore.yearly-b7d639ad.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-a6348baf.js → HEAD CIRCUM_GIRLS.percentile.monthly-47caa070.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-af26363f.js → HEAD CIRCUM_GIRLS.percentile.weekly-bae46665.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-e7637928.js → HEAD CIRCUM_GIRLS.percentile.yearly-81989cdd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9be0e0ca.js → HEAD CIRCUM_GIRLS.zscore.monthly-f2f7d985.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-3ffe9dcd.js → HEAD CIRCUM_GIRLS.zscore.weekly-e287ddb7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-d7226db1.js → HEAD CIRCUM_GIRLS.zscore.yearly-8790b62a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-c2e21892.js → HEIGHT_BOYS.percentile.monthly-5d2b6466.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-22018f1e.js → HEIGHT_BOYS.percentile.weekly-a38ad13e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-391cd377.js → HEIGHT_BOYS.percentile.yearly-e4841712.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-e11f50f4.js → HEIGHT_BOYS.zscore.monthly-d8e722f8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-8e2c8306.js → HEIGHT_BOYS.zscore.weekly-a92ea3ca.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-78e974bb.js → HEIGHT_BOYS.zscore.yearly-3af1adce.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-0a49ff89.js → HEIGHT_GIRLS.percentile.monthly-c5203801.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-5e158a8e.js → HEIGHT_GIRLS.percentile.weekly-4c25d07f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f5544ab2.js → HEIGHT_GIRLS.percentile.yearly-f91e2e27.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-92f67ec2.js → HEIGHT_GIRLS.zscore.monthly-b2a60aca.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f5d11f32.js → HEIGHT_GIRLS.zscore.weekly-0a98c520.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-4fe6aad9.js → HEIGHT_GIRLS.zscore.yearly-8070d58f.js} +0 -0
- /package/build/esm/{Visible-7f408f98.js → Visible-e3e4fb6f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b09ae73a.js → WEIGHT_BOYS.percentile.monthly-b262b97d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-733a24a9.js → WEIGHT_BOYS.percentile.weekly-7e817f9f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-2bfcfc93.js → WEIGHT_BOYS.percentile.yearly-b7f1786a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c0d3a746.js → WEIGHT_BOYS.zscore.monthly-014af835.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b41ff498.js → WEIGHT_BOYS.zscore.weekly-4577f724.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-15bb7570.js → WEIGHT_BOYS.zscore.yearly-08fd3f13.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-5b79dea8.js → WEIGHT_GIRLS.percentile.monthly-a6e1aa0d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-33052637.js → WEIGHT_GIRLS.percentile.weekly-4c0b6f94.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-64382b53.js → WEIGHT_GIRLS.percentile.yearly-bf689a3a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-63f19584.js → WEIGHT_GIRLS.zscore.monthly-f82fc3c8.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-938ebce2.js → WEIGHT_GIRLS.zscore.weekly-854ce987.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-016e1cfc.js → WEIGHT_GIRLS.zscore.yearly-2a3b869a.js} +0 -0
- /package/build/esm/{animation-bf170ee9.js → animation-85d9a0ed.js} +0 -0
- /package/build/esm/{cart-5bdb4fa5.js → cart-1ac23ce7.js} +0 -0
- /package/build/esm/{cookieHelper-ff6c13b4.js → cookieHelper-6c3b4790.js} +0 -0
- /package/build/esm/{doctor-f4cadffb.js → doctor-e0c2476d.js} +0 -0
- /package/build/esm/{index-eeedf0f0.js → index-189d7601.js} +0 -0
- /package/build/esm/{index-b87433a0.js → index-21bca818.js} +0 -0
- /package/build/esm/{index-6c0f560b.js → index-266a32ff.js} +0 -0
- /package/build/esm/{index-528e64f4.js → index-8684181f.js} +0 -0
- /package/build/esm/{isProduction-2838b9ae.js → isProduction-1937d355.js} +0 -0
- /package/build/esm/{localizeNumberFormat-9303c122.js → localizeNumberFormat-1f000110.js} +0 -0
- /package/build/esm/{normalizeLink-38ab69f4.js → normalizeLink-7a93ebb9.js} +0 -0
- /package/build/esm/{number-fcae69c7.js → number-1d1ba14a.js} +0 -0
- /package/build/esm/{paths-d1c61fa8.js → paths-b83be1a0.js} +0 -0
- /package/build/esm/{theme-0af1cc3d.js → theme-7dadf4a1.js} +0 -0
- /package/build/esm/{translationsContext-036458b7.js → translationsContext-42a1fa63.js} +0 -0
- /package/build/esm/{tslib.es6-2673b49d.js → tslib.es6-06ba3978.js} +0 -0
- /package/build/esm/{useIsInit-2c5ff93d.js → useIsInit-f4dec279.js} +0 -0
- /package/build/esm/{useOutsideClick-7023de23.js → useOutsideClick-210c1134.js} +0 -0
- /package/build/esm/{useScrollbarSize-dfdab229.js → useScrollbarSize-909ae7ec.js} +0 -0
- /package/build/esm/{useUniqueId-d4b0bdd3.js → useUniqueId-5885911d.js} +0 -0
- /package/build/esm/{utils-511a24f4.js → utils-d7bbdb52.js} +0 -0
- /package/build/{index-18ddaa1b.js → index-1f3fc2e3.js} +0 -0
- /package/build/{index-5c400e5e.js → index-2de1eb4a.js} +0 -0
- /package/build/{index-bced434a.js → index-6fdcd09d.js} +0 -0
- /package/build/{index-c524c362.js → index-bc9e8eae.js} +0 -0
- /package/build/{isProduction-2e55aee3.js → isProduction-20cd663d.js} +0 -0
- /package/build/{localizeNumberFormat-2befc6e4.js → localizeNumberFormat-7ff6bd3a.js} +0 -0
- /package/build/{normalizeLink-0fd36e61.js → normalizeLink-d307f624.js} +0 -0
- /package/build/{number-92da0262.js → number-dddf656c.js} +0 -0
- /package/build/{paths-350514c4.js → paths-7da79c64.js} +0 -0
- /package/build/{theme-f410baf6.js → theme-be20929b.js} +0 -0
- /package/build/{translationsContext-11cafcfc.js → translationsContext-00fdb62e.js} +0 -0
- /package/build/{tslib.es6-4bc45883.js → tslib.es6-bd3f8718.js} +0 -0
- /package/build/{useIsInit-0f6d1879.js → useIsInit-e06b96f5.js} +0 -0
- /package/build/{useOutsideClick-e067cc79.js → useOutsideClick-d95a32b6.js} +0 -0
- /package/build/{useScrollbarSize-ed50b4a6.js → useScrollbarSize-1499b1c3.js} +0 -0
- /package/build/{useUniqueId-4ce69bff.js → useUniqueId-1af8848e.js} +0 -0
- /package/build/{utils-4849d92a.js → utils-15a9772e.js} +0 -0
|
@@ -0,0 +1,1362 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-bd3f8718.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var index$5 = require('./index-f222ee45.js');
|
|
6
|
+
var index$2 = require('./index-54aeefca.js');
|
|
7
|
+
var useTranslations = require('./useTranslations-685f989b.js');
|
|
8
|
+
var innertext = require('innertext');
|
|
9
|
+
var index = require('./index-2afbeb3d.js');
|
|
10
|
+
var index$1 = require('./index-64d8db08.js');
|
|
11
|
+
var constants = require('./constants-a78fa8b3.js');
|
|
12
|
+
var togetherComponentGlobalContext = require('./utils-169c6a7d.js');
|
|
13
|
+
var useTogetherAuthRequiredAction = require('./useTogetherAuthRequiredAction.js');
|
|
14
|
+
var treePopoverMenu = require('./treePopoverMenu-c0cb395f.js');
|
|
15
|
+
var styled = require('@emotion/styled');
|
|
16
|
+
var utils = require('./utils-15a9772e.js');
|
|
17
|
+
var theme = require('./theme-be20929b.js');
|
|
18
|
+
var dataTransform = require('./dataTransform-e39297c1.js');
|
|
19
|
+
var index$7 = require('./index-4cdcdbbe.js');
|
|
20
|
+
var index$6 = require('./index-9e8877c0.js');
|
|
21
|
+
var index$8 = require('./index-e3bbd009.js');
|
|
22
|
+
var core$1 = require('@hhgtech/icons/core');
|
|
23
|
+
var other = require('@hhgtech/icons/other');
|
|
24
|
+
var core = require('@mantine/core');
|
|
25
|
+
var index$4 = require('./index-7953fb8e.js');
|
|
26
|
+
var index$3 = require('./index-1fdf2f01.js');
|
|
27
|
+
var routing = require('./routing-d6c9099a.js');
|
|
28
|
+
|
|
29
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
30
|
+
|
|
31
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
32
|
+
var innertext__default = /*#__PURE__*/_interopDefault(innertext);
|
|
33
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
34
|
+
|
|
35
|
+
var img$8 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e";
|
|
36
|
+
var MBMoreSolid = img$8;
|
|
37
|
+
|
|
38
|
+
var img$7 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";
|
|
39
|
+
var IconBookmarkFill = img$7;
|
|
40
|
+
|
|
41
|
+
var img$6 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";
|
|
42
|
+
var IconBookmark = img$6;
|
|
43
|
+
|
|
44
|
+
var img$5 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e";
|
|
45
|
+
var IconKebab = img$5;
|
|
46
|
+
|
|
47
|
+
var img$4 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 5.333a2 2 0 1 0 0-4 2 2 0 0 0 0 4M4 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4M12 14.667a2 2 0 1 0 0-4 2 2 0 0 0 0 4M5.727 9.007l4.553 2.653M10.273 4.34 5.727 6.993'/%3e%3c/svg%3e";
|
|
48
|
+
var IconShareOnMedia = img$4;
|
|
49
|
+
|
|
50
|
+
var img$3 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e";
|
|
51
|
+
var IconTabEdit = img$3;
|
|
52
|
+
|
|
53
|
+
var img$2 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";
|
|
54
|
+
var IconTrashBin = img$2;
|
|
55
|
+
|
|
56
|
+
// import IconBellOff from '../../../assets/svg/icon-bell-off.svg'
|
|
57
|
+
// import IconBellOn from '../../../assets/svg/icon-bell-on.svg'
|
|
58
|
+
const CardPostPopoverMore = ({ authorEmail, onDeletePost, shareUrl, post, className = '', popoverClassName = '', onBookmark, onRemoveBookmark, onEditPost, }) => {
|
|
59
|
+
const { data: { locale, userInfo, togetherUserId, env: { isMarryBaby }, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
60
|
+
const { t } = useTranslations.useTranslations();
|
|
61
|
+
// const [localHasNoti, setLocalHasNoti] = useState(false)
|
|
62
|
+
const [loading, setLoading] = React.useState(false);
|
|
63
|
+
const [isOpenLeavePopup, setIsOpenLeavePopup] = React.useState(false);
|
|
64
|
+
const [isOpenSharePopup, setIsOpenSharePopup] = React.useState(false);
|
|
65
|
+
const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction();
|
|
66
|
+
const isAuthor = authorEmail && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && authorEmail === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
|
|
67
|
+
return (React__default["default"].createElement("div", { className: className, onClick: (e) => {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
} },
|
|
71
|
+
isOpenSharePopup && (React__default["default"].createElement(index.SharePopup, { url: shareUrl, text: post === null || post === void 0 ? void 0 : post.title, onClose: () => setIsOpenSharePopup(false) })),
|
|
72
|
+
isOpenLeavePopup && (React__default["default"].createElement(index.PopupDanger, { thumbnail: index$1.CommonGAssets.getAssetPath('trash-bin.svg'), isThumbnailIcon: true, title: t('popup.deletePost.title'), description: t('popup.deletePost.description'), acceptText: t('popup.deletePost.accept'), cancelText: t('popup.deletePost.cancel'), onAccept: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
+
if (!(post === null || post === void 0 ? void 0 : post.id) || loading)
|
|
74
|
+
return;
|
|
75
|
+
setLoading(true);
|
|
76
|
+
try {
|
|
77
|
+
const res = yield index.deletePost({
|
|
78
|
+
id: post.id,
|
|
79
|
+
locale,
|
|
80
|
+
});
|
|
81
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 1)
|
|
82
|
+
onDeletePost === null || onDeletePost === void 0 ? void 0 : onDeletePost();
|
|
83
|
+
}
|
|
84
|
+
catch (_a) { }
|
|
85
|
+
setLoading(false);
|
|
86
|
+
}), onClose: () => setIsOpenLeavePopup(false) })),
|
|
87
|
+
React__default["default"].createElement(treePopoverMenu.TreePopoverMenu, { className: popoverClassName, toggleButtonContent: React__default["default"].createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), position: "bottom", align: "end", buttonProps: {
|
|
88
|
+
isLoading: loading,
|
|
89
|
+
}, data: isAuthor
|
|
90
|
+
? {
|
|
91
|
+
isShowheader: false,
|
|
92
|
+
type: 'list',
|
|
93
|
+
list: [
|
|
94
|
+
{
|
|
95
|
+
icon: IconShareOnMedia,
|
|
96
|
+
label: t('morePopover.share'),
|
|
97
|
+
onClick: () => setIsOpenSharePopup(true),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
icon: IconTabEdit,
|
|
101
|
+
label: t('actionPopover.edit'),
|
|
102
|
+
onClick: onEditPost,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
icon: IconTrashBin,
|
|
106
|
+
label: t('actionPopover.delete'),
|
|
107
|
+
onClick: () => {
|
|
108
|
+
authActionWrapper(() => setIsOpenLeavePopup(true));
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
}
|
|
113
|
+
: {
|
|
114
|
+
isShowheader: false,
|
|
115
|
+
type: 'list',
|
|
116
|
+
list: [
|
|
117
|
+
{
|
|
118
|
+
icon: IconShareOnMedia,
|
|
119
|
+
label: t('morePopover.share'),
|
|
120
|
+
onClick: () => setIsOpenSharePopup(true),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
icon: !!(post === null || post === void 0 ? void 0 : post.bookmarked) ? IconBookmarkFill : IconBookmark,
|
|
124
|
+
label: !!(post === null || post === void 0 ? void 0 : post.bookmarked)
|
|
125
|
+
? t('morePopover.unsavePost')
|
|
126
|
+
: t('morePopover.savePost'),
|
|
127
|
+
onClick: () => {
|
|
128
|
+
authActionWrapper(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
129
|
+
if (!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || !(post === null || post === void 0 ? void 0 : post.id))
|
|
130
|
+
return;
|
|
131
|
+
if (post === null || post === void 0 ? void 0 : post.bookmarked) {
|
|
132
|
+
const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.BOOKMARK.DELETE, {
|
|
133
|
+
_locale: locale,
|
|
134
|
+
}), 'DELETE', {
|
|
135
|
+
data: {
|
|
136
|
+
post_id: String(post.id),
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
|
|
140
|
+
pushNotifications({
|
|
141
|
+
title: '',
|
|
142
|
+
message: 'Removed saved post',
|
|
143
|
+
type: 'success',
|
|
144
|
+
displayIcon: IconBookmark,
|
|
145
|
+
});
|
|
146
|
+
onRemoveBookmark && onRemoveBookmark();
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
pushNotifications({
|
|
150
|
+
title: '',
|
|
151
|
+
message: 'Remove failed',
|
|
152
|
+
type: 'danger',
|
|
153
|
+
displayIcon: IconBookmark,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.BOOKMARK.CREATE, {
|
|
159
|
+
_locale: locale,
|
|
160
|
+
}), 'POST', {
|
|
161
|
+
data: {
|
|
162
|
+
user_id: togetherUserId || userInfo.id,
|
|
163
|
+
post_id: post.id,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
|
|
167
|
+
pushNotifications({
|
|
168
|
+
title: '',
|
|
169
|
+
message: 'Post saved',
|
|
170
|
+
type: 'success',
|
|
171
|
+
displayIcon: IconBookmarkFill,
|
|
172
|
+
});
|
|
173
|
+
onBookmark && onBookmark();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
pushNotifications({
|
|
177
|
+
title: '',
|
|
178
|
+
message: 'Post saved failed',
|
|
179
|
+
type: 'danger',
|
|
180
|
+
displayIcon: IconBookmark,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
// {
|
|
188
|
+
// icon: togetherBasePath + '/svg/icon-bell-on.svg',
|
|
189
|
+
// label: !localHasNoti
|
|
190
|
+
// ? t( 'morePopover.turnOnNotifications' })
|
|
191
|
+
// : t( 'morePopover.turnOffNotifications' }),
|
|
192
|
+
// onClick: () => {
|
|
193
|
+
// authActionWrapper(async () => {
|
|
194
|
+
// if (!post?.id || loading) return
|
|
195
|
+
// setLoading(true)
|
|
196
|
+
// try {
|
|
197
|
+
// const res = await followUnfollowPost({
|
|
198
|
+
// id: post?.id,
|
|
199
|
+
// locale,
|
|
200
|
+
// })
|
|
201
|
+
// if (res?.status === 1) {
|
|
202
|
+
// pushNotifications({
|
|
203
|
+
// message: !localHasNoti
|
|
204
|
+
// ? 'Notification on'
|
|
205
|
+
// : 'Notification off',
|
|
206
|
+
// type: !localHasNoti ? 'success' : 'danger',
|
|
207
|
+
// displayIcon: !localHasNoti ? IconBellOn : IconBellOff,
|
|
208
|
+
// })
|
|
209
|
+
// setLocalHasNoti((v) => !v)
|
|
210
|
+
// }
|
|
211
|
+
// } catch {}
|
|
212
|
+
// setLoading(false)
|
|
213
|
+
// })
|
|
214
|
+
// },
|
|
215
|
+
// },
|
|
216
|
+
{
|
|
217
|
+
icon: index.IconAlertCircle,
|
|
218
|
+
label: t('morePopover.report'),
|
|
219
|
+
subTree: {
|
|
220
|
+
title: t('morePopover.report.title'),
|
|
221
|
+
description: t('morePopover.report.description'),
|
|
222
|
+
isShowheader: true,
|
|
223
|
+
type: 'list',
|
|
224
|
+
list: Object.keys(constants.REPORT_REASON_MAP)
|
|
225
|
+
.map((k) => ({
|
|
226
|
+
label: constants.REPORT_REASON_MAP[k].label,
|
|
227
|
+
reason: constants.REPORT_REASON_MAP[k].reportReasonText,
|
|
228
|
+
reasonValue: k,
|
|
229
|
+
}))
|
|
230
|
+
.map((item) => ({
|
|
231
|
+
label: t(item.label),
|
|
232
|
+
subTree: {
|
|
233
|
+
title: t('morePopover.reportSubmit.title'),
|
|
234
|
+
description: t('morePopover.reportSubmit.description'),
|
|
235
|
+
isShowheader: true,
|
|
236
|
+
type: 'jsx',
|
|
237
|
+
jsxRenderer: (setShow) => (React__default["default"].createElement(index.SubmitReportForm, { reason: item.reasonValue, reasonText: t(item.reason), postId: post === null || post === void 0 ? void 0 : post.id, onClose: () => setShow && setShow(false) })),
|
|
238
|
+
},
|
|
239
|
+
})),
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
} })));
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const StyledCardPost$1 = styled__default["default"].div `
|
|
247
|
+
position: relative;
|
|
248
|
+
margin-bottom: 24px;
|
|
249
|
+
background: white;
|
|
250
|
+
border-radius: ${theme.theme.borderRadius};
|
|
251
|
+
|
|
252
|
+
a {
|
|
253
|
+
text-decoration: none;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
${utils.MediaQueries.mbDown} {
|
|
257
|
+
margin-bottom: 8px;
|
|
258
|
+
}
|
|
259
|
+
&.flat-top {
|
|
260
|
+
border-top-left-radius: 0;
|
|
261
|
+
border-top-right-radius: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.post-pin {
|
|
265
|
+
padding: 0.5rem 1rem;
|
|
266
|
+
border-radius: ${theme.theme.borderRadius} 6px 0 0;
|
|
267
|
+
}
|
|
268
|
+
.post-author {
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: space-between;
|
|
272
|
+
&.comment {
|
|
273
|
+
padding-right: 2.6rem;
|
|
274
|
+
}
|
|
275
|
+
.author-avatar-wrapper {
|
|
276
|
+
width: 40px;
|
|
277
|
+
height: 40px;
|
|
278
|
+
font-size: 20px;
|
|
279
|
+
${utils.MediaQueries.mbDown} {
|
|
280
|
+
width: 32px;
|
|
281
|
+
height: 32px;
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
.post-content-link-wrapper {
|
|
287
|
+
color: inherit;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
.post-content-title {
|
|
290
|
+
padding: 1rem 1rem 0;
|
|
291
|
+
word-break: break-word;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
.social-preview-wrapper.has-image {
|
|
295
|
+
margin-bottom: 5px;
|
|
296
|
+
}
|
|
297
|
+
.social-preview-wrapper,
|
|
298
|
+
.image-preview-wrapper,
|
|
299
|
+
.link-preview-wrapper {
|
|
300
|
+
width: 100%;
|
|
301
|
+
&[data-is-reply='true'] {
|
|
302
|
+
padding-right: 1rem;
|
|
303
|
+
padding-left: 1rem;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
.post-topics {
|
|
307
|
+
padding: 0 1rem;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.post-reaction {
|
|
311
|
+
background: none;
|
|
312
|
+
border-radius: 0 0 6px 6px;
|
|
313
|
+
&.hide-top-border {
|
|
314
|
+
::before {
|
|
315
|
+
display: none;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
.most-engaging-wrapper {
|
|
320
|
+
padding: 1rem;
|
|
321
|
+
cursor: pointer;
|
|
322
|
+
.author-avatar-wrapper {
|
|
323
|
+
width: 2rem;
|
|
324
|
+
height: 2rem;
|
|
325
|
+
font-size: 1rem;
|
|
326
|
+
}
|
|
327
|
+
.see-more-comments {
|
|
328
|
+
width: 100%;
|
|
329
|
+
padding: 12px 0 0;
|
|
330
|
+
text-align: unset;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
&[data-most-engaging='true'] {
|
|
334
|
+
border: none;
|
|
335
|
+
${utils.MediaQueries.mbDown} {
|
|
336
|
+
margin: 1rem;
|
|
337
|
+
border: 1px solid #e4e8ec;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
.top-divider {
|
|
341
|
+
border-color: #e4e8ec;
|
|
342
|
+
}
|
|
343
|
+
.popover {
|
|
344
|
+
.popover-menu__btn {
|
|
345
|
+
display: flex;
|
|
346
|
+
width: 1.5rem;
|
|
347
|
+
height: 1rem;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
padding: 0;
|
|
351
|
+
background: transparent;
|
|
352
|
+
|
|
353
|
+
&:hover {
|
|
354
|
+
background-color: transparent;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
.popover-menu__content {
|
|
358
|
+
&.--position-bottom {
|
|
359
|
+
&.--align-end {
|
|
360
|
+
&::before {
|
|
361
|
+
right: 12.5px;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
&[data-is-marrybaby='true'] {
|
|
369
|
+
border: 1px solid #f3f3f3;
|
|
370
|
+
border-radius: 1rem;
|
|
371
|
+
/* shadow */
|
|
372
|
+
|
|
373
|
+
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08);
|
|
374
|
+
.image-preview-wrapper,
|
|
375
|
+
.link-preview-wrapper {
|
|
376
|
+
padding-right: 1rem;
|
|
377
|
+
padding-left: 1rem;
|
|
378
|
+
}
|
|
379
|
+
.popover {
|
|
380
|
+
.popover-menu__btn {
|
|
381
|
+
width: 24px;
|
|
382
|
+
height: 24px;
|
|
383
|
+
${utils.MediaQueries.mbDown} {
|
|
384
|
+
width: 18px;
|
|
385
|
+
height: 18px;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
.popover-menu__content {
|
|
389
|
+
&.--position-bottom {
|
|
390
|
+
&.--align-end {
|
|
391
|
+
&::before {
|
|
392
|
+
right: 1rem;
|
|
393
|
+
}
|
|
394
|
+
width: 350px;
|
|
395
|
+
${utils.MediaQueries.mbDown} {
|
|
396
|
+
max-width: calc(320px - 2rem);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
.most-engaging-wrapper {
|
|
403
|
+
position: relative;
|
|
404
|
+
padding: 0;
|
|
405
|
+
&::before {
|
|
406
|
+
position: absolute;
|
|
407
|
+
z-index: 5;
|
|
408
|
+
top: 0;
|
|
409
|
+
left: 50%;
|
|
410
|
+
width: calc(100% - 2rem);
|
|
411
|
+
height: 1px;
|
|
412
|
+
background: #f3f3f3;
|
|
413
|
+
content: ' ';
|
|
414
|
+
transform: translateX(-50%);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
${utils.MediaQueries.mbDown} {
|
|
418
|
+
margin-bottom: 12px;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
`;
|
|
422
|
+
|
|
423
|
+
var img$1 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
424
|
+
var IconDelete = img$1;
|
|
425
|
+
|
|
426
|
+
const CardReplyPopover = ({ onDeleteComment, commentId, className = '', popoverClassName = '', }) => {
|
|
427
|
+
const { data: { env: { isMarryBaby }, locale, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
428
|
+
const { t } = useTranslations.useTranslations();
|
|
429
|
+
const [isOpenLeavePopup, setIsOpenLeavePopup] = React.useState(false);
|
|
430
|
+
const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction();
|
|
431
|
+
return (React__default["default"].createElement("div", { className: className, onClick: (e) => {
|
|
432
|
+
e.preventDefault();
|
|
433
|
+
e.stopPropagation();
|
|
434
|
+
} },
|
|
435
|
+
isOpenLeavePopup && (React__default["default"].createElement(index.PopupDanger, { thumbnail: IconDelete, isThumbnailIcon: true, title: t('popup.deleteComment.title'), description: t('popup.deleteComment.description'), acceptText: t('popup.deletePost.accept'), cancelText: t('popup.deletePost.cancel'), onAccept: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
436
|
+
var _a;
|
|
437
|
+
if (!commentId)
|
|
438
|
+
return;
|
|
439
|
+
const res = yield index.deleteComment({ id: commentId, locale });
|
|
440
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
|
|
441
|
+
onDeleteComment && onDeleteComment();
|
|
442
|
+
pushNotifications({
|
|
443
|
+
title: '',
|
|
444
|
+
message: t('notification.success'),
|
|
445
|
+
type: 'success',
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
pushNotifications({
|
|
450
|
+
title: '',
|
|
451
|
+
message: ((_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a[0]) || t('notification.failure'),
|
|
452
|
+
type: 'danger',
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}), onClose: () => setIsOpenLeavePopup(false) })),
|
|
456
|
+
React__default["default"].createElement(treePopoverMenu.TreePopoverMenu, { position: "bottom", align: "end", data: {
|
|
457
|
+
isShowheader: false,
|
|
458
|
+
type: 'list',
|
|
459
|
+
list: [
|
|
460
|
+
// {
|
|
461
|
+
// icon: _href('/svg/icon-share-on-media.svg'),
|
|
462
|
+
// label: f({ id: 'morePopover.share' }),
|
|
463
|
+
// subTree: {
|
|
464
|
+
// title: f({ id: 'morePopover.shareOn' }),
|
|
465
|
+
// isShowheader: true,
|
|
466
|
+
// type: 'jsx',
|
|
467
|
+
// jsxType: TreeJSXType.share,
|
|
468
|
+
// data: {
|
|
469
|
+
// shareUrl: shareUrl,
|
|
470
|
+
// shareTitle: shareTitle,
|
|
471
|
+
// },
|
|
472
|
+
// },
|
|
473
|
+
// },
|
|
474
|
+
// {
|
|
475
|
+
// icon: _href('/svg/icon-tab-edit-2.svg'),
|
|
476
|
+
// label: f({ id: 'actionPopover.edit' }),
|
|
477
|
+
// onClick: onEditPost,
|
|
478
|
+
// },
|
|
479
|
+
{
|
|
480
|
+
icon: IconTrashBin,
|
|
481
|
+
label: t('actionPopover.delete'),
|
|
482
|
+
onClick: () => {
|
|
483
|
+
authActionWrapper(() => {
|
|
484
|
+
setIsOpenLeavePopup(true);
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
],
|
|
489
|
+
}, className: popoverClassName, toggleButtonContent: React__default["default"].createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), buttonProps: {
|
|
490
|
+
// isLoading: loading,
|
|
491
|
+
} })));
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
const StyledContainer$1 = styled__default["default"].div `
|
|
495
|
+
.add-link {
|
|
496
|
+
color: ${theme.theme.colors.primaryBase};
|
|
497
|
+
}
|
|
498
|
+
`;
|
|
499
|
+
const StyledAlertTag = styled__default["default"].div `
|
|
500
|
+
margin: 16px 0;
|
|
501
|
+
background: ${theme.theme.colors.yellow50};
|
|
502
|
+
padding: 5px 10px;
|
|
503
|
+
border-radius: 2px;
|
|
504
|
+
|
|
505
|
+
.icon {
|
|
506
|
+
display: inline-block;
|
|
507
|
+
vertical-align: middle;
|
|
508
|
+
margin-right: 6px;
|
|
509
|
+
}
|
|
510
|
+
`;
|
|
511
|
+
const StyledSourceItemWrapper = styled__default["default"].div `
|
|
512
|
+
display: flex;
|
|
513
|
+
align-items: center;
|
|
514
|
+
gap: 8px;
|
|
515
|
+
`;
|
|
516
|
+
const StyledListItems$1 = styled__default["default"].div `
|
|
517
|
+
padding: 8px 16px;
|
|
518
|
+
`;
|
|
519
|
+
const StyledInputWrapper = styled__default["default"].div `
|
|
520
|
+
margin-bottom: 12px;
|
|
521
|
+
width: 100%;
|
|
522
|
+
`;
|
|
523
|
+
|
|
524
|
+
const StyledContainer = styled__default["default"].div ``;
|
|
525
|
+
const StyledHeader = styled__default["default"].div `
|
|
526
|
+
margin-bottom: 16px;
|
|
527
|
+
`;
|
|
528
|
+
const StyledListItems = styled__default["default"].div `
|
|
529
|
+
display: flex;
|
|
530
|
+
flex-wrap: wrap;
|
|
531
|
+
row-gap: 16px;
|
|
532
|
+
${utils.MediaQueries.tdUp} {
|
|
533
|
+
align-items: center;
|
|
534
|
+
column-gap: 24px;
|
|
535
|
+
}
|
|
536
|
+
`;
|
|
537
|
+
const StyledItem$1 = styled__default["default"].a `
|
|
538
|
+
display: flex;
|
|
539
|
+
align-items: center;
|
|
540
|
+
gap: 16px;
|
|
541
|
+
${utils.MediaQueries.mbDown} {
|
|
542
|
+
width: 100%;
|
|
543
|
+
justify-content: space-between;
|
|
544
|
+
}
|
|
545
|
+
`;
|
|
546
|
+
const StyledItemInfo = styled__default["default"].div `
|
|
547
|
+
display: flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
gap: 16px;
|
|
550
|
+
`;
|
|
551
|
+
const StyledThumb = styled__default["default"].div `
|
|
552
|
+
border-radius: ${theme.theme.borderRadius};
|
|
553
|
+
overflow: hidden;
|
|
554
|
+
width: 48px;
|
|
555
|
+
height: 48px;
|
|
556
|
+
img {
|
|
557
|
+
object-fit: cover;
|
|
558
|
+
width: 100%;
|
|
559
|
+
height: 100%;
|
|
560
|
+
}
|
|
561
|
+
`;
|
|
562
|
+
|
|
563
|
+
const RecommentCategories = ({ categories }) => {
|
|
564
|
+
const { t } = useTranslations.useTranslations();
|
|
565
|
+
const { data: { locale, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
566
|
+
const url = routing.getCurrentBaseUrl(locale, isMarryBaby);
|
|
567
|
+
return (React__default["default"].createElement(StyledContainer, null,
|
|
568
|
+
React__default["default"].createElement(StyledHeader, null,
|
|
569
|
+
React__default["default"].createElement(index$2.Heading, { tag: "h6", as: "h5" }, t('cardReply.recommentCategories.heading'))),
|
|
570
|
+
React__default["default"].createElement(StyledListItems, null, categories.map((i) => (React__default["default"].createElement(StyledItem$1, { href: url + i.permalink, key: String(i.termId), target: "_blank" },
|
|
571
|
+
React__default["default"].createElement(StyledItemInfo, null,
|
|
572
|
+
React__default["default"].createElement(StyledThumb, null,
|
|
573
|
+
React__default["default"].createElement("img", { src: i.featureImage ||
|
|
574
|
+
index$1.CommonGAssets.getAssetPath(isMarryBaby ? 'mb-logo.svg' : '/logo/logomark.png'), alt: i.displayName, loading: "lazy" })),
|
|
575
|
+
React__default["default"].createElement(index$3.Text, { size: "s3", weight: "bold" }, i.displayName)),
|
|
576
|
+
React__default["default"].createElement(other.ArrowRight, { size: 20, color: theme.theme.colors.gray400 })))))));
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
const StyledItem = styled__default["default"].a `
|
|
580
|
+
padding: 12px 0;
|
|
581
|
+
display: flex;
|
|
582
|
+
flex-direction: column;
|
|
583
|
+
gap: 8px;
|
|
584
|
+
border-top: 1px solid ${theme.theme.colors.neutral100};
|
|
585
|
+
text-decoration: none;
|
|
586
|
+
|
|
587
|
+
&:first-child {
|
|
588
|
+
border-top: 0;
|
|
589
|
+
}
|
|
590
|
+
`;
|
|
591
|
+
|
|
592
|
+
const SourceItem = ({ postTitle, articleReviewed, modifiedTime, href, }) => {
|
|
593
|
+
const { t } = useTranslations.useTranslations();
|
|
594
|
+
const getDetail = (() => {
|
|
595
|
+
const { expert, editor, is_author } = articleReviewed;
|
|
596
|
+
if (expert) {
|
|
597
|
+
const result = {
|
|
598
|
+
name: expert.display_name,
|
|
599
|
+
role: 'expert',
|
|
600
|
+
avatar: expert.avatar,
|
|
601
|
+
};
|
|
602
|
+
if (is_author) {
|
|
603
|
+
return Object.assign({ title: t('articleAuthor.title.written-by') }, result);
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
if (expert.role === 'expert') {
|
|
607
|
+
// Is Expert
|
|
608
|
+
return Object.assign({ title: t('articleAuthor.title.expert') }, result);
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
// Is medical
|
|
612
|
+
return Object.assign({ title: t('articleAuthor.title.medical') }, result);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
else if (editor) {
|
|
617
|
+
return {
|
|
618
|
+
title: t('articleAuthor.title.fact-check'),
|
|
619
|
+
name: editor.display_name,
|
|
620
|
+
avatar: editor.avatar,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
})();
|
|
624
|
+
return (React__default["default"].createElement(StyledItem, { href: href, title: postTitle, target: "_blank" },
|
|
625
|
+
React__default["default"].createElement(index$3.Text, { size: "s3", as: "h5", weight: "bold" }, postTitle),
|
|
626
|
+
React__default["default"].createElement("div", null,
|
|
627
|
+
React__default["default"].createElement(index.CardAuthor, { avatar: getDetail === null || getDetail === void 0 ? void 0 : getDetail.avatar, avatarProps: {
|
|
628
|
+
size: 32,
|
|
629
|
+
}, name: getDetail === null || getDetail === void 0 ? void 0 : getDetail.name, role: getDetail === null || getDetail === void 0 ? void 0 : getDetail.role, hideBackground: true },
|
|
630
|
+
React__default["default"].createElement(index.CardAuthor.SubTextRow, null,
|
|
631
|
+
React__default["default"].createElement(index.CardAuthor.SubText, null, getDetail === null || getDetail === void 0 ? void 0 :
|
|
632
|
+
getDetail.title,
|
|
633
|
+
' ',
|
|
634
|
+
React__default["default"].createElement("span", { style: { color: theme.theme.colors.gray800 } }, getDetail === null || getDetail === void 0 ? void 0 : getDetail.name)),
|
|
635
|
+
React__default["default"].createElement(index.CardAuthor.SubDivider, null),
|
|
636
|
+
React__default["default"].createElement(index.CardAuthor.SubText, null, modifiedTime))))));
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
var styles$1 = {"accordion":"CnNZq8D","header":"F4mmgSy","heading":"_8jLruY3","headingIcon":"FE8w-fe","panel":"Yd2a9Nj","chevron":"A7QrQ7A"};
|
|
640
|
+
|
|
641
|
+
const SourceList = (_a) => {
|
|
642
|
+
var { listUrl: listUrlInit, hideSourceList, categorySlug, editMode, collapseSource, onListChange, isMarryBaby } = _a, rest = tslib_es6.__rest(_a, ["listUrl", "hideSourceList", "categorySlug", "editMode", "collapseSource", "onListChange", "isMarryBaby"]);
|
|
643
|
+
const { t } = useTranslations.useTranslations();
|
|
644
|
+
const [listUrl, setListUrl] = React.useState(listUrlInit || []);
|
|
645
|
+
const [data, setData] = React.useState([]);
|
|
646
|
+
const [categories, setCategories] = React.useState([]);
|
|
647
|
+
const [loading, setLoading] = React.useState(false);
|
|
648
|
+
React.useEffect(() => {
|
|
649
|
+
!hideSourceList &&
|
|
650
|
+
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
651
|
+
setLoading(true);
|
|
652
|
+
const listPaths = listUrl.map((i) => {
|
|
653
|
+
const url = new URL(i);
|
|
654
|
+
const pathArr = String(url.pathname)
|
|
655
|
+
.split('/')
|
|
656
|
+
.filter((i) => i != '');
|
|
657
|
+
const origin = url.origin;
|
|
658
|
+
const isMarrySite = origin.search('marrybaby.vn') !== -1;
|
|
659
|
+
return {
|
|
660
|
+
isMarrySite,
|
|
661
|
+
path: pathArr[pathArr.length - 1],
|
|
662
|
+
href: i,
|
|
663
|
+
};
|
|
664
|
+
});
|
|
665
|
+
const listApi = [
|
|
666
|
+
...listPaths.map((i) => togetherComponentGlobalContext.callApi(i.isMarrySite
|
|
667
|
+
? togetherComponentGlobalContext.getMarryBabyApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
|
|
668
|
+
fullSlug: i.path,
|
|
669
|
+
}, true)
|
|
670
|
+
: togetherComponentGlobalContext.getDiscoverApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
|
|
671
|
+
fullSlug: i.path,
|
|
672
|
+
}, true), 'GET')),
|
|
673
|
+
];
|
|
674
|
+
const res = yield Promise.all(listApi);
|
|
675
|
+
setData(res
|
|
676
|
+
.map((i, index) => {
|
|
677
|
+
var _a, _b;
|
|
678
|
+
return ((_a = i === null || i === void 0 ? void 0 : i.data) === null || _a === void 0 ? void 0 : _a.post) && Object.assign(Object.assign({}, dataTransform.formatArticle((_b = i === null || i === void 0 ? void 0 : i.data) === null || _b === void 0 ? void 0 : _b.post)), { href: listPaths[index].href });
|
|
679
|
+
})
|
|
680
|
+
.filter(Boolean));
|
|
681
|
+
setLoading(false);
|
|
682
|
+
}))();
|
|
683
|
+
}, []);
|
|
684
|
+
React.useEffect(() => {
|
|
685
|
+
!hideSourceList &&
|
|
686
|
+
(data === null || data === void 0 ? void 0 : data.length) === 0 &&
|
|
687
|
+
categorySlug &&
|
|
688
|
+
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
689
|
+
var _a;
|
|
690
|
+
const res = yield togetherComponentGlobalContext.callApi(isMarryBaby
|
|
691
|
+
? togetherComponentGlobalContext.getMarryBabyApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
|
|
692
|
+
fullSlug: categorySlug,
|
|
693
|
+
}, true)
|
|
694
|
+
: togetherComponentGlobalContext.getDiscoverApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
|
|
695
|
+
fullSlug: categorySlug,
|
|
696
|
+
}, true), 'GET');
|
|
697
|
+
(res === null || res === void 0 ? void 0 : res.data) && setCategories([dataTransform.formatCategory((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.category)]);
|
|
698
|
+
}))();
|
|
699
|
+
}, [data]);
|
|
700
|
+
const handleRemoveItem = (idx) => {
|
|
701
|
+
setListUrl((old) => {
|
|
702
|
+
const tmp = [...old];
|
|
703
|
+
tmp.splice(idx, 1);
|
|
704
|
+
return tmp;
|
|
705
|
+
});
|
|
706
|
+
setData((old) => {
|
|
707
|
+
const tmp = [...old];
|
|
708
|
+
tmp.splice(idx, 1);
|
|
709
|
+
return tmp;
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
React.useEffect(() => {
|
|
713
|
+
onListChange === null || onListChange === void 0 ? void 0 : onListChange(listUrl);
|
|
714
|
+
}, [listUrl]);
|
|
715
|
+
return (React__default["default"].createElement("div", Object.assign({}, rest),
|
|
716
|
+
!editMode && (React__default["default"].createElement(StyledAlertTag, null,
|
|
717
|
+
React__default["default"].createElement("img", { className: "icon", src: index$1.CommonGAssets.getAssetPath('warning.svg'), alt: "warning", style: { marginBottom: '3px', width: '18px' }, loading: "lazy" }),
|
|
718
|
+
React__default["default"].createElement(index$3.Text, { size: "s3", as: "span", dangerouslySetInnerHTML: {
|
|
719
|
+
__html: t('cardReply.disclaimer'),
|
|
720
|
+
} }))),
|
|
721
|
+
!hideSourceList ? (loading ? (React__default["default"].createElement(index.Loading, null)) : data.length > 0 || editMode ? (React__default["default"].createElement(StyledContainer$1, null,
|
|
722
|
+
React__default["default"].createElement(core.Accordion, { defaultValue: !collapseSource && 'accordion', styles: {
|
|
723
|
+
control: {
|
|
724
|
+
borderRadius: 'inherit',
|
|
725
|
+
'&[aria-expanded="false"]': {
|
|
726
|
+
borderBottom: 0,
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
chevron: {
|
|
730
|
+
width: '32px',
|
|
731
|
+
height: '32px',
|
|
732
|
+
},
|
|
733
|
+
content: {
|
|
734
|
+
padding: 0,
|
|
735
|
+
borderBottom: 0,
|
|
736
|
+
borderTop: `1px solid ${theme.theme.colors.neutral100}`,
|
|
737
|
+
},
|
|
738
|
+
item: {
|
|
739
|
+
marginBottom: '16px',
|
|
740
|
+
borderTopLeftRadius: '8px',
|
|
741
|
+
borderTopRightRadius: '8px',
|
|
742
|
+
border: `1px solid ${theme.theme.colors.neutral100}`,
|
|
743
|
+
borderBottomLeftRadius: '8px',
|
|
744
|
+
borderBottomRightRadius: '8px',
|
|
745
|
+
'&[data-active]': {
|
|
746
|
+
borderBottomLeftRadius: 0,
|
|
747
|
+
borderBottomRightRadius: 0,
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
}, chevron: React__default["default"].createElement("div", { className: styles$1.chevron },
|
|
751
|
+
React__default["default"].createElement(other.ArrowDown, { color: theme.theme.colors.gray600, size: 20 })) },
|
|
752
|
+
React__default["default"].createElement(core.Accordion.Item, { value: "accordion" },
|
|
753
|
+
React__default["default"].createElement(core.Accordion.Control, null,
|
|
754
|
+
React__default["default"].createElement("div", { className: styles$1.header },
|
|
755
|
+
React__default["default"].createElement(index$2.Heading, { as: "h4", tag: "h6" }, t('cardReply.source')))),
|
|
756
|
+
React__default["default"].createElement(core.Accordion.Panel, null,
|
|
757
|
+
React__default["default"].createElement(StyledListItems$1, null,
|
|
758
|
+
(data || []).map((i, idx) => (React__default["default"].createElement(StyledSourceItemWrapper, { key: String(idx) },
|
|
759
|
+
typeof i === 'object' ? (React__default["default"].createElement(SourceItem, Object.assign({}, i))) : (React__default["default"].createElement(StyledInputWrapper, null,
|
|
760
|
+
React__default["default"].createElement(index$4.Input, { style: { width: '100%' }, name: "source-list", value: i || '', size: "sm", onChange: (v) => {
|
|
761
|
+
setListUrl((old) => {
|
|
762
|
+
const tmp = [...old];
|
|
763
|
+
tmp[idx] = v;
|
|
764
|
+
return tmp;
|
|
765
|
+
});
|
|
766
|
+
setData((old) => {
|
|
767
|
+
const tmp = [...old];
|
|
768
|
+
tmp[idx] = v;
|
|
769
|
+
return tmp;
|
|
770
|
+
});
|
|
771
|
+
} }))),
|
|
772
|
+
editMode && (React__default["default"].createElement(index$5.Button, { size: "md", color: "transparent", icon: React__default["default"].createElement(other.Trash, null), onClick: () => handleRemoveItem(idx) }))))),
|
|
773
|
+
editMode && (React__default["default"].createElement(index$5.Button, { className: "add-link", color: "transparent", size: "md", icon: React__default["default"].createElement(core$1.Plus, { color: theme.theme.colors.primaryBase, size: 18 }), onClick: () => {
|
|
774
|
+
setListUrl((old) => [...old, '']);
|
|
775
|
+
setData((old) => [...old, '']);
|
|
776
|
+
} }, "Add source")))))))) : (React__default["default"].createElement(RecommentCategories, { categories: categories }))) : null));
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
const StyledCardPost = styled__default["default"].div `
|
|
780
|
+
position: relative;
|
|
781
|
+
margin-bottom: 0;
|
|
782
|
+
background: white;
|
|
783
|
+
border-radius: ${theme.theme.borderRadius};
|
|
784
|
+
|
|
785
|
+
.verify-tag {
|
|
786
|
+
margin-top: 12px;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.post-author {
|
|
790
|
+
&.with-popover {
|
|
791
|
+
padding-right: 2.6rem;
|
|
792
|
+
}
|
|
793
|
+
.author-avatar-wrapper {
|
|
794
|
+
width: 40px;
|
|
795
|
+
height: 40px;
|
|
796
|
+
font-size: 20px;
|
|
797
|
+
${utils.MediaQueries.mbDown} {
|
|
798
|
+
width: 32px;
|
|
799
|
+
height: 32px;
|
|
800
|
+
font-size: 16px;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
.image-preview-wrapper,
|
|
805
|
+
.link-preview-wrapper {
|
|
806
|
+
width: 100%;
|
|
807
|
+
&[data-is-reply='true'] {
|
|
808
|
+
padding-right: 1rem;
|
|
809
|
+
padding-left: 1rem;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
.post-reaction {
|
|
813
|
+
background: none;
|
|
814
|
+
border-radius: 0 0 6px 6px;
|
|
815
|
+
}
|
|
816
|
+
&[data-is-reply='true'] {
|
|
817
|
+
> .post-author .author-avatar-wrapper {
|
|
818
|
+
width: 20px;
|
|
819
|
+
height: 20px;
|
|
820
|
+
font-size: 10px;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
&[data-is-reply='false'] {
|
|
824
|
+
border: 1px solid #e4e8ec;
|
|
825
|
+
}
|
|
826
|
+
.expert-wrapper {
|
|
827
|
+
width: 100%;
|
|
828
|
+
}
|
|
829
|
+
&[data-has-booking='true'] {
|
|
830
|
+
display: grid;
|
|
831
|
+
.post-author {
|
|
832
|
+
background-color: ${theme.theme.colors.primary50};
|
|
833
|
+
}
|
|
834
|
+
.btn-wrapper {
|
|
835
|
+
padding: 0 16px;
|
|
836
|
+
.btn-booking {
|
|
837
|
+
width: 100%;
|
|
838
|
+
margin: 12px 0;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.comment-reply-wrapper {
|
|
844
|
+
padding: 0 1rem;
|
|
845
|
+
.more-cmt {
|
|
846
|
+
.chevron-right {
|
|
847
|
+
height: 1rem;
|
|
848
|
+
width: 1rem;
|
|
849
|
+
vertical-align: middle;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
.top-divider {
|
|
854
|
+
border-color: #e4e8ec;
|
|
855
|
+
}
|
|
856
|
+
.popover {
|
|
857
|
+
position: absolute;
|
|
858
|
+
top: 1.5rem;
|
|
859
|
+
right: 1rem;
|
|
860
|
+
.popover-menu__btn {
|
|
861
|
+
display: flex;
|
|
862
|
+
width: 1rem;
|
|
863
|
+
height: 1rem;
|
|
864
|
+
align-items: center;
|
|
865
|
+
justify-content: center;
|
|
866
|
+
padding: 0;
|
|
867
|
+
background: transparent;
|
|
868
|
+
|
|
869
|
+
&:hover {
|
|
870
|
+
background-color: transparent;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.popover-menu__content {
|
|
874
|
+
&.--position-bottom {
|
|
875
|
+
&.--align-end {
|
|
876
|
+
&::before {
|
|
877
|
+
right: 12.5px;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
&[data-is-marrybaby='true'] {
|
|
886
|
+
&[data-is-reply='false'] {
|
|
887
|
+
border: none;
|
|
888
|
+
}
|
|
889
|
+
.image-preview-wrapper,
|
|
890
|
+
.link-preview-wrapper {
|
|
891
|
+
padding-right: 1rem;
|
|
892
|
+
padding-left: 1rem;
|
|
893
|
+
}
|
|
894
|
+
.popover {
|
|
895
|
+
.popover-menu__btn {
|
|
896
|
+
width: 24px;
|
|
897
|
+
height: 24px;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
margin-left: 56px;
|
|
902
|
+
${utils.MediaQueries.mbDown} {
|
|
903
|
+
margin-left: 40px;
|
|
904
|
+
}
|
|
905
|
+
> .post-author {
|
|
906
|
+
margin-left: -56px;
|
|
907
|
+
${utils.MediaQueries.mbDown} {
|
|
908
|
+
margin-left: -40px;
|
|
909
|
+
}
|
|
910
|
+
.author-info {
|
|
911
|
+
align-items: center;
|
|
912
|
+
display: flex;
|
|
913
|
+
align-items: center;
|
|
914
|
+
.author-info-top {
|
|
915
|
+
width: 100%;
|
|
916
|
+
}
|
|
917
|
+
.author-info-text-wrapper {
|
|
918
|
+
justify-content: space-between;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
.author-avatar-wrapper {
|
|
922
|
+
width: 40px;
|
|
923
|
+
height: 40px;
|
|
924
|
+
font-size: 20px;
|
|
925
|
+
${utils.MediaQueries.mbDown} {
|
|
926
|
+
width: 24px;
|
|
927
|
+
height: 24px;
|
|
928
|
+
font-size: 12px;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
&[data-is-reply] {
|
|
933
|
+
> .post-author {
|
|
934
|
+
.author-avatar-wrapper {
|
|
935
|
+
width: 40px;
|
|
936
|
+
height: 40px;
|
|
937
|
+
font-size: 20px;
|
|
938
|
+
${utils.MediaQueries.mbDown} {
|
|
939
|
+
width: 24px;
|
|
940
|
+
height: 24px;
|
|
941
|
+
font-size: 12px;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.comment-reply-wrapper {
|
|
948
|
+
padding-right: 0;
|
|
949
|
+
padding-left: 0;
|
|
950
|
+
}
|
|
951
|
+
.post-reaction {
|
|
952
|
+
&::after {
|
|
953
|
+
position: absolute;
|
|
954
|
+
bottom: 0;
|
|
955
|
+
left: 50%;
|
|
956
|
+
width: calc(100% - 2rem);
|
|
957
|
+
height: 1px;
|
|
958
|
+
background: #f3f3f3;
|
|
959
|
+
content: ' ';
|
|
960
|
+
transform: translateX(-50%);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
.post-content-wrapper {
|
|
964
|
+
padding-top: 0;
|
|
965
|
+
padding-bottom: 0;
|
|
966
|
+
${utils.MediaQueries.mbDown} {
|
|
967
|
+
padding-left: 0.5rem;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
${utils.MediaQueries.mbDown} {
|
|
972
|
+
margin-bottom: 12px;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
`;
|
|
976
|
+
const StyledSourceList = styled__default["default"](SourceList) `
|
|
977
|
+
margin-top: 12px;
|
|
978
|
+
padding: 0.5rem 1rem 1rem;
|
|
979
|
+
`;
|
|
980
|
+
|
|
981
|
+
var styles = {"button":"-dzIuHr"};
|
|
982
|
+
|
|
983
|
+
const VerifiedTag = ({ userId, avatar, name, role, title, className, }) => {
|
|
984
|
+
const { t } = useTranslations.useTranslations();
|
|
985
|
+
const [openPopup, setOpenPopup] = React.useState(false);
|
|
986
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
987
|
+
React__default["default"].createElement(index$5.Button, { className: `${styles.button} ${className}`, color: "success", size: "xs", onClick: () => setOpenPopup(true), style: {
|
|
988
|
+
padding: '5px 8px',
|
|
989
|
+
marginBottom: '12px',
|
|
990
|
+
borderRadius: '4px',
|
|
991
|
+
} },
|
|
992
|
+
React__default["default"].createElement("span", { className: "text" },
|
|
993
|
+
React__default["default"].createElement(other.Endorse, { isSolid: true, size: 18, color: theme.theme.colors.green800, className: "icon" }),
|
|
994
|
+
t('cardReply.verifyBy', {
|
|
995
|
+
name: `${name || ''}`,
|
|
996
|
+
}))),
|
|
997
|
+
React__default["default"].createElement(index.ProfileDetailModal, { open: openPopup, onClose: () => setOpenPopup(false), profileModalProps: { zIndex: 1000 } },
|
|
998
|
+
React__default["default"].createElement(index.ProfileDetail, { authorProps: {
|
|
999
|
+
userId,
|
|
1000
|
+
avatar: avatar,
|
|
1001
|
+
name,
|
|
1002
|
+
role,
|
|
1003
|
+
title,
|
|
1004
|
+
}, hideQuestionTab: true }))));
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e";
|
|
1008
|
+
var ChevronRightActive = img;
|
|
1009
|
+
|
|
1010
|
+
const COMMENT_LIMIT = 4;
|
|
1011
|
+
const CardReply = ({ className, style, comment: CommentProps, type = 'comment', level = 0, replyingId, onPostCommentSuccess, post, onDeleteComment, refetchComment, hasQuickBookingEnable, handleMakeAppointment, cardAuthorProps, maxChars = 600, disableShortenContent, }) => {
|
|
1012
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
1013
|
+
const { data: { locale, userInfo, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
1014
|
+
const { t } = useTranslations.useTranslations();
|
|
1015
|
+
const [comment, setComment] = React.useState(CommentProps || null);
|
|
1016
|
+
const { id, countLikes, content, replies = [], images = [], author, liked, link, mentionedUser, mentions, } = comment;
|
|
1017
|
+
const { text, replyingTo } = index.decodeCommentBody(content);
|
|
1018
|
+
const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction({
|
|
1019
|
+
_joinCommunityIds: [(_a = post === null || post === void 0 ? void 0 : post.community) === null || _a === void 0 ? void 0 : _a.id],
|
|
1020
|
+
_joinTopicIds: (_b = post === null || post === void 0 ? void 0 : post.topics) === null || _b === void 0 ? void 0 : _b.map((t) => t.id),
|
|
1021
|
+
});
|
|
1022
|
+
const [maxRepliesShow, setMaxRepliesShow] = React.useState(COMMENT_LIMIT);
|
|
1023
|
+
const isCommented = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id)
|
|
1024
|
+
? replies === null || replies === void 0 ? void 0 : replies.some((c) => c.author.id === userInfo.id)
|
|
1025
|
+
: false;
|
|
1026
|
+
const addNewReply = (comment) => {
|
|
1027
|
+
setComment((old) => {
|
|
1028
|
+
// somehow this set state run twice
|
|
1029
|
+
// => we need to check unique comment id before add to array
|
|
1030
|
+
if (!old.replies.find((c) => c.id === comment.id)) {
|
|
1031
|
+
old.replies.unshift(comment);
|
|
1032
|
+
const newComment = Object.assign(Object.assign({}, old), { replies: old.replies.slice(), countReplies: old.countReplies + 1 });
|
|
1033
|
+
refetchComment && refetchComment(newComment);
|
|
1034
|
+
return newComment;
|
|
1035
|
+
}
|
|
1036
|
+
return old;
|
|
1037
|
+
});
|
|
1038
|
+
};
|
|
1039
|
+
const [showInputComment, setShowInputComment] = React.useState(false);
|
|
1040
|
+
const sortedReplies = React.useMemo(() => {
|
|
1041
|
+
if (type !== 'comment' || !replies || replies.length == 0)
|
|
1042
|
+
return replies;
|
|
1043
|
+
return replies.sort((a, b) => {
|
|
1044
|
+
const timeA = new Date(a.createdAt).getTime();
|
|
1045
|
+
const timeB = new Date(b.createdAt).getTime();
|
|
1046
|
+
if (timeA > timeB)
|
|
1047
|
+
return -1;
|
|
1048
|
+
if (timeA < timeB)
|
|
1049
|
+
return 1;
|
|
1050
|
+
return 0;
|
|
1051
|
+
});
|
|
1052
|
+
}, [type, replies]);
|
|
1053
|
+
const mergeCountReplies = (replies === null || replies === void 0 ? void 0 : replies.length) || 0;
|
|
1054
|
+
const hasPopover = String(author === null || author === void 0 ? void 0 : author.email) &&
|
|
1055
|
+
(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) &&
|
|
1056
|
+
String(author === null || author === void 0 ? void 0 : author.email) === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
|
|
1057
|
+
// const isAnonymousOfCurAuthor =
|
|
1058
|
+
// post?.isAnonymous && post?.author?.username === author?.username
|
|
1059
|
+
// const name = isAnonymousOfCurAuthor
|
|
1060
|
+
// ? t('cardPost.anonymous')
|
|
1061
|
+
// : author?.name || author?.username || ''
|
|
1062
|
+
// const avatar = isAnonymousOfCurAuthor ? DEFAULT_AVATAR_IMG : author?.avatar
|
|
1063
|
+
// const username = isAnonymousOfCurAuthor
|
|
1064
|
+
// ? t('cardPost.anonymous')
|
|
1065
|
+
// : author?.username || author?.name || ''
|
|
1066
|
+
const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
|
|
1067
|
+
const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
|
|
1068
|
+
const avatar = author === null || author === void 0 ? void 0 : author.avatar;
|
|
1069
|
+
const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
|
|
1070
|
+
const listMentions = [
|
|
1071
|
+
...((post === null || post === void 0 ? void 0 : post.isAnonymous)
|
|
1072
|
+
? [
|
|
1073
|
+
{
|
|
1074
|
+
id: ((_c = post === null || post === void 0 ? void 0 : post.author) === null || _c === void 0 ? void 0 : _c.id) || 0,
|
|
1075
|
+
name: t('cardPost.anonymous'),
|
|
1076
|
+
},
|
|
1077
|
+
]
|
|
1078
|
+
: []),
|
|
1079
|
+
...(mentions || []),
|
|
1080
|
+
];
|
|
1081
|
+
const [hospitalInfo, setHospitalInfo] = React.useState(null);
|
|
1082
|
+
const [doctorInfo, setDoctorInfo] = React.useState(null);
|
|
1083
|
+
React.useEffect(() => {
|
|
1084
|
+
if (author === null || author === void 0 ? void 0 : author.hospitalId) {
|
|
1085
|
+
const fetchHospitalDetail = (hospitalId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1086
|
+
var _a;
|
|
1087
|
+
const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_HOSPITAL_INFO, {
|
|
1088
|
+
hospital_branch_id: hospitalId,
|
|
1089
|
+
website_url: index$8.domainLocales[locale],
|
|
1090
|
+
}), 'get');
|
|
1091
|
+
if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
|
|
1092
|
+
setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
fetchHospitalDetail(author.hospitalId);
|
|
1096
|
+
}
|
|
1097
|
+
if (author === null || author === void 0 ? void 0 : author.doctorId) {
|
|
1098
|
+
const fetchDoctorDetail = (doctorId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1099
|
+
var _b;
|
|
1100
|
+
const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_DOCTOR_INFO, {
|
|
1101
|
+
doctorId: doctorId,
|
|
1102
|
+
website_url: index$8.domainLocales[locale],
|
|
1103
|
+
}), 'get');
|
|
1104
|
+
if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
|
|
1105
|
+
setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
fetchDoctorDetail(author.doctorId);
|
|
1109
|
+
}
|
|
1110
|
+
}, [author.hospitalId, author.doctorId]);
|
|
1111
|
+
const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
|
|
1112
|
+
const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
|
|
1113
|
+
(hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
|
|
1114
|
+
const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
|
|
1115
|
+
const isChatbotAuthor = ((_d = comment === null || comment === void 0 ? void 0 : comment.author) === null || _d === void 0 ? void 0 : _d.type) === 'chatbot';
|
|
1116
|
+
return (React__default["default"].createElement(useTogetherAuthRequiredAction.TogetherAuthConfigContextProvider, { defaultParams: {
|
|
1117
|
+
_joinCommunityIds: [(_e = post === null || post === void 0 ? void 0 : post.community) === null || _e === void 0 ? void 0 : _e.id],
|
|
1118
|
+
_joinTopicIds: (_f = post === null || post === void 0 ? void 0 : post.topics) === null || _f === void 0 ? void 0 : _f.map((t) => t.id),
|
|
1119
|
+
} },
|
|
1120
|
+
React__default["default"].createElement(StyledCardPost, { className: className, style: style, "data-is-reply": !!level, "data-is-marrybaby": isMarryBaby, "data-has-booking": hasQuickBooking },
|
|
1121
|
+
type === 'reply' && React__default["default"].createElement(index$6.Divider, { className: "top-divider", type: "solid" }),
|
|
1122
|
+
React__default["default"].createElement("div", { style: { padding: '16px 16px 0' } },
|
|
1123
|
+
React__default["default"].createElement(index.CardAuthor, Object.assign({ avatar: avatar, name: name, username: username, timeText: post === null || post === void 0 ? void 0 : post.createdTime, community: post === null || post === void 0 ? void 0 : post.community,
|
|
1124
|
+
// miniIcon="./svg/icon-tag.svg"
|
|
1125
|
+
// authorLabelType={getAuthorLabelFromRoles(author?.role || [])}
|
|
1126
|
+
className: `post-author ${hasPopover ? 'with-popover' : ''}`, type: type, userId: author === null || author === void 0 ? void 0 : author.id, role: authorRole, expertId: author === null || author === void 0 ? void 0 : author.partnerId, title: author === null || author === void 0 ? void 0 : author.title, doctorId: author === null || author === void 0 ? void 0 : author.doctorId, hospitalId: author === null || author === void 0 ? void 0 : author.hospitalId, hasQuickBooking: hasQuickBooking, handleMakeAppointment: handleMakeAppointment, isAnonymous: (comment === null || comment === void 0 ? void 0 : comment.isAnonymous) ||
|
|
1127
|
+
(Boolean(post === null || post === void 0 ? void 0 : post.isAnonymous) &&
|
|
1128
|
+
((_g = post === null || post === void 0 ? void 0 : post.author) === null || _g === void 0 ? void 0 : _g.username) === (author === null || author === void 0 ? void 0 : author.username)), hideBackground: isChatbotAuthor, userType: author === null || author === void 0 ? void 0 : author.type }, cardAuthorProps)),
|
|
1129
|
+
Boolean(comment === null || comment === void 0 ? void 0 : comment.isVerify) && !Boolean(comment === null || comment === void 0 ? void 0 : comment.isOppose) && (React__default["default"].createElement(VerifiedTag, { title: (_h = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _h === void 0 ? void 0 : _h.title, name: (_j = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _j === void 0 ? void 0 : _j.name, userId: (_k = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _k === void 0 ? void 0 : _k.id, role: (_l = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _l === void 0 ? void 0 : _l.role, avatar: (_m = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _m === void 0 ? void 0 : _m.avatar, className: "verify-tag" }))),
|
|
1130
|
+
React__default["default"].createElement(index.PostContent, { className: "post-content-wrapper", replyingTo: replyingTo, mentionedUser: mentionedUser, description: text, mentions: listMentions, maxChars: maxChars, disableShortenContent: disableShortenContent }),
|
|
1131
|
+
React__default["default"].createElement("span", null),
|
|
1132
|
+
React__default["default"].createElement("span", null),
|
|
1133
|
+
images && images.length > 0 ? (React__default["default"].createElement("div", { key: "image-preview", className: "image-preview-wrapper", "data-is-reply": true },
|
|
1134
|
+
React__default["default"].createElement(index.PostImagePreview, { images: images, authorName: author === null || author === void 0 ? void 0 : author.username }))) : null,
|
|
1135
|
+
(!images || images.length === 0) && link ? (React__default["default"].createElement("div", { key: "link-preview", className: "link-preview-wrapper", "data-is-reply": true },
|
|
1136
|
+
React__default["default"].createElement(index$7.CardLink, { url: link }))) : null,
|
|
1137
|
+
type !== 'most-engaging' ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1138
|
+
isChatbotAuthor && (React__default["default"].createElement(StyledSourceList, { listUrl: comment === null || comment === void 0 ? void 0 : comment.source, categorySlug: comment === null || comment === void 0 ? void 0 : comment.categorySlug })),
|
|
1139
|
+
React__default["default"].createElement(treePopoverMenu.CardReactions, { type: treePopoverMenu.CardReactionType.reply, loveCount: countLikes, replyCount: mergeCountReplies, className: "post-reaction", liked: liked, isReplied: isCommented, hideCommentIcon: type === 'reply' || isChatbotAuthor, hasShare: false, onCommentClick: () => authActionWrapper(() => setShowInputComment((v) => !v)), onCommentCountClick: () => authActionWrapper(() => {
|
|
1140
|
+
setShowInputComment(true);
|
|
1141
|
+
}), onLikeClick: () => authActionWrapper(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1142
|
+
if (id) {
|
|
1143
|
+
const res = yield index.likeUnlikeComment({
|
|
1144
|
+
commentId: id,
|
|
1145
|
+
setLike: !liked,
|
|
1146
|
+
locale,
|
|
1147
|
+
});
|
|
1148
|
+
if (res.status === 1) {
|
|
1149
|
+
setComment((old) => {
|
|
1150
|
+
return Object.assign(Object.assign({}, old), { liked: !liked, countLikes: old.countLikes + (!liked ? 1 : -1) });
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
})) }),
|
|
1155
|
+
showInputComment && (React__default["default"].createElement(index.InputCommentBar, { replyingId: replyingId || comment.id, replyToName: name, isReply: true, onClose: () => setShowInputComment(false), onPostSuccess: (comment) => {
|
|
1156
|
+
if (type === 'reply') {
|
|
1157
|
+
onPostCommentSuccess && onPostCommentSuccess(comment);
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
addNewReply(comment);
|
|
1161
|
+
}
|
|
1162
|
+
}, post: post, replyingUser: author })),
|
|
1163
|
+
type === 'comment' && replies && replies.length > 0 ? (React__default["default"].createElement("div", { className: "comment-reply-wrapper" }, (_o = sortedReplies === null || sortedReplies === void 0 ? void 0 : sortedReplies.slice(0, maxRepliesShow)) === null || _o === void 0 ? void 0 :
|
|
1164
|
+
_o.map((reply) => (React__default["default"].createElement(CardReply, { key: reply.id, comment: reply, type: "reply", className: "comment-reply-item", level: level + 1, replyingId: id, onPostCommentSuccess: addNewReply, post: post, onDeleteComment: () => {
|
|
1165
|
+
setComment((old) => {
|
|
1166
|
+
return Object.assign(Object.assign({}, old), { replies: old.replies.filter((r) => r.id !== reply.id), countReplies: old.countReplies - 1 });
|
|
1167
|
+
});
|
|
1168
|
+
}, handleMakeAppointment: handleMakeAppointment, hasQuickBookingEnable: hasQuickBookingEnable }))),
|
|
1169
|
+
mergeCountReplies > maxRepliesShow && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1170
|
+
React__default["default"].createElement(index$6.Divider, { className: "top-divider", type: "solid" }),
|
|
1171
|
+
React__default["default"].createElement(index$5.Button, { className: "more-cmt", size: "lg", color: "ghost", onClick: () => setMaxRepliesShow((m) => m + COMMENT_LIMIT) },
|
|
1172
|
+
t('comment.seeMoreReplies', {
|
|
1173
|
+
count: mergeCountReplies - maxRepliesShow,
|
|
1174
|
+
}),
|
|
1175
|
+
React__default["default"].createElement("img", { className: "chevron-right", src: ChevronRightActive, loading: "lazy" })))))) : null)) : null,
|
|
1176
|
+
hasPopover && (React__default["default"].createElement(CardReplyPopover, { onDeleteComment: onDeleteComment, className: "popover", commentId: comment.id })))));
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
const getMostEngagingComment = (postId, locale) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1180
|
+
var _a, _b, _c;
|
|
1181
|
+
const commentsRes = yield togetherComponentGlobalContext.callApiWithOptionalAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.COMMENT.LIST, {
|
|
1182
|
+
postId: postId,
|
|
1183
|
+
_locale: locale,
|
|
1184
|
+
sort: 'popularity',
|
|
1185
|
+
perPage: 1,
|
|
1186
|
+
withoutReply: 1,
|
|
1187
|
+
}), 'GET');
|
|
1188
|
+
return (_c = (_b = (_a = commentsRes === null || commentsRes === void 0 ? void 0 : commentsRes.data) === null || _a === void 0 ? void 0 : _a.comments) === null || _b === void 0 ? void 0 : _b.map(dataTransform.formatComment)) === null || _c === void 0 ? void 0 : _c[0];
|
|
1189
|
+
});
|
|
1190
|
+
const CardPost = ({ className, style, hideViewMoreComment, showMostEngaging, onCommentClick, onCommentCountClick, onMostEngagingCommentClick, onPostCommentSuccess: onPostCommentSuccessProp, disableCardLink, disableShortenContent, onDeletePost, onEditPost, post: postProp, mostEngagingComment: mostEngagingCommentProp, onDeleteComment: onDeleteCommentProp, showInputComment: propsShowInputComment, InlineCommentsComponent, hasQuickBookingEnable, handleMakeAppointment, cardAuthorProps, }) => {
|
|
1191
|
+
const [post, setPost] = React.useState(postProp);
|
|
1192
|
+
const [isOpenSharePopup, setIsOpenSharePopup] = React.useState(false);
|
|
1193
|
+
const [mostEngagingComment, setMostEngagingComment] = React.useState(mostEngagingCommentProp);
|
|
1194
|
+
const { community, topics, author, slug, isPin, liked, photos, mentions, title, description, previewUrl, likesCount, commentsCount, id, commented, } = post;
|
|
1195
|
+
const { data: { locale, env: { isMarryBaby, togetherBasePath }, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
1196
|
+
const { t } = useTranslations.useTranslations();
|
|
1197
|
+
const [showInputComment, setShowInputComment] = React.useState(propsShowInputComment);
|
|
1198
|
+
const postRelativeHref = `${togetherBasePath}/${(community === null || community === void 0 ? void 0 : community.slug) || '_'}/${slug || ''}`;
|
|
1199
|
+
const postHref = `${togetherComponentGlobalContext.getCurrentBaseUrl(locale)}${postRelativeHref}`;
|
|
1200
|
+
const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction((community === null || community === void 0 ? void 0 : community.slug)
|
|
1201
|
+
? {
|
|
1202
|
+
_joinCommunityIds: [community.id],
|
|
1203
|
+
_joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
|
|
1204
|
+
// _location: postHref,
|
|
1205
|
+
}
|
|
1206
|
+
: undefined);
|
|
1207
|
+
const [isLikeLoading, setIsLikeLoading] = React.useState(false);
|
|
1208
|
+
React.useEffect(() => {
|
|
1209
|
+
setShowInputComment(propsShowInputComment);
|
|
1210
|
+
}, [propsShowInputComment]);
|
|
1211
|
+
const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
|
|
1212
|
+
const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
|
|
1213
|
+
const avatar = author === null || author === void 0 ? void 0 : author.avatar;
|
|
1214
|
+
const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
|
|
1215
|
+
const [hospitalInfo, setHospitalInfo] = React.useState(null);
|
|
1216
|
+
const [doctorInfo, setDoctorInfo] = React.useState(null);
|
|
1217
|
+
React.useEffect(() => {
|
|
1218
|
+
if (author === null || author === void 0 ? void 0 : author.hospitalId) {
|
|
1219
|
+
const fetchHospitalDetail = (hospitalId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1220
|
+
var _a;
|
|
1221
|
+
const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_HOSPITAL_INFO, {
|
|
1222
|
+
hospital_branch_id: hospitalId,
|
|
1223
|
+
website_url: togetherComponentGlobalContext.domainLocales[locale],
|
|
1224
|
+
}), 'get');
|
|
1225
|
+
if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
|
|
1226
|
+
setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
|
|
1227
|
+
}
|
|
1228
|
+
});
|
|
1229
|
+
fetchHospitalDetail(author.hospitalId);
|
|
1230
|
+
}
|
|
1231
|
+
if (author === null || author === void 0 ? void 0 : author.doctorId) {
|
|
1232
|
+
const fetchDoctorDetail = (doctorId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1233
|
+
var _b;
|
|
1234
|
+
const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_DOCTOR_INFO, {
|
|
1235
|
+
doctorId: doctorId,
|
|
1236
|
+
website_url: togetherComponentGlobalContext.domainLocales[locale],
|
|
1237
|
+
}), 'get');
|
|
1238
|
+
if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
|
|
1239
|
+
setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
fetchDoctorDetail(author.doctorId);
|
|
1243
|
+
}
|
|
1244
|
+
}, [author.hospitalId, author.doctorId]);
|
|
1245
|
+
const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
|
|
1246
|
+
const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
|
|
1247
|
+
(hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
|
|
1248
|
+
const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
|
|
1249
|
+
React.useEffect(() => {
|
|
1250
|
+
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1251
|
+
if (id &&
|
|
1252
|
+
commentsCount &&
|
|
1253
|
+
showMostEngaging &&
|
|
1254
|
+
!(mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id)) {
|
|
1255
|
+
const comment = yield getMostEngagingComment(id, locale);
|
|
1256
|
+
setMostEngagingComment(comment);
|
|
1257
|
+
}
|
|
1258
|
+
}))();
|
|
1259
|
+
}, [id, locale, commentsCount, showMostEngaging, mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
|
|
1260
|
+
React.useEffect(() => {
|
|
1261
|
+
setMostEngagingComment(mostEngagingCommentProp);
|
|
1262
|
+
}, [mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
|
|
1263
|
+
const onPostCommentSuccess = (comment) => {
|
|
1264
|
+
if (commentsCount === 0 && !(mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) {
|
|
1265
|
+
setMostEngagingComment(comment);
|
|
1266
|
+
}
|
|
1267
|
+
setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount + 1, commented: true })));
|
|
1268
|
+
onPostCommentSuccessProp && onPostCommentSuccessProp(comment);
|
|
1269
|
+
};
|
|
1270
|
+
const onDeleteComment = (comment) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1271
|
+
if (commentsCount > 1 &&
|
|
1272
|
+
(mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) &&
|
|
1273
|
+
(mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) === (comment === null || comment === void 0 ? void 0 : comment.id)) {
|
|
1274
|
+
const newMostEngaging = yield getMostEngagingComment(id, locale);
|
|
1275
|
+
setMostEngagingComment(newMostEngaging);
|
|
1276
|
+
}
|
|
1277
|
+
setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount - 1 })));
|
|
1278
|
+
onDeleteCommentProp && onDeleteCommentProp(comment);
|
|
1279
|
+
});
|
|
1280
|
+
return (React__default["default"].createElement(useTogetherAuthRequiredAction.TogetherAuthConfigContextProvider, { defaultParams: (community === null || community === void 0 ? void 0 : community.slug)
|
|
1281
|
+
? {
|
|
1282
|
+
_joinCommunityIds: [community.id],
|
|
1283
|
+
_joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
|
|
1284
|
+
// _location: postHref,
|
|
1285
|
+
}
|
|
1286
|
+
: undefined },
|
|
1287
|
+
isOpenSharePopup && (React__default["default"].createElement(index.SharePopup, { url: postHref, avatar: constants.DEFAULT_IMG, text: title, onClose: () => setIsOpenSharePopup(false) })),
|
|
1288
|
+
React__default["default"].createElement(StyledCardPost$1, { className: className, style: style, "data-is-marrybaby": isMarryBaby },
|
|
1289
|
+
isPin ? React__default["default"].createElement(treePopoverMenu.LabelPin, { className: "post-pin" }) : null,
|
|
1290
|
+
React__default["default"].createElement("div", { style: { position: 'relative', padding: '1rem 1rem 0' } },
|
|
1291
|
+
React__default["default"].createElement(index.CardAuthor, Object.assign({ avatar: avatar, name: name, username: username, url: disableCardLink ? undefined : postRelativeHref, community: community,
|
|
1292
|
+
// miniIcon="./svg/icon-tag.svg"
|
|
1293
|
+
timeText: post === null || post === void 0 ? void 0 : post.createdTime, className: "post-author", role: authorRole, userId: author === null || author === void 0 ? void 0 : author.id, expertId: author === null || author === void 0 ? void 0 : author.partnerId, doctorId: author === null || author === void 0 ? void 0 : author.doctorId, hospitalId: author === null || author === void 0 ? void 0 : author.hospitalId, title: author === null || author === void 0 ? void 0 : author.title, hasQuickBooking: hasQuickBooking, handleMakeAppointment: handleMakeAppointment, "data-testid": "name", isAnonymous: !!(post === null || post === void 0 ? void 0 : post.isAnonymous), extendEle: React__default["default"].createElement(CardPostPopoverMore, { authorEmail: String(author === null || author === void 0 ? void 0 : author.email), onDeletePost: onDeletePost, shareUrl: postHref, post: post, className: "popover", onEditPost: onEditPost }) }, cardAuthorProps))),
|
|
1294
|
+
React__default["default"].createElement("a", { href: disableCardLink ? undefined : postRelativeHref, className: "post-content-link-wrapper" },
|
|
1295
|
+
title && (React__default["default"].createElement(index$2.Heading, { className: "post-content-title", as: "h2", tag: "h5", fontWeight: "bold", "data-testid": "Title of the Post" }, innertext__default["default"](title))),
|
|
1296
|
+
React__default["default"].createElement(index.PostContent, { className: "post-content-wrapper", description: description, disableShortenContent: disableShortenContent, mentions: mentions, "data-testid": "Content of the Post" })),
|
|
1297
|
+
React__default["default"].createElement("span", null),
|
|
1298
|
+
React__default["default"].createElement("span", null),
|
|
1299
|
+
React__default["default"].createElement("div", { key: "tag-topic" }, topics && topics.length > 0 ? (React__default["default"].createElement(treePopoverMenu.TagTopic, { topics: topics, className: "post-topics" })) : null),
|
|
1300
|
+
React__default["default"].createElement("div", { key: "social-preview" }, (post === null || post === void 0 ? void 0 : post.introUrl) ? (React__default["default"].createElement("div", { className: `social-preview-wrapper ${!!(photos === null || photos === void 0 ? void 0 : photos.length) ? 'has-image' : ''}` },
|
|
1301
|
+
React__default["default"].createElement(index.SocialLinkPreview, { url: post.introUrl, image: post.bannerImage }))) : null),
|
|
1302
|
+
React__default["default"].createElement("div", { key: "image-preview" }, !!(photos === null || photos === void 0 ? void 0 : photos.length) ? (React__default["default"].createElement("div", { className: "image-preview-wrapper" },
|
|
1303
|
+
React__default["default"].createElement(index.PostImagePreview, { images: photos, authorName: author === null || author === void 0 ? void 0 : author.name }))) : null),
|
|
1304
|
+
React__default["default"].createElement("div", { key: "link-preview" }, !(post === null || post === void 0 ? void 0 : post.introUrl) && !(photos === null || photos === void 0 ? void 0 : photos.length) && (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url) ? (React__default["default"].createElement("div", { className: "link-preview-wrapper" },
|
|
1305
|
+
React__default["default"].createElement(index$7.CardLink, { title: previewUrl.title, url: previewUrl.url, image: previewUrl.image }))) : null),
|
|
1306
|
+
React__default["default"].createElement(treePopoverMenu.CardReactions, { isMarryBaby: isMarryBaby, type: treePopoverMenu.CardReactionType.post, loveCount: likesCount, replyCount: commentsCount, className: `post-reaction ${(photos === null || photos === void 0 ? void 0 : photos.length) || (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url) ? 'hide-top-border' : ''}`, liked: isLikeLoading ? !liked : liked, isReplied: commented, onCommentClick: () => authActionWrapper(() => {
|
|
1307
|
+
onCommentClick ? onCommentClick() : setShowInputComment((v) => !v);
|
|
1308
|
+
}), onCommentCountClick: () => {
|
|
1309
|
+
authActionWrapper(() => {
|
|
1310
|
+
isMarryBaby
|
|
1311
|
+
? setShowInputComment(true)
|
|
1312
|
+
: onCommentCountClick
|
|
1313
|
+
? onCommentCountClick()
|
|
1314
|
+
: !disableCardLink && (window.location.href = postRelativeHref);
|
|
1315
|
+
});
|
|
1316
|
+
}, onShareClick: () => {
|
|
1317
|
+
setIsOpenSharePopup(true);
|
|
1318
|
+
}, onLikeClick: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1319
|
+
if (!id || isLikeLoading)
|
|
1320
|
+
return;
|
|
1321
|
+
setIsLikeLoading(true);
|
|
1322
|
+
try {
|
|
1323
|
+
const res = yield index.likeUnlikePost({
|
|
1324
|
+
id,
|
|
1325
|
+
locale,
|
|
1326
|
+
});
|
|
1327
|
+
if ((res === null || res === void 0 ? void 0 : res.status) !== 1) {
|
|
1328
|
+
pushNotifications(index.getDefaultFailNoti(t));
|
|
1329
|
+
}
|
|
1330
|
+
else {
|
|
1331
|
+
setPost((p) => (Object.assign(Object.assign({}, p), { likesCount: (p.likesCount || 0) + (!p.liked ? 1 : -1), liked: !p.liked })));
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
catch (_a) {
|
|
1335
|
+
pushNotifications(index.getDefaultFailNoti(t));
|
|
1336
|
+
}
|
|
1337
|
+
setIsLikeLoading(false);
|
|
1338
|
+
}), showingMostEngaging: !!(showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) }),
|
|
1339
|
+
showInputComment && (React__default["default"].createElement(index.InputCommentBar, { isMainCmt: !propsShowInputComment, onClose: () => setShowInputComment(false), onPostSuccess: onPostCommentSuccess, post: post })),
|
|
1340
|
+
showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) ? (React__default["default"].createElement("div", { className: "most-engaging-wrapper", onClick: (e) => {
|
|
1341
|
+
if (onMostEngagingCommentClick) {
|
|
1342
|
+
e.stopPropagation();
|
|
1343
|
+
onMostEngagingCommentClick();
|
|
1344
|
+
}
|
|
1345
|
+
else
|
|
1346
|
+
window.location.href = postRelativeHref;
|
|
1347
|
+
} },
|
|
1348
|
+
React__default["default"].createElement(CardReply, { hasQuickBookingEnable: hasQuickBookingEnable, handleMakeAppointment: handleMakeAppointment, comment: mostEngagingComment, post: post, onDeleteComment: () => {
|
|
1349
|
+
onDeleteComment && onDeleteComment(mostEngagingComment);
|
|
1350
|
+
}, className: "most-engaging-comment", type: "most-engaging", key: mostEngagingComment.id, cardAuthorProps: cardAuthorProps }),
|
|
1351
|
+
commentsCount > 1 && !hideViewMoreComment && (React__default["default"].createElement(index$5.Button, { className: "see-more-comments", color: "ghost", size: "md" }, t('comment.seeMoreComments', {
|
|
1352
|
+
count: commentsCount - 1,
|
|
1353
|
+
}))))) : null,
|
|
1354
|
+
InlineCommentsComponent)));
|
|
1355
|
+
};
|
|
1356
|
+
|
|
1357
|
+
exports.CardPost = CardPost;
|
|
1358
|
+
exports.CardPostPopoverMore = CardPostPopoverMore;
|
|
1359
|
+
exports.CardReply = CardReply;
|
|
1360
|
+
exports.CardReplyPopover = CardReplyPopover;
|
|
1361
|
+
exports.SourceList = SourceList;
|
|
1362
|
+
exports.VerifiedTag = VerifiedTag;
|