Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plasmic] Sync project Paziresh24/Search #316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Eitaa.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<svg
xmlns={"http://www.w3.org/2000/svg"}
viewBox={"0 0 24 24"}
className={classNames(
"plasmic-default__svg",
className,
"plasmic-default__svg plasmic_all__x8JdJ PlasmicServices_svg__lpwaK__F8SB4 undefined"
)}
role={"img"}
fill={"currentcolor"}
height={"1em"}
style={style}
{...restProps}
>
{title && <title>{title}</title>}

<path
d={
"M5.968 23.942a6.624 6.624 0 01-2.332-.83c-1.62-.929-2.829-2.593-3.217-4.426-.151-.717-.17-1.623-.15-7.207C.288 5.47.274 5.78.56 4.79c.142-.493.537-1.34.823-1.767C2.438 1.453 3.99.445 5.913.08c.384-.073.94-.08 6.056-.08 6.251 0 6.045-.009 7.066.314a6.807 6.807 0 014.314 4.184c.33.937.346 1.087.369 3.555l.02 2.23-.391.268c-.558.381-1.29 1.06-2.316 2.15-1.182 1.256-2.376 2.42-2.982 2.907-1.309 1.051-2.508 1.651-3.726 1.864-.634.11-1.682.067-2.302-.095-.553-.144-.517-.168-.726.464a6.355 6.355 0 00-.318 1.546l-.031.407-.146-.03c-1.215-.241-2.419-1.285-2.884-2.5a3.583 3.583 0 01-.26-1.219l-.016-.34-.309-.284c-.644-.59-1.063-1.312-1.195-2.061-.212-1.193.34-2.542 1.538-3.756 1.264-1.283 3.127-2.29 4.953-2.68.658-.14 1.818-.177 2.403-.075 1.138.198 2.067.773 2.645 1.639.182.271.195.31.177.555a.812.812 0 01-.183.493c-.465.651-1.848 1.348-3.336 1.68-2.625.585-4.294-.142-4.033-1.759.026-.163.04-.304.031-.313-.032-.032-.293.104-.575.3-.479.334-.903.984-1.05 1.607-.036.156-.05.406-.034.65.02.331.053.454.192.736.092.186.275.45.408.589l.24.251-.096.122a4.845 4.845 0 00-.677 1.217 3.635 3.635 0 00-.105 1.815c.103.461.421 1.095.739 1.468.242.285.797.764.886.764.024 0 .044-.048.044-.106.001-.23.184-.973.326-1.327.423-1.058 1.351-1.96 2.82-2.74.245-.13.952-.47 1.572-.757 1.36-.63 2.103-1.015 2.511-1.305 1.176-.833 1.903-2.065 2.14-3.625.086-.57.086-1.634 0-2.207-.368-2.438-2.195-4.096-4.818-4.37-2.925-.307-6.648 1.953-8.942 5.427-1.116 1.69-1.87 3.565-2.187 5.443-.123.728-.169 2.08-.093 2.75.193 1.704.822 3.078 1.903 4.156a6.531 6.531 0 001.87 1.313c2.368 1.13 4.99 1.155 7.295.071.996-.469 1.974-1.196 3.023-2.25 1.02-1.025 1.71-1.88 3.592-4.458 1.04-1.423 1.864-2.368 2.272-2.605l.15-.086-.019 3.091c-.018 2.993-.022 3.107-.123 3.561-.6 2.678-2.54 4.636-5.195 5.242l-.468.107-5.775.01c-4.734.008-5.85-.002-6.19-.056z"
}
></path>
</svg>
);
}

export default EitaaIcon;
/* prettier-ignore-end */
41 changes: 41 additions & 0 deletions .plasmic/plasmic/fragment_icons/icons/PlasmicIcon__Whatsapp.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<svg
xmlns={"http://www.w3.org/2000/svg"}
viewBox={"0 0 24 24"}
className={classNames(
"plasmic-default__svg",
className,
"plasmic-default__svg plasmic_all__x8JdJ PlasmicServices_svg___9I5Wv___S4vz undefined"
)}
role={"img"}
fill={"currentcolor"}
height={"1em"}
style={style}
{...restProps}
>
{title && <title>{title}</title>}

<path
d={
"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52s-.669-1.612-.916-2.207c-.242-.579-.487-.5-.669-.51a12.8 12.8 0 00-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413s.248-1.289.173-1.413c-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"
}
></path>
</svg>
);
}

export default WhatsappIcon;
/* prettier-ignore-end */
Original file line number Diff line number Diff line change
Expand Up @@ -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<React.ComponentProps<typeof AuthGlobalContext>, "children">
>;

fragmentProps?: Partial<
Omit<React.ComponentProps<typeof Fragment>, "children">
>;
growthbookGlobalContextProps?: Partial<
Omit<React.ComponentProps<typeof GrowthbookGlobalContext>, "children">
>;
}

export default function GlobalContextsProvider(
props: GlobalContextsProviderProps
) {
const { children, authGlobalContextProps, fragmentProps } = props;
const {
children,
authGlobalContextProps,
fragmentProps,
growthbookGlobalContextProps
} = props;

return (
<AuthGlobalContext
Expand All @@ -34,7 +42,31 @@ export default function GlobalContextsProvider(
: undefined
}
>
<Fragment {...fragmentProps}>{children}</Fragment>
<Fragment {...fragmentProps}>
<GrowthbookGlobalContext
{...growthbookGlobalContextProps}
apiHost={
growthbookGlobalContextProps &&
"apiHost" in growthbookGlobalContextProps
? growthbookGlobalContextProps.apiHost!
: "https://growthbook-api.paziresh24.com"
}
clientKey={
growthbookGlobalContextProps &&
"clientKey" in growthbookGlobalContextProps
? growthbookGlobalContextProps.clientKey!
: "sdk-St1dBftdp07geqtD"
}
previewAttributes={
growthbookGlobalContextProps &&
"previewAttributes" in growthbookGlobalContextProps
? growthbookGlobalContextProps.previewAttributes!
: undefined
}
>
{children}
</GrowthbookGlobalContext>
</Fragment>
</AuthGlobalContext>
);
}
181 changes: 124 additions & 57 deletions .plasmic/plasmic/paziresh_24_search/PlasmicSearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof useDollarState>[0] = React.useMemo(
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 }) => {
Expand Down
Loading
Loading