diff --git a/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Eitaa.tsx b/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Eitaa.tsx new file mode 100644 index 00000000..80ad09eb --- /dev/null +++ b/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Eitaa.tsx @@ -0,0 +1,41 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ +import React from "react"; +import { classNames } from "@plasmicapp/react-web"; + +export type EitaaIconProps = React.ComponentProps<"svg"> & { + title?: string; +}; + +export function EitaaIcon(props: EitaaIconProps) { + const { className, style, title, ...restProps } = props; + return ( + + {title && {title}} + + + + ); +} + +export default EitaaIcon; +/* prettier-ignore-end */ diff --git a/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Whatsapp.tsx b/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Whatsapp.tsx new file mode 100644 index 00000000..49ce32b2 --- /dev/null +++ b/.plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Whatsapp.tsx @@ -0,0 +1,41 @@ +// @ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* prettier-ignore-start */ +import React from "react"; +import { classNames } from "@plasmicapp/react-web"; + +export type WhatsappIconProps = React.ComponentProps<"svg"> & { + title?: string; +}; + +export function WhatsappIcon(props: WhatsappIconProps) { + const { className, style, title, ...restProps } = props; + return ( + + {title && {title}} + + + + ); +} + +export default WhatsappIcon; +/* prettier-ignore-end */ diff --git a/.plasmic/plasmic/paziresh_24_search/PlasmicGlobalContextsProvider.tsx b/.plasmic/plasmic/paziresh_24_search/PlasmicGlobalContextsProvider.tsx index 402092d5..8b67d1c8 100644 --- a/.plasmic/plasmic/paziresh_24_search/PlasmicGlobalContextsProvider.tsx +++ b/.plasmic/plasmic/paziresh_24_search/PlasmicGlobalContextsProvider.tsx @@ -8,22 +8,30 @@ import * as React from "react"; import { hasVariant, ensureGlobalVariants } from "@plasmicapp/react-web"; import { AuthGlobalContext } from "@/common/fragment/authGlobalContext"; // plasmic-import: qyJQby9Pzcoc/codeComponent import { Fragment } from "@/common/fragment/designSystemGlobalContext"; // plasmic-import: 3GeFj3s3tzRm/codeComponent +import { GrowthbookGlobalContext } from "@/common/fragment/growthbookGlobalContext"; // plasmic-import: p_3q3KAjUnHO/codeComponent export interface GlobalContextsProviderProps { children?: React.ReactElement; authGlobalContextProps?: Partial< Omit, "children"> >; - fragmentProps?: Partial< Omit, "children"> >; + growthbookGlobalContextProps?: Partial< + Omit, "children"> + >; } export default function GlobalContextsProvider( props: GlobalContextsProviderProps ) { - const { children, authGlobalContextProps, fragmentProps } = props; + const { + children, + authGlobalContextProps, + fragmentProps, + growthbookGlobalContextProps + } = props; return ( - {children} + + + {children} + + ); } diff --git a/.plasmic/plasmic/paziresh_24_search/PlasmicSearchResults.tsx b/.plasmic/plasmic/paziresh_24_search/PlasmicSearchResults.tsx index 69cd0337..5b71f8d7 100644 --- a/.plasmic/plasmic/paziresh_24_search/PlasmicSearchResults.tsx +++ b/.plasmic/plasmic/paziresh_24_search/PlasmicSearchResults.tsx @@ -170,6 +170,8 @@ function PlasmicSearchResults__RenderFunc(props: { const refsRef = React.useRef({}); const $refs = refsRef.current; + const $globalActions = useGlobalActions?.(); + const currentUser = useCurrentUser?.() || {}; const stateSpecs: Parameters[0] = React.useMemo( @@ -310,7 +312,28 @@ function PlasmicSearchResults__RenderFunc(props: { data-plasmic-override={overrides.productCard} actionButtons={(() => { try { - return currentItem.actions; + return (() => { + if ( + typeof $ctx.Growthbook?.["theme-config"]?.[ + "search_result:show_first_free_time" + ] === "undefined" + ) { + return currentItem.actions; + } + if ( + !$ctx.Growthbook["theme-config"][ + "search_result:show_first_free_time" + ] + ) { + currentItem.actions = currentItem.actions.map( + action => ({ + ...action, + top_title: "" + }) + ); + } + return currentItem.actions; + })(); } catch (e) { if ( e instanceof TypeError || @@ -387,7 +410,22 @@ function PlasmicSearchResults__RenderFunc(props: { })()} badges={(() => { try { - return currentItem.badges; + return (() => { + if ( + typeof $ctx.Growthbook?.["theme-config"]?.[ + "search_result:show_available_time" + ] === "undefined" + ) { + return currentItem.badges; + } + return $ctx.Growthbook?.["theme-config"]?.[ + "search_result:show_available_time" + ] + ? currentItem.badges + : currentItem.badges.filter( + badge => !badge.title.includes("فعال شدن نوبت") + ); + })(); } catch (e) { if ( e instanceof TypeError || @@ -463,44 +501,39 @@ function PlasmicSearchResults__RenderFunc(props: { ? (() => { const actionArgs = { customFunction: async () => { - return (() => { - return fetch( - "https://www.paziresh24.com/api/sv2ctr", - { - headers: { - accept: "application/json, text/plain, */*", - "accept-language": "fa", - "content-type": "application/json", - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "same-origin" - }, - body: JSON.stringify({ - terminal_id: document.cookie - .split("; ") - .find(row => - row.startsWith("terminal_id") - ) - ? document.cookie - .split("; ") - .find(row => - row.startsWith("terminal_id") - ) - .split("=")[1] - : "sample-empty-terminal-id-cookie", - id: currentItem._id, - position: currentItem.position, - query_id: - $props.searchResultResponse.search - .query_id, - server_id: currentItem.server_id, - type: currentItem.type - }), - method: "POST", - credentials: "include" - } - ); - })(); + return fetch( + "https://www.paziresh24.com/api/sv2ctr", + { + headers: { + accept: "application/json, text/plain, */*", + "accept-language": "fa", + "content-type": "application/json", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-origin" + }, + body: JSON.stringify({ + terminal_id: document.cookie + .split("; ") + .find(row => row.startsWith("terminal_id")) + ? document.cookie + .split("; ") + .find(row => + row.startsWith("terminal_id") + ) + .split("=")[1] + : "sample-empty-terminal-id-cookie", + id: currentItem._id, + position: currentItem.position, + query_id: + $props.searchResultResponse.search.query_id, + server_id: currentItem.server_id, + type: currentItem.type + }), + method: "POST", + credentials: "include" + } + ); } }; return (({ customFunction }) => { @@ -841,6 +874,42 @@ function PlasmicSearchResults__RenderFunc(props: { onMount={async () => { const $steps = {}; + $steps["setGrowthbookAttributes"] = true + ? (() => { + const actionArgs = { + args: [ + (() => { + try { + return { + url: window.location.href + }; + } catch (e) { + if ( + e instanceof TypeError || + e?.plasmicType === "PlasmicUndefinedDataError" + ) { + return undefined; + } + throw e; + } + })() + ] + }; + return $globalActions[ + "GrowthbookGlobalContext.setAttributes" + ]?.apply(null, [...actionArgs.args]); + })() + : undefined; + if ( + $steps["setGrowthbookAttributes"] != null && + typeof $steps["setGrowthbookAttributes"] === "object" && + typeof $steps["setGrowthbookAttributes"].then === "function" + ) { + $steps["setGrowthbookAttributes"] = await $steps[ + "setGrowthbookAttributes" + ]; + } + $steps["sendClarityCustomTagsEventRunCode"] = true ? (() => { const actionArgs = { @@ -881,23 +950,21 @@ function PlasmicSearchResults__RenderFunc(props: { ? (() => { const actionArgs = { customFunction: async () => { - return (() => { - return fetch( - "https://api.paziresh24.com/V1/doctor/profile", - { credentials: "include" } - ) - .then(response => response.json()) - .then(data => { - console.log(data); - if (data.data.id) { - $state.visibilityOfShowMySearchPerformance = true; - console.log( - "Visibility of Show My Search Performance:", - $state.visibilityOfShowMySearchPerformance - ); - } - }); - })(); + return fetch( + "https://api.paziresh24.com/V1/doctor/profile", + { credentials: "include" } + ) + .then(response => response.json()) + .then(data => { + console.log(data); + if (data.data.id) { + $state.visibilityOfShowMySearchPerformance = true; + console.log( + "Visibility of Show My Search Performance:", + $state.visibilityOfShowMySearchPerformance + ); + } + }); } }; return (({ customFunction }) => { diff --git a/plasmic.json b/plasmic.json index 9b2b0417..f9c36542 100644 --- a/plasmic.json +++ b/plasmic.json @@ -75,7 +75,8 @@ "componentImportPath": "@plasmicpkgs/plasmic-basic-components" } ], - "customFunctions": [] + "customFunctions": [], + "jsBundleThemes": [] }, { "projectId": "oBJtsp5RgVpcN6KCrDTuQT", @@ -179,6 +180,16 @@ "id": "zb1oqVXdrxPK", "name": "XIcon", "moduleFilePath": "plasmic/fragment_icons/icons/PlasmicIcon__X.tsx" + }, + { + "id": "oob3UzcKBsd_", + "name": "WhatsappIcon", + "moduleFilePath": "plasmic/fragment_icons/icons/PlasmicIcon__Whatsapp.tsx" + }, + { + "id": "qxWwW7vbw7na", + "name": "EitaaIcon", + "moduleFilePath": "plasmic/fragment_icons/icons/PlasmicIcon__Eitaa.tsx" } ], "images": [ @@ -205,8 +216,7 @@ "componentImportPath": "@plasmicapp/react-web/lib/data-sources" } ], - "customFunctions": [], - "jsBundleThemes": [] + "customFunctions": [] }, { "projectId": "sqPBLwEBBKHA2WDuGb17eV", @@ -296,7 +306,8 @@ "componentImportPath": "@plasmicpkgs/radix-ui" } ], - "customFunctions": [] + "customFunctions": [], + "jsBundleThemes": [] }, { "projectId": "58GpZjZCWTaJ8AUhpCwt2K", @@ -318,7 +329,8 @@ "componentImportPath": "@plasmicpkgs/react-awesome-reveal" } ], - "customFunctions": [] + "customFunctions": [], + "jsBundleThemes": [] }, { "projectId": "h9Dbk9ygddw7UVEq1NNhKi", @@ -460,8 +472,7 @@ "componentImportPath": "@plasmicapp/react-web/lib/data-sources" } ], - "customFunctions": [], - "jsBundleThemes": [] + "customFunctions": [] }, { "projectId": "sMdpLWyxbzDCruwMRffW2m", @@ -589,6 +600,12 @@ "name": "Fragment", "displayName": "Fragment", "componentImportPath": "@/common/fragment/designSystemGlobalContext" + }, + { + "id": "p_3q3KAjUnHO", + "name": "GrowthbookGlobalContext", + "displayName": "GrowthbookGlobalContext", + "componentImportPath": "@/common/fragment/growthbookGlobalContext" } ], "customFunctions": [ @@ -627,7 +644,8 @@ "componentImportPath": "@plasmicpkgs/plasmic-query" } ], - "customFunctions": [] + "customFunctions": [], + "jsBundleThemes": [] }, { "projectId": "qQzsBf58SqzNJX45iggq96", diff --git a/plasmic.lock b/plasmic.lock index 576a87cd..19f741d8 100644 --- a/plasmic.lock +++ b/plasmic.lock @@ -16,7 +16,7 @@ }, { "projectId": "oBJtsp5RgVpcN6KCrDTuQT", - "version": "1.2.0", + "version": "1.3.0", "dependencies": {}, "lang": "ts", "fileLocks": [ @@ -129,6 +129,16 @@ "assetId": "oBJtsp5RgVpcN6KCrDTuQT", "type": "projectCss", "checksum": "c1c4e2808e07c97cfeb13d9cc075734c" + }, + { + "type": "icon", + "assetId": "oob3UzcKBsd_", + "checksum": "48b18a7d0f3c7534678907f308ebd125" + }, + { + "type": "icon", + "assetId": "qxWwW7vbw7na", + "checksum": "5020e76547cd1c8acc6eee036b77141c" } ], "codegenVersion": "0.0.1" @@ -183,10 +193,10 @@ }, { "projectId": "h9Dbk9ygddw7UVEq1NNhKi", - "version": "5.6.0", + "version": "5.6.1", "dependencies": { "sqPBLwEBBKHA2WDuGb17eV": "0.10.0", - "oBJtsp5RgVpcN6KCrDTuQT": "1.2.0", + "oBJtsp5RgVpcN6KCrDTuQT": "1.3.0", "caTPwKxj5ZrD9LQ7DMdK4Z": "3.34.0" }, "lang": "ts", @@ -298,8 +308,8 @@ "projectId": "sMdpLWyxbzDCruwMRffW2m", "version": "latest", "dependencies": { - "h9Dbk9ygddw7UVEq1NNhKi": "5.4.2", - "oBJtsp5RgVpcN6KCrDTuQT": "1.1.0", + "h9Dbk9ygddw7UVEq1NNhKi": "5.6.1", + "oBJtsp5RgVpcN6KCrDTuQT": "1.3.0", "sqPBLwEBBKHA2WDuGb17eV": "0.10.0", "caTPwKxj5ZrD9LQ7DMdK4Z": "3.34.0", "58GpZjZCWTaJ8AUhpCwt2K": "3.23.0", @@ -314,7 +324,7 @@ }, { "assetId": "sMdpLWyxbzDCruwMRffW2m", - "checksum": "44f28e9d84f925a5d308221990edce4a", + "checksum": "28d5dbf2a966c4125e9610f3987adc69", "type": "globalContexts" }, { @@ -340,12 +350,12 @@ { "type": "renderModule", "assetId": "XhSI4pxMLR3L", - "checksum": "90f7f2e8d2b6ed530137610696c7a6a8" + "checksum": "24fc3641ac533059b73211180f3f65fa" }, { "type": "cssRules", "assetId": "XhSI4pxMLR3L", - "checksum": "90f7f2e8d2b6ed530137610696c7a6a8" + "checksum": "24fc3641ac533059b73211180f3f65fa" }, { "type": "renderModule",