@restaround/react 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as branchModels from "src/models/branch";
|
|
2
2
|
interface Props {
|
|
3
3
|
branches: branchModels.Branch[];
|
|
4
|
+
rootPath?: string;
|
|
4
5
|
onBranchSelect: (branchId: number) => void;
|
|
5
6
|
}
|
|
6
|
-
declare const Branches: ({ branches, onBranchSelect }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Branches: ({ branches, rootPath, onBranchSelect }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default Branches;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{useRef as a,memo as n,useCallback as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{useRef as a,memo as n,useCallback as c,useEffect as i,useState as o}from"react";import{Row as l,IconLink as s,SVGIcon as d,Column as m,Carousel as u,CarouselItem as h,Chip as g,UIElementType as _,Container as p,Card as v,Flex as f}from"@sorocraft/ui";import{Phone as b,Whatsapp as I,Instagram as N,Telegram as y,Tiktok as k,Facebook as P,Wifi as w,MarkerPin as L}from"@sorocraft/ui/icons";import{isEmpty as C,priceFormatter as A,groupBy as H}from"@sorocraft/js-utils";var B="PublicMenu-module_container__QLN6U",$="PublicMenu-module_categories__Iy6NC",z="Header-module_container__tenlF",j="Header-module_cover__BAWZK",E="Header-module_content__Gx4Al",O="Header-module_logo__4MTCm",W="Header-module_info__IchYA",x="Header-module_name__30wyw",F="Header-module_address__WOxXc",M="Header-module_social__AoP0z",R="Header-module_links__EeQxg";const S=({branch:r,coverImage:a,logoImage:n,name:c,instagram:i,facebook:o,whatsapp:u,telegram:h,tiktok:g})=>{const{address:_,latitude:p,longitude:v,phone:f}=r||{},A=C(r),H=`https://www.google.com/maps/place/${p},${v}`;return e("div",{className:z,children:[t("img",{src:a,alt:c,className:j}),t("div",{className:E,children:t(A?()=>e(m,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[t("img",{src:n,alt:c,className:O}),t("div",{className:W,children:t("h1",{className:x,children:c})})]}):()=>e(l,{gap:1,children:[t("img",{src:n,alt:c,className:O}),e("div",{className:W,children:[t("h1",{className:x,children:c}),t("a",{className:F,href:H,target:"_blank",rel:"noopener noreferrer",children:e(l,{alignItems:"center",gap:.5,children:[t(d,{icon:L,theme:"dark"}),t("span",{children:_})]})})]})]}),{})}),!A&&t("div",{className:M,children:t("div",{className:R,children:e(l,{gap:2,children:[e(l,{alignItems:"center",justifyContent:"center",gap:.5,children:[f&&t(s,{icon:b,href:`tel:+${f}`,size:"sm",shape:"circle",theme:"light"}),u&&t(s,{icon:I,href:`https://wa.me/${u}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),i&&t(s,{icon:N,href:i,size:"sm",shape:"circle",theme:"light",target:"_blank"}),h&&t(s,{icon:y,href:h,size:"sm",shape:"circle",theme:"light",target:"_blank"}),g&&t(s,{icon:k,href:g,size:"sm",shape:"circle",theme:"light",target:"_blank"}),o&&t(s,{icon:P,href:o,size:"sm",shape:"circle",theme:"light",target:"_blank"})]}),t(l,{children:t(d,{icon:w,size:"sm"})})]})})})]})},V=({categories:e,language:r,selectedCategoryId:n,onSelectCategory:c})=>{const i=a({}),o=e=>{(e=>{var t;const r=null===(t=null==i?void 0:i.current)||void 0===t?void 0:t[e];r&&r.scrollIntoView({behavior:"smooth",inline:"center"})})(e),c(e)};return t("div",{className:$,children:t(u,{gap:1,children:e.map((({id:e,translations:a})=>{const{name:c}=a.find((e=>e.language===r))||{};return t(h,{children:t(g,{onClick:()=>o(e),type:_.BORDERED_PRIMARY,active:e===n,children:t("div",{ref:t=>i.current[e]=t,children:c})})},e)}))})})};var D={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var T={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const Y="https://images.restaround.co",Z=({product:r,currency:a,language:n})=>{const{translations:c,price:i,imageUrl:o}=r||{},{name:s,description:d}=c.find((e=>e.language===n))||{},u=A(i,a||"AZN",n);return t("div",{className:T.container,children:e(l,{justifyContent:"space-between",children:[t("div",{className:T.data,children:e(m,{gap:.5,children:[t("h3",{className:T.name,children:s}),t("div",{className:T.description,children:d}),t("div",{className:T.price,children:u})]})}),o&&t("img",{src:o,alt:s,className:T.image})]})})},J=n((({products:r,categories:a,currency:n,language:o,productBlocksRef:l,onCategoryInView:s})=>{const d=H(r,"categoryId"),u=c((e=>{let t=null,r=0;e.forEach((e=>{const a=Number(e.target.getAttribute("data-category-id")),n=e.intersectionRatio;n>r&&(r=n,t=a)})),t&&s(t)}),[s]);return i((()=>{const e=new IntersectionObserver(u,{root:null,threshold:[.1,.5,.75]});return Object.values((null==l?void 0:l.current)||{}).forEach((t=>{t&&e.observe(t)})),()=>{e.disconnect()}}),[l,u]),t("div",{className:D.container,children:t(m,{children:Object.keys(d).map((r=>{const c=a.find((({id:e})=>e===Number(r)))||{},{name:i}=((e,t)=>{var r,a;return(null===(a=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===a?void 0:a.call(r,(e=>e.language===t)))||{}})(c,o);return e("div",{className:D.products,ref:e=>l.current[c.id]=e,"data-category-id":r,children:[t("h2",{className:D.category,children:i}),t("div",{className:D.list,children:t(m,{gap:2,children:d[r].map((e=>t(Z,{product:e,currency:n,language:o},e.id)))})})]},r)}))})})}),((e,t)=>e.products===t.products&&e.categories===t.categories&&e.currency===t.currency&&e.language===t.language));var K="Branches-module_branches__sOuoV",Q="Branches-module_list__vYoT2",U="Branches-module_name__K0Z-4";const q=({branches:e=[],rootPath:r="",onBranchSelect:a})=>{const n=({children:e,id:n})=>a?t("div",{onClick:()=>a(n),children:e}):t("a",{href:`${r}/${n}`,children:e});return t("div",{className:K,children:t(p,{className:Q,children:e.map((({id:e,name:r})=>t(n,{id:e,children:t(v,{noBottomMargin:!0,children:t(f,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:t("h2",{className:U,children:r})})})},e)))})})},G=({data:n})=>{var c;const{name:i,coverImage:l,logoImage:s,branches:d=[],branchId:m,language:u,categories:h,products:g,currency:_,instagram:p,facebook:v,whatsapp:f,telegram:b,tiktok:I,rootPath:N,onBranchSelect:y}=n||{},k=d.length<=1,P=d.find((e=>e.id===Number(m))),w=k||!(null==P?void 0:P.name)?i:(null==P?void 0:P.name)||"",[L,C]=o(null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.id),A=a({});return e("div",{className:B,children:[t(S,{branch:P,name:w,coverImage:l?l.includes("base64")||l.startsWith("https://")?l:`${Y}/${l}`:"https://images.restaround.co/restaround-doodle.webp",logoImage:s?s.includes("base64")||s.startsWith("https://")?s:`${Y}/${s}`:"https://images.restaround.co/no-photo-128.webp",instagram:p,facebook:v,whatsapp:f,telegram:b,tiktok:I}),k||m?e(r,{children:[t(V,{categories:h,language:u,selectedCategoryId:L,onSelectCategory:e=>{C(e),(e=>{var t;const r=null===(t=null==A?void 0:A.current)||void 0===t?void 0:t[e];r&&r.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),t(J,{categories:h,products:g,currency:_,language:u,productBlocksRef:A,onCategoryInView:e=>{e!==L&&C(e)}})]}):t(q,{branches:d,onBranchSelect:y,rootPath:N})]})};export{G as PublicMenu};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\nimport * as menuModels from \"src/models/menu\";\n\ninterface Props\n\textends Pick<\n\t\tmenuModels.PublicMenuData,\n\t\t| \"coverImage\"\n\t\t| \"logoImage\"\n\t\t| \"name\"\n\t\t| \"instagram\"\n\t\t| \"facebook\"\n\t\t| \"whatsapp\"\n\t\t| \"telegram\"\n\t\t| \"tiktok\"\n\t> {\n\tbranch?: branchModels.Branch;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tinstagram,\n\tfacebook,\n\twhatsapp,\n\ttelegram,\n\ttiktok,\n}: Props) => {\n\tconst { address, latitude, longitude, phone } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\t// const languageOptions = useMemo(\n\t// \t() =>\n\t// \t\t[\"az\", \"en\"].map((language) => ({\n\t// \t\t\tvalue: language,\n\t// \t\t\tlabel: language,\n\t// \t\t})),\n\t// \t[]\n\t// );\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>{noBranch ? <BusinessInfo /> : <BranchInfo />}</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row gap={2}>\n\t\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t\t{phone && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Phone}\n\t\t\t\t\t\t\t\t\t\thref={`tel:+${phone}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{whatsapp && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Whatsapp}\n\t\t\t\t\t\t\t\t\t\thref={`https://wa.me/${whatsapp}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{instagram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Instagram}\n\t\t\t\t\t\t\t\t\t\thref={instagram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{telegram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Telegram}\n\t\t\t\t\t\t\t\t\t\thref={telegram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{tiktok && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Tiktok}\n\t\t\t\t\t\t\t\t\t\thref={tiktok}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{facebook && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Facebook}\n\t\t\t\t\t\t\t\t\t\thref={facebook}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t<Row>\n\t\t\t\t\t\t\t\t<SVGIcon icon={Wifi} size=\"sm\" />\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\nexport const IMAGE_BASE_URL = \"https://images.restaround.co\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect, memo, useCallback } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\nimport styles from \"./Products.module.scss\";\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = memo(\n\t({ products, categories, currency, language, productBlocksRef, onCategoryInView }: Props) => {\n\t\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\t\tconst handleIntersection = useCallback(\n\t\t\t(entries: IntersectionObserverEntry[]) => {\n\t\t\t\tlet bestMatchCategoryId: number | null = null;\n\t\t\t\tlet maxVisibility = 0;\n\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\tconst visiblePercentage = entry.intersectionRatio;\n\n\t\t\t\t\t// Track the category block that has the highest visible percentage\n\t\t\t\t\tif (visiblePercentage > maxVisibility) {\n\t\t\t\t\t\tmaxVisibility = visiblePercentage;\n\t\t\t\t\t\tbestMatchCategoryId = categoryId;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Only update if the best matching category is different from the currently selected one\n\t\t\t\tif (bestMatchCategoryId) {\n\t\t\t\t\tonCategoryInView(bestMatchCategoryId);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onCategoryInView]\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tconst observer = new IntersectionObserver(handleIntersection, {\n\t\t\t\troot: null,\n\t\t\t\tthreshold: [0.1, 0.5, 0.75], // Different levels of visibility\n\t\t\t});\n\n\t\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\t\tif (block) {\n\t\t\t\t\tobserver.observe(block);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t};\n\t\t}, [productBlocksRef, handleIntersection]);\n\n\t\treturn (\n\t\t\t<div className={styles.container}>\n\t\t\t\t<Column>\n\t\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Column>\n\t\t\t</div>\n\t\t);\n\t},\n\t(prevProps, nextProps) => {\n\t\treturn (\n\t\t\tprevProps.products === nextProps.products &&\n\t\t\tprevProps.categories === nextProps.categories &&\n\t\t\tprevProps.currency === nextProps.currency &&\n\t\t\tprevProps.language === nextProps.language\n\t\t);\n\t}\n);\n\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n\tonBranchSelect: (branchId: number) => void;\n}\n\nconst Branches = ({ branches = [], onBranchSelect }: Props) => {\n\tconst Parent = ({ children, id }) => {\n\t\tif (onBranchSelect) return <div onClick={() => onBranchSelect(id)}>{children}</div>;\n\n\t\tconst pathname = typeof window !== \"undefined\" ? window?.location?.pathname : \"\";\n\n\t\treturn <a href={`${pathname}/${id}`}>{children}</a>;\n\t};\n\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<Parent key={id} id={id}>\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</Parent>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\nimport { IMAGE_BASE_URL } from \"./PublicMenu.constants\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tinstagram,\n\t\tfacebook,\n\t\twhatsapp,\n\t\ttelegram,\n\t\ttiktok,\n\t\tonBranchSelect,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\tconst getLogoImageSource = () => {\n\t\tif (!logoImage) return \"https://images.restaround.co/no-photo-128.webp\";\n\n\t\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n\t};\n\n\tconst getCoverImageSource = () => {\n\t\tif (!coverImage) return \"https://images.restaround.co/restaround-doodle.webp\";\n\n\t\tif (coverImage.includes(\"base64\") || coverImage.startsWith(\"https://\")) return coverImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${coverImage}`;\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={getCoverImageSource()}\n\t\t\t\tlogoImage={getLogoImageSource()}\n\t\t\t\tinstagram={instagram}\n\t\t\t\tfacebook={facebook}\n\t\t\t\twhatsapp={whatsapp}\n\t\t\t\ttelegram={telegram}\n\t\t\t\ttiktok={tiktok}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} onBranchSelect={onBranchSelect} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","instagram","facebook","whatsapp","telegram","tiktok","address","latitude","longitude","phone","noBranch","isEmpty","googleMapLink","_jsxs","className","styles","children","_jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Phone","size","shape","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Wifi","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","IMAGE_BASE_URL","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","memo","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","handleIntersection","useCallback","entries","bestMatchCategoryId","maxVisibility","forEach","entry","Number","getAttribute","visiblePercentage","intersectionRatio","useEffect","observer","IntersectionObserver","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","prevProps","nextProps","Branches","branches","onBranchSelect","Parent","pathname","window","location","Container","Card","noBottomMargin","Flex","PublicMenu","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","includes","startsWith","_Fragment","productBlock","scrollToProductBlock"],"mappings":"24BAiCA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,YACAC,WACAC,WACAC,WACAC,aAEA,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,MAAEA,GAAUZ,GAAU,GACpDa,EAAWC,EAAQd,GAEnBe,EAAgB,qCAAqCL,KAAYC,IAyCvE,OACCK,EAAA,MAAA,CAAKC,UAAWC,EACfC,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKpB,EAAYqB,IAAKnB,EAAMc,UAAWC,IAC5CE,EAAK,MAAA,CAAAH,UAAWC,EAAcC,SAAcC,EAAXP,EAZd,IACpBG,EAACO,EAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DR,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKnB,EAAWoB,IAAKnB,EAAMc,UAAWC,IAC3CE,EAAK,MAAA,CAAAH,UAAWC,WACfE,EAAI,KAAA,CAAAH,UAAWC,EAAcC,SAAAhB,SAzBb,IAClBa,EAACY,EAAI,CAAAC,IAAK,EAACV,SAAA,CACVC,SAAKC,IAAKnB,EAAWoB,IAAKnB,EAAMc,UAAWC,IAC3CF,SAAKC,U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BlC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5C4F,GAELA,EAAaxF,eAAe,CAAEC,SAAU,SAAUsD,MAAO,SAAU,EAMnEkC,CAAqB7F,EAAW,IAgD7BpC,EAACsE,EACA,CAAA1C,WAAYA,EACZ4C,SAAUA,EACVX,SAAUA,EACVhC,SAAUA,EACV4C,iBAAkBA,EAClBC,iBAnDyBtC,IACzBA,IAAeN,GAClB6F,EAAsBvF,EACtB,OAiCCpC,EAAC0G,EAAS,CAAAC,SAAUA,EAAUC,eAAgBA,MAoB/C"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\nimport * as menuModels from \"src/models/menu\";\n\ninterface Props\n\textends Pick<\n\t\tmenuModels.PublicMenuData,\n\t\t| \"coverImage\"\n\t\t| \"logoImage\"\n\t\t| \"name\"\n\t\t| \"instagram\"\n\t\t| \"facebook\"\n\t\t| \"whatsapp\"\n\t\t| \"telegram\"\n\t\t| \"tiktok\"\n\t> {\n\tbranch?: branchModels.Branch;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tinstagram,\n\tfacebook,\n\twhatsapp,\n\ttelegram,\n\ttiktok,\n}: Props) => {\n\tconst { address, latitude, longitude, phone } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\t// const languageOptions = useMemo(\n\t// \t() =>\n\t// \t\t[\"az\", \"en\"].map((language) => ({\n\t// \t\t\tvalue: language,\n\t// \t\t\tlabel: language,\n\t// \t\t})),\n\t// \t[]\n\t// );\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>{noBranch ? <BusinessInfo /> : <BranchInfo />}</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row gap={2}>\n\t\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t\t{phone && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Phone}\n\t\t\t\t\t\t\t\t\t\thref={`tel:+${phone}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{whatsapp && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Whatsapp}\n\t\t\t\t\t\t\t\t\t\thref={`https://wa.me/${whatsapp}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{instagram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Instagram}\n\t\t\t\t\t\t\t\t\t\thref={instagram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{telegram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Telegram}\n\t\t\t\t\t\t\t\t\t\thref={telegram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{tiktok && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Tiktok}\n\t\t\t\t\t\t\t\t\t\thref={tiktok}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{facebook && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Facebook}\n\t\t\t\t\t\t\t\t\t\thref={facebook}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t<Row>\n\t\t\t\t\t\t\t\t<SVGIcon icon={Wifi} size=\"sm\" />\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\nexport const IMAGE_BASE_URL = \"https://images.restaround.co\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect, memo, useCallback } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\nimport styles from \"./Products.module.scss\";\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = memo(\n\t({ products, categories, currency, language, productBlocksRef, onCategoryInView }: Props) => {\n\t\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\t\tconst handleIntersection = useCallback(\n\t\t\t(entries: IntersectionObserverEntry[]) => {\n\t\t\t\tlet bestMatchCategoryId: number | null = null;\n\t\t\t\tlet maxVisibility = 0;\n\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\tconst visiblePercentage = entry.intersectionRatio;\n\n\t\t\t\t\t// Track the category block that has the highest visible percentage\n\t\t\t\t\tif (visiblePercentage > maxVisibility) {\n\t\t\t\t\t\tmaxVisibility = visiblePercentage;\n\t\t\t\t\t\tbestMatchCategoryId = categoryId;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Only update if the best matching category is different from the currently selected one\n\t\t\t\tif (bestMatchCategoryId) {\n\t\t\t\t\tonCategoryInView(bestMatchCategoryId);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onCategoryInView]\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tconst observer = new IntersectionObserver(handleIntersection, {\n\t\t\t\troot: null,\n\t\t\t\tthreshold: [0.1, 0.5, 0.75], // Different levels of visibility\n\t\t\t});\n\n\t\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\t\tif (block) {\n\t\t\t\t\tobserver.observe(block);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t};\n\t\t}, [productBlocksRef, handleIntersection]);\n\n\t\treturn (\n\t\t\t<div className={styles.container}>\n\t\t\t\t<Column>\n\t\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Column>\n\t\t\t</div>\n\t\t);\n\t},\n\t(prevProps, nextProps) => {\n\t\treturn (\n\t\t\tprevProps.products === nextProps.products &&\n\t\t\tprevProps.categories === nextProps.categories &&\n\t\t\tprevProps.currency === nextProps.currency &&\n\t\t\tprevProps.language === nextProps.language\n\t\t);\n\t}\n);\n\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n\trootPath?: string;\n\tonBranchSelect: (branchId: number) => void;\n}\n\nconst Branches = ({ branches = [], rootPath = \"\", onBranchSelect }: Props) => {\n\tconst Parent = ({ children, id }) => {\n\t\tif (onBranchSelect) return <div onClick={() => onBranchSelect(id)}>{children}</div>;\n\n\t\treturn <a href={`${rootPath}/${id}`}>{children}</a>;\n\t};\n\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<Parent key={id} id={id}>\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</Parent>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\nimport { IMAGE_BASE_URL } from \"./PublicMenu.constants\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tinstagram,\n\t\tfacebook,\n\t\twhatsapp,\n\t\ttelegram,\n\t\ttiktok,\n\t\trootPath,\n\t\tonBranchSelect,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\tconst getLogoImageSource = () => {\n\t\tif (!logoImage) return \"https://images.restaround.co/no-photo-128.webp\";\n\n\t\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n\t};\n\n\tconst getCoverImageSource = () => {\n\t\tif (!coverImage) return \"https://images.restaround.co/restaround-doodle.webp\";\n\n\t\tif (coverImage.includes(\"base64\") || coverImage.startsWith(\"https://\")) return coverImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${coverImage}`;\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={getCoverImageSource()}\n\t\t\t\tlogoImage={getLogoImageSource()}\n\t\t\t\tinstagram={instagram}\n\t\t\t\tfacebook={facebook}\n\t\t\t\twhatsapp={whatsapp}\n\t\t\t\ttelegram={telegram}\n\t\t\t\ttiktok={tiktok}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} onBranchSelect={onBranchSelect} rootPath={rootPath} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","instagram","facebook","whatsapp","telegram","tiktok","address","latitude","longitude","phone","noBranch","isEmpty","googleMapLink","_jsxs","className","styles","children","_jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Phone","size","shape","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Wifi","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","IMAGE_BASE_URL","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","memo","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","handleIntersection","useCallback","entries","bestMatchCategoryId","maxVisibility","forEach","entry","Number","getAttribute","visiblePercentage","intersectionRatio","useEffect","observer","IntersectionObserver","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","prevProps","nextProps","Branches","branches","rootPath","onBranchSelect","Parent","Container","Card","noBottomMargin","Flex","PublicMenu","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","includes","startsWith","productBlock","scrollToProductBlock"],"mappings":"24BAiCA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,YACAC,WACAC,WACAC,WACAC,aAEA,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,MAAEA,GAAUZ,GAAU,GACpDa,EAAWC,EAAQd,GAEnBe,EAAgB,qCAAqCL,KAAYC,IAyCvE,OACCK,EAAA,MAAA,CAAKC,UAAWC,EACfC,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKpB,EAAYqB,IAAKnB,EAAMc,UAAWC,IAC5CE,EAAK,MAAA,CAAAH,UAAWC,EAAcC,SAAcC,EAAXP,EAZd,IACpBG,EAACO,EAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DR,SAAA,CAAAC,EAAA,MAAA,CAA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BqF,EAAsBrF,GARM,CAACA,UAC7B,MAAMyF,EAA2C,QAA5BvF,EAAAmC,aAAA,EAAAA,EAAkBlC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5CyF,GAELA,EAAarF,eAAe,CAAEC,SAAU,SAAUsD,MAAO,SAAU,EAMnE+B,CAAqB1F,EAAW,IAgD7BpC,EAACsE,EAAQ,CACR1C,WAAYA,EACZ4C,SAAUA,EACVX,SAAUA,EACVhC,SAAUA,EACV4C,iBAAkBA,EAClBC,iBAnDyBtC,IACzBA,IAAeN,GAClB2F,EAAsBrF,EACtB,OAiCCpC,EAAC0G,EAAQ,CAACC,SAAUA,EAAUE,eAAgBA,EAAgBD,SAAUA,MAoBzE"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),s=require("react"),r=require("@sorocraft/ui"),t=require("@sorocraft/ui/icons"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),s=require("react"),r=require("@sorocraft/ui"),t=require("@sorocraft/ui/icons"),a=require("@sorocraft/js-utils"),n="PublicMenu-module_container__QLN6U",i="PublicMenu-module_categories__Iy6NC",c="Header-module_container__tenlF",o="Header-module_cover__BAWZK",l="Header-module_content__Gx4Al",d="Header-module_logo__4MTCm",u="Header-module_info__IchYA",m="Header-module_name__30wyw",h="Header-module_address__WOxXc",g="Header-module_social__AoP0z",_="Header-module_links__EeQxg";const j=({branch:s,coverImage:n,logoImage:i,name:j,instagram:x,facebook:p,whatsapp:v,telegram:f,tiktok:I})=>{const{address:b,latitude:k,longitude:N,phone:y}=s||{},P=a.isEmpty(s),C=`https://www.google.com/maps/place/${k},${N}`;return e.jsxs("div",{className:c,children:[e.jsx("img",{src:n,alt:j,className:o}),e.jsx("div",{className:l,children:P?e.jsx((()=>e.jsxs(r.Column,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e.jsx("img",{src:i,alt:j,className:d}),e.jsx("div",{className:u,children:e.jsx("h1",{className:m,children:j})})]})),{}):e.jsx((()=>e.jsxs(r.Row,{gap:1,children:[e.jsx("img",{src:i,alt:j,className:d}),e.jsxs("div",{className:u,children:[e.jsx("h1",{className:m,children:j}),e.jsx("a",{className:h,href:C,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(r.Row,{alignItems:"center",gap:.5,children:[e.jsx(r.SVGIcon,{icon:t.MarkerPin,theme:"dark"}),e.jsx("span",{children:b})]})})]})]})),{})}),!P&&e.jsx("div",{className:g,children:e.jsx("div",{className:_,children:e.jsxs(r.Row,{gap:2,children:[e.jsxs(r.Row,{alignItems:"center",justifyContent:"center",gap:.5,children:[y&&e.jsx(r.IconLink,{icon:t.Phone,href:`tel:+${y}`,size:"sm",shape:"circle",theme:"light"}),v&&e.jsx(r.IconLink,{icon:t.Whatsapp,href:`https://wa.me/${v}`,size:"sm",shape:"circle",theme:"light",target:"_blank"}),x&&e.jsx(r.IconLink,{icon:t.Instagram,href:x,size:"sm",shape:"circle",theme:"light",target:"_blank"}),f&&e.jsx(r.IconLink,{icon:t.Telegram,href:f,size:"sm",shape:"circle",theme:"light",target:"_blank"}),I&&e.jsx(r.IconLink,{icon:t.Tiktok,href:I,size:"sm",shape:"circle",theme:"light",target:"_blank"}),p&&e.jsx(r.IconLink,{icon:t.Facebook,href:p,size:"sm",shape:"circle",theme:"light",target:"_blank"})]}),e.jsx(r.Row,{children:e.jsx(r.SVGIcon,{icon:t.Wifi,size:"sm"})})]})})})]})},x=({categories:t,language:a,selectedCategoryId:n,onSelectCategory:c})=>{const o=s.useRef({}),l=e=>{(e=>{var s;const r=null===(s=null==o?void 0:o.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",inline:"center"})})(e),c(e)};return e.jsx("div",{className:i,children:e.jsx(r.Carousel,{gap:1,children:t.map((({id:s,translations:t})=>{const{name:i}=t.find((e=>e.language===a))||{};return e.jsx(r.CarouselItem,{children:e.jsx(r.Chip,{onClick:()=>l(s),type:r.UIElementType.BORDERED_PRIMARY,active:s===n,children:e.jsx("div",{ref:e=>o.current[s]=e,children:i})})},s)}))})})};var p={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var v={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const f="https://images.restaround.co",I=({product:s,currency:t,language:n})=>{const{translations:i,price:c,imageUrl:o}=s||{},{name:l,description:d}=i.find((e=>e.language===n))||{},u=a.priceFormatter(c,t||"AZN",n);return e.jsx("div",{className:v.container,children:e.jsxs(r.Row,{justifyContent:"space-between",children:[e.jsx("div",{className:v.data,children:e.jsxs(r.Column,{gap:.5,children:[e.jsx("h3",{className:v.name,children:l}),e.jsx("div",{className:v.description,children:d}),e.jsx("div",{className:v.price,children:u})]})}),o&&e.jsx("img",{src:o,alt:l,className:v.image})]})})},b=s.memo((({products:t,categories:n,currency:i,language:c,productBlocksRef:o,onCategoryInView:l})=>{const d=a.groupBy(t,"categoryId"),u=s.useCallback((e=>{let s=null,r=0;e.forEach((e=>{const t=Number(e.target.getAttribute("data-category-id")),a=e.intersectionRatio;a>r&&(r=a,s=t)})),s&&l(s)}),[l]);return s.useEffect((()=>{const e=new IntersectionObserver(u,{root:null,threshold:[.1,.5,.75]});return Object.values((null==o?void 0:o.current)||{}).forEach((s=>{s&&e.observe(s)})),()=>{e.disconnect()}}),[o,u]),e.jsx("div",{className:p.container,children:e.jsx(r.Column,{children:Object.keys(d).map((s=>{const t=n.find((({id:e})=>e===Number(s)))||{},{name:a}=((e,s)=>{var r,t;return(null===(t=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===t?void 0:t.call(r,(e=>e.language===s)))||{}})(t,c);return e.jsxs("div",{className:p.products,ref:e=>o.current[t.id]=e,"data-category-id":s,children:[e.jsx("h2",{className:p.category,children:a}),e.jsx("div",{className:p.list,children:e.jsx(r.Column,{gap:2,children:d[s].map((s=>e.jsx(I,{product:s,currency:i,language:c},s.id)))})})]},s)}))})})}),((e,s)=>e.products===s.products&&e.categories===s.categories&&e.currency===s.currency&&e.language===s.language));var k="Branches-module_branches__sOuoV",N="Branches-module_list__vYoT2",y="Branches-module_name__K0Z-4";const P=({branches:s=[],rootPath:t="",onBranchSelect:a})=>{const n=({children:s,id:r})=>a?e.jsx("div",{onClick:()=>a(r),children:s}):e.jsx("a",{href:`${t}/${r}`,children:s});return e.jsx("div",{className:k,children:e.jsx(r.Container,{className:N,children:s.map((({id:s,name:t})=>e.jsx(n,{id:s,children:e.jsx(r.Card,{noBottomMargin:!0,children:e.jsx(r.Flex,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e.jsx("h2",{className:y,children:t})})})},s)))})})};exports.PublicMenu=({data:r})=>{var t;const{name:a,coverImage:i,logoImage:c,branches:o=[],branchId:l,language:d,categories:u,products:m,currency:h,instagram:g,facebook:_,whatsapp:p,telegram:v,tiktok:I,rootPath:k,onBranchSelect:N}=r||{},y=o.length<=1,C=o.find((e=>e.id===Number(l))),w=y||!(null==C?void 0:C.name)?a:(null==C?void 0:C.name)||"",[L,R]=s.useState(null===(t=null==u?void 0:u[0])||void 0===t?void 0:t.id),A=s.useRef({});return e.jsxs("div",{className:n,children:[e.jsx(j,{branch:C,name:w,coverImage:i?i.includes("base64")||i.startsWith("https://")?i:`${f}/${i}`:"https://images.restaround.co/restaround-doodle.webp",logoImage:c?c.includes("base64")||c.startsWith("https://")?c:`${f}/${c}`:"https://images.restaround.co/no-photo-128.webp",instagram:g,facebook:_,whatsapp:p,telegram:v,tiktok:I}),y||l?e.jsxs(e.Fragment,{children:[e.jsx(x,{categories:u,language:d,selectedCategoryId:L,onSelectCategory:e=>{R(e),(e=>{var s;const r=null===(s=null==A?void 0:A.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),e.jsx(b,{categories:u,products:m,currency:h,language:d,productBlocksRef:A,onCategoryInView:e=>{e!==L&&R(e)}})]}):e.jsx(P,{branches:o,onBranchSelect:N,rootPath:k})]})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\nimport * as menuModels from \"src/models/menu\";\n\ninterface Props\n\textends Pick<\n\t\tmenuModels.PublicMenuData,\n\t\t| \"coverImage\"\n\t\t| \"logoImage\"\n\t\t| \"name\"\n\t\t| \"instagram\"\n\t\t| \"facebook\"\n\t\t| \"whatsapp\"\n\t\t| \"telegram\"\n\t\t| \"tiktok\"\n\t> {\n\tbranch?: branchModels.Branch;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tinstagram,\n\tfacebook,\n\twhatsapp,\n\ttelegram,\n\ttiktok,\n}: Props) => {\n\tconst { address, latitude, longitude, phone } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\t// const languageOptions = useMemo(\n\t// \t() =>\n\t// \t\t[\"az\", \"en\"].map((language) => ({\n\t// \t\t\tvalue: language,\n\t// \t\t\tlabel: language,\n\t// \t\t})),\n\t// \t[]\n\t// );\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>{noBranch ? <BusinessInfo /> : <BranchInfo />}</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row gap={2}>\n\t\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t\t{phone && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Phone}\n\t\t\t\t\t\t\t\t\t\thref={`tel:+${phone}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{whatsapp && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Whatsapp}\n\t\t\t\t\t\t\t\t\t\thref={`https://wa.me/${whatsapp}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{instagram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Instagram}\n\t\t\t\t\t\t\t\t\t\thref={instagram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{telegram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Telegram}\n\t\t\t\t\t\t\t\t\t\thref={telegram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{tiktok && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Tiktok}\n\t\t\t\t\t\t\t\t\t\thref={tiktok}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{facebook && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Facebook}\n\t\t\t\t\t\t\t\t\t\thref={facebook}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t<Row>\n\t\t\t\t\t\t\t\t<SVGIcon icon={Wifi} size=\"sm\" />\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\nexport const IMAGE_BASE_URL = \"https://images.restaround.co\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect, memo, useCallback } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\nimport styles from \"./Products.module.scss\";\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = memo(\n\t({ products, categories, currency, language, productBlocksRef, onCategoryInView }: Props) => {\n\t\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\t\tconst handleIntersection = useCallback(\n\t\t\t(entries: IntersectionObserverEntry[]) => {\n\t\t\t\tlet bestMatchCategoryId: number | null = null;\n\t\t\t\tlet maxVisibility = 0;\n\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\tconst visiblePercentage = entry.intersectionRatio;\n\n\t\t\t\t\t// Track the category block that has the highest visible percentage\n\t\t\t\t\tif (visiblePercentage > maxVisibility) {\n\t\t\t\t\t\tmaxVisibility = visiblePercentage;\n\t\t\t\t\t\tbestMatchCategoryId = categoryId;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Only update if the best matching category is different from the currently selected one\n\t\t\t\tif (bestMatchCategoryId) {\n\t\t\t\t\tonCategoryInView(bestMatchCategoryId);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onCategoryInView]\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tconst observer = new IntersectionObserver(handleIntersection, {\n\t\t\t\troot: null,\n\t\t\t\tthreshold: [0.1, 0.5, 0.75], // Different levels of visibility\n\t\t\t});\n\n\t\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\t\tif (block) {\n\t\t\t\t\tobserver.observe(block);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t};\n\t\t}, [productBlocksRef, handleIntersection]);\n\n\t\treturn (\n\t\t\t<div className={styles.container}>\n\t\t\t\t<Column>\n\t\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Column>\n\t\t\t</div>\n\t\t);\n\t},\n\t(prevProps, nextProps) => {\n\t\treturn (\n\t\t\tprevProps.products === nextProps.products &&\n\t\t\tprevProps.categories === nextProps.categories &&\n\t\t\tprevProps.currency === nextProps.currency &&\n\t\t\tprevProps.language === nextProps.language\n\t\t);\n\t}\n);\n\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n\tonBranchSelect: (branchId: number) => void;\n}\n\nconst Branches = ({ branches = [], onBranchSelect }: Props) => {\n\tconst Parent = ({ children, id }) => {\n\t\tif (onBranchSelect) return <div onClick={() => onBranchSelect(id)}>{children}</div>;\n\n\t\tconst pathname = typeof window !== \"undefined\" ? window?.location?.pathname : \"\";\n\n\t\treturn <a href={`${pathname}/${id}`}>{children}</a>;\n\t};\n\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<Parent key={id} id={id}>\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</Parent>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\nimport { IMAGE_BASE_URL } from \"./PublicMenu.constants\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tinstagram,\n\t\tfacebook,\n\t\twhatsapp,\n\t\ttelegram,\n\t\ttiktok,\n\t\tonBranchSelect,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\tconst getLogoImageSource = () => {\n\t\tif (!logoImage) return \"https://images.restaround.co/no-photo-128.webp\";\n\n\t\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n\t};\n\n\tconst getCoverImageSource = () => {\n\t\tif (!coverImage) return \"https://images.restaround.co/restaround-doodle.webp\";\n\n\t\tif (coverImage.includes(\"base64\") || coverImage.startsWith(\"https://\")) return coverImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${coverImage}`;\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={getCoverImageSource()}\n\t\t\t\tlogoImage={getLogoImageSource()}\n\t\t\t\tinstagram={instagram}\n\t\t\t\tfacebook={facebook}\n\t\t\t\twhatsapp={whatsapp}\n\t\t\t\ttelegram={telegram}\n\t\t\t\ttiktok={tiktok}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} onBranchSelect={onBranchSelect} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","instagram","facebook","whatsapp","telegram","tiktok","address","latitude","longitude","phone","noBranch","isEmpty","googleMapLink","_jsxs","jsxs","className","styles","children","_jsx","src","alt","jsx","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Phone","size","shape","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Wifi","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","IMAGE_BASE_URL","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","memo","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","handleIntersection","useCallback","entries","bestMatchCategoryId","maxVisibility","forEach","entry","Number","getAttribute","visiblePercentage","intersectionRatio","useEffect","observer","IntersectionObserver","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","prevProps","nextProps","Branches","branches","onBranchSelect","Parent","pathname","window","location","Container","Card","noBottomMargin","Flex","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","includes","startsWith","_Fragment","Fragment","productBlock","scrollToProductBlock"],"mappings":"4gBAiCA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,YACAC,WACAC,WACAC,WACAC,aAEA,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,MAAEA,GAAUZ,GAAU,GACpDa,EAAWC,UAAQd,GAEnBe,EAAgB,qCAAqCL,KAAYC,IAyCvE,OACCK,EAAAC,KAAA,MAAA,CAAKC,UAAWC,EACfC,SAAA,CAAAC,MAAA,MAAA,CAAKC,IAAKrB,EAAYsB,IAAKpB,EAAMe,UAAWC,IAC5CE,MAAK,MAAA,CAAAH,UAAWC,EAAcC,SAAGP,EAAWQ,EAAAG,KAZzB,IACpBR,EAAAC,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BA,MAoB/C"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\nimport * as menuModels from \"src/models/menu\";\n\ninterface Props\n\textends Pick<\n\t\tmenuModels.PublicMenuData,\n\t\t| \"coverImage\"\n\t\t| \"logoImage\"\n\t\t| \"name\"\n\t\t| \"instagram\"\n\t\t| \"facebook\"\n\t\t| \"whatsapp\"\n\t\t| \"telegram\"\n\t\t| \"tiktok\"\n\t> {\n\tbranch?: branchModels.Branch;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tinstagram,\n\tfacebook,\n\twhatsapp,\n\ttelegram,\n\ttiktok,\n}: Props) => {\n\tconst { address, latitude, longitude, phone } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\t// const languageOptions = useMemo(\n\t// \t() =>\n\t// \t\t[\"az\", \"en\"].map((language) => ({\n\t// \t\t\tvalue: language,\n\t// \t\t\tlabel: language,\n\t// \t\t})),\n\t// \t[]\n\t// );\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>{noBranch ? <BusinessInfo /> : <BranchInfo />}</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row gap={2}>\n\t\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t\t{phone && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Phone}\n\t\t\t\t\t\t\t\t\t\thref={`tel:+${phone}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{whatsapp && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Whatsapp}\n\t\t\t\t\t\t\t\t\t\thref={`https://wa.me/${whatsapp}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{instagram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Instagram}\n\t\t\t\t\t\t\t\t\t\thref={instagram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{telegram && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Telegram}\n\t\t\t\t\t\t\t\t\t\thref={telegram}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{tiktok && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Tiktok}\n\t\t\t\t\t\t\t\t\t\thref={tiktok}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{facebook && (\n\t\t\t\t\t\t\t\t\t<IconLink\n\t\t\t\t\t\t\t\t\t\ticon={Facebook}\n\t\t\t\t\t\t\t\t\t\thref={facebook}\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tshape=\"circle\"\n\t\t\t\t\t\t\t\t\t\ttheme=\"light\"\n\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t\t<Row>\n\t\t\t\t\t\t\t\t<SVGIcon icon={Wifi} size=\"sm\" />\n\t\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\nexport const IMAGE_BASE_URL = \"https://images.restaround.co\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect, memo, useCallback } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\nimport styles from \"./Products.module.scss\";\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = memo(\n\t({ products, categories, currency, language, productBlocksRef, onCategoryInView }: Props) => {\n\t\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\t\tconst handleIntersection = useCallback(\n\t\t\t(entries: IntersectionObserverEntry[]) => {\n\t\t\t\tlet bestMatchCategoryId: number | null = null;\n\t\t\t\tlet maxVisibility = 0;\n\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\tconst visiblePercentage = entry.intersectionRatio;\n\n\t\t\t\t\t// Track the category block that has the highest visible percentage\n\t\t\t\t\tif (visiblePercentage > maxVisibility) {\n\t\t\t\t\t\tmaxVisibility = visiblePercentage;\n\t\t\t\t\t\tbestMatchCategoryId = categoryId;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Only update if the best matching category is different from the currently selected one\n\t\t\t\tif (bestMatchCategoryId) {\n\t\t\t\t\tonCategoryInView(bestMatchCategoryId);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onCategoryInView]\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tconst observer = new IntersectionObserver(handleIntersection, {\n\t\t\t\troot: null,\n\t\t\t\tthreshold: [0.1, 0.5, 0.75], // Different levels of visibility\n\t\t\t});\n\n\t\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\t\tif (block) {\n\t\t\t\t\tobserver.observe(block);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn () => {\n\t\t\t\tobserver.disconnect();\n\t\t\t};\n\t\t}, [productBlocksRef, handleIntersection]);\n\n\t\treturn (\n\t\t\t<div className={styles.container}>\n\t\t\t\t<Column>\n\t\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Column>\n\t\t\t</div>\n\t\t);\n\t},\n\t(prevProps, nextProps) => {\n\t\treturn (\n\t\t\tprevProps.products === nextProps.products &&\n\t\t\tprevProps.categories === nextProps.categories &&\n\t\t\tprevProps.currency === nextProps.currency &&\n\t\t\tprevProps.language === nextProps.language\n\t\t);\n\t}\n);\n\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n\trootPath?: string;\n\tonBranchSelect: (branchId: number) => void;\n}\n\nconst Branches = ({ branches = [], rootPath = \"\", onBranchSelect }: Props) => {\n\tconst Parent = ({ children, id }) => {\n\t\tif (onBranchSelect) return <div onClick={() => onBranchSelect(id)}>{children}</div>;\n\n\t\treturn <a href={`${rootPath}/${id}`}>{children}</a>;\n\t};\n\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<Parent key={id} id={id}>\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</Parent>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\nimport { IMAGE_BASE_URL } from \"./PublicMenu.constants\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tinstagram,\n\t\tfacebook,\n\t\twhatsapp,\n\t\ttelegram,\n\t\ttiktok,\n\t\trootPath,\n\t\tonBranchSelect,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\tconst getLogoImageSource = () => {\n\t\tif (!logoImage) return \"https://images.restaround.co/no-photo-128.webp\";\n\n\t\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n\t};\n\n\tconst getCoverImageSource = () => {\n\t\tif (!coverImage) return \"https://images.restaround.co/restaround-doodle.webp\";\n\n\t\tif (coverImage.includes(\"base64\") || coverImage.startsWith(\"https://\")) return coverImage;\n\n\t\treturn `${IMAGE_BASE_URL}/${coverImage}`;\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={getCoverImageSource()}\n\t\t\t\tlogoImage={getLogoImageSource()}\n\t\t\t\tinstagram={instagram}\n\t\t\t\tfacebook={facebook}\n\t\t\t\twhatsapp={whatsapp}\n\t\t\t\ttelegram={telegram}\n\t\t\t\ttiktok={tiktok}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} onBranchSelect={onBranchSelect} rootPath={rootPath} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","instagram","facebook","whatsapp","telegram","tiktok","address","latitude","longitude","phone","noBranch","isEmpty","googleMapLink","_jsxs","jsxs","className","styles","children","_jsx","src","alt","jsx","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Phone","size","shape","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Wifi","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","IMAGE_BASE_URL","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","memo","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","handleIntersection","useCallback","entries","bestMatchCategoryId","maxVisibility","forEach","entry","Number","getAttribute","visiblePercentage","intersectionRatio","useEffect","observer","IntersectionObserver","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","prevProps","nextProps","Branches","branches","rootPath","onBranchSelect","Parent","Container","Card","noBottomMargin","Flex","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","includes","startsWith","productBlock","scrollToProductBlock"],"mappings":"4gBAiCA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,YACAC,WACAC,WACAC,WACAC,aAEA,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,MAAEA,GAAUZ,GAAU,GACpDa,EAAWC,UAAQd,GAEnBe,EAAgB,qCAAqCL,KAAYC,IAyCvE,OACCK,EAAAC,KAAA,MAAA,CAAKC,UAAWC,EACfC,SAAA,CAAAC,MAAA,MAAA,CAAKC,IAAKrB,EAAYsB,IAAKpB,EAAMe,UAAWC,IAC5CE,MAAK,MAAA,CAAAH,UAAWC,EAAcC,SAAGP,EAAWQ,EAAAG,KAZzB,IACpBR,EAAAC,KAACQ,SAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DT,SAAA,CAAAC,MAAA,MAAA,CAAKC,IAAKpB,EAAWqB,IAAKpB,EAAMe,UAAWC,IAC3CE,EAAAA,IAAK,MAAA,CAAAH,UAAWC,WACfE,EAAIG,IAAA,KAAA,CAAAN,UAAWC,EAAcC,SAAAjB,UAQ2B,CAAA,GAAMkB,EAAAA,KAjC9C,IAClBL,OAACc,EAAAA,IAAI,CAAAC,IAAK,EAACX,SAAA,CACVC,aAAKC,IAAKpB,EAAWqB,IAAKpB,EAAMe,UAAWC,IAC3CH,cAAKE,UAAWC,YAC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,EAEtE,GAAG8E,KAAkB9E,IAJL,iDAsBrBE,UAAWA,EACXC,SAAUA,EACVC,SAAUA,EACVC,SAAUA,EACVC,OAAQA,IAEPkI,GAAoBD,EAGrBzH,6BACCK,EAACG,IAAAyB,EACA,CAAAC,WAAYA,EACZC,SAAUA,EACVC,mBAAoBA,EACpBC,iBAjDyBK,IAC7BoF,EAAsBpF,GARM,CAACA,UAC7B,MAAMwF,EAA2C,QAA5BtF,EAAAmC,aAAA,EAAAA,EAAkBlC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5CwF,GAELA,EAAapF,eAAe,CAAEC,SAAU,SAAUsD,MAAO,SAAU,EAMnE8B,CAAqBzF,EAAW,IAgD7BrC,EAAAA,IAACuE,EAAQ,CACR1C,WAAYA,EACZ4C,SAAUA,EACVX,SAAUA,EACVhC,SAAUA,EACV4C,iBAAkBA,EAClBC,iBAnDyBtC,IACzBA,IAAeN,GAClB0F,EAAsBpF,EACtB,OAiCCrC,EAAAG,IAACwG,EAAQ,CAACC,SAAUA,EAAUE,eAAgBA,EAAgBD,SAAUA,MAoBzE"}
|
package/dist/models/menu.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restaround/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "React Library by restaround.co",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"homepage": "https://restaround.co",
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@sorocraft/js-utils": ">=1.0.10",
|
|
35
|
-
"@sorocraft/ui": "
|
|
35
|
+
"@sorocraft/ui": ">=1.0.59",
|
|
36
36
|
"react": ">=18.2.0",
|
|
37
37
|
"react-dom": ">=18.2.0"
|
|
38
38
|
},
|