This commit is contained in:
payacom
2026-08-11 19:39:10 +03:30
parent 491040f752
commit 54623fb720
74 changed files with 1361 additions and 366 deletions

View File

@@ -1,6 +1,8 @@
import { getApiBaseUrl } from "@/components/main/BaseUrl";
import type { PostLinkKind } from "@/lib/postLinkCaption";
export type StoryTextOverlay = {
type?: "text";
text: string;
x: number;
y: number;
@@ -11,12 +13,25 @@ export type StoryTextOverlay = {
align?: "left" | "center" | "right";
};
/** اورلی لینک روی استوری — همون ۶ مورد قابل‌لینک ثبت پست (پکیج/پروژه/بیلبورد/فروشگاه/کالا/رزرو) */
export type StoryLinkOverlay = {
type: "link";
link_kind: PostLinkKind;
link_id: string;
link_title: string;
x: number;
y: number;
rotation?: number;
};
export type StoryOverlay = StoryTextOverlay | StoryLinkOverlay;
export type StoryItem = {
_id: string;
media_path: string;
media_type: "image" | "video";
linked_post_id?: string | null;
overlays?: StoryTextOverlay[];
overlays?: StoryOverlay[];
createdAt?: string;
expires_at?: string;
viewed?: boolean;
@@ -31,6 +46,7 @@ export type StoryFeedUser = {
first_name: string;
last_name: string;
profile_image?: string;
verify_badge?: string;
};
stories: StoryItem[];
has_unviewed: boolean;
@@ -73,7 +89,7 @@ export async function markStoryViewed(
export async function createStoryBase64(
file: { name: string; type: string; data: string },
token: string,
overlays: StoryTextOverlay[] = []
overlays: StoryOverlay[] = []
): Promise<void> {
const res = await fetch(`${getApiBaseUrl()}/stories/create-base64`, {
method: "POST",
@@ -91,7 +107,7 @@ export async function createStoryBase64(
export async function updateStoryOverlays(
storyId: string,
overlays: StoryTextOverlay[],
overlays: StoryOverlay[],
token: string
): Promise<void> {
const res = await fetch(`${getApiBaseUrl()}/stories/${storyId}`, {

View File

@@ -1,10 +1,16 @@
import { getApiBaseUrl } from "@/components/main/BaseUrl";
export type ExploreInteractionPayload = {
targetType: "post" | "profile" | "academy";
targetType:
| "post"
| "profile"
| "academy"
| "shop_product"
| "academy_course"
| "billboard";
targetId: string;
authorId?: string;
contentType?: "image" | "video" | "academy";
contentType?: "image" | "video" | "academy" | "shop_product" | "billboard";
action?:
| "view"
| "profile_visit"