diff --git a/platforms/pictique/src/lib/fragments/Group/Group.svelte b/platforms/pictique/src/lib/fragments/Group/Group.svelte index d4967445..8d075112 100644 --- a/platforms/pictique/src/lib/fragments/Group/Group.svelte +++ b/platforms/pictique/src/lib/fragments/Group/Group.svelte @@ -6,27 +6,33 @@ interface IGroupProps extends HTMLAttributes { avatar: string; name: string; + text: string; unread?: boolean; callback: () => void; } - const { avatar, name, unread = false, callback, ...restProps }: IGroupProps = $props(); + const { avatar, name, unread = false, text, callback, ...restProps }: IGroupProps = $props(); + + const messageText = $derived(text.length < 80 ? text : `${text.substring(0, 80)}...`); diff --git a/platforms/pictique/src/lib/types.ts b/platforms/pictique/src/lib/types.ts index 4195a816..5883f51c 100644 --- a/platforms/pictique/src/lib/types.ts +++ b/platforms/pictique/src/lib/types.ts @@ -1,111 +1,120 @@ -import type { SVGAttributes } from 'svelte/elements'; +import type { SVGAttributes } from "svelte/elements"; export interface ISvgProps extends SVGAttributes { - size?: number | string; - color?: string; + size?: number | string; + color?: string; } export type CommentType = { - commentId: string; - name: string; - userImgSrc: string; - comment: string; - isUpVoted: boolean; - isDownVoted: boolean; - upVotes: number; - time: string; - replies: CommentType[]; + commentId: string; + name: string; + userImgSrc: string; + comment: string; + isUpVoted: boolean; + isDownVoted: boolean; + upVotes: number; + time: string; + replies: CommentType[]; }; export type PostData = { - createdAt: string | number | Date; - id: string; - avatar: string; - userId: string; - username: string; - imgUris: string[]; - caption: string; - time: string; - count: { - likes: number; - comments: number; - }; + createdAt: string | number | Date; + id: string; + avatar: string; + userId: string; + username: string; + imgUris: string[]; + caption: string; + time: string; + count: { + likes: number; + comments: number; + }; }; export interface Post { - id: string; - text: string; - images: string[]; - author: { - id: string; - handle: string; - name: string; - avatarUrl: string; - }; - createdAt: string; - likedBy: userProfile[]; - comments: { - id: string; - text: string; - author: { - id: string; - handle: string; - name: string; - avatarUrl: string; - }; - createdAt: string; - }[]; + id: string; + text: string; + images: string[]; + author: { + id: string; + handle: string; + name: string; + avatarUrl: string; + }; + createdAt: string; + likedBy: userProfile[]; + comments: { + id: string; + text: string; + author: { + id: string; + handle: string; + name: string; + avatarUrl: string; + }; + createdAt: string; + }[]; } export type userProfile = { - id: string; - handle: string; - name: string; - description: string; - avatarUrl: string; - totalPosts: number; - followers: number; - following: number; - posts: PostData[]; - username: string; + id: string; + handle: string; + name: string; + description: string; + avatarUrl: string; + totalPosts: number; + followers: number; + following: number; + posts: PostData[]; + username: string; }; export type Image = { - url: string; - alt: string; + url: string; + alt: string; }; export type GroupInfo = { - id: string; - name: string; - avatar: string; + id: string; + name?: string; + avatar: string; + text: string; + unread: boolean; + participants: { + id: string; + name?: string; + handle?: string; + ename?: string; + avatarUrl: string; + }[]; }; export type Chat = { - id: string; - avatar: string; - handle: string; - unread: boolean; - text: string; - participants: { - id: string; - name?: string; - handle?: string; - ename?: string; - avatarUrl: string; - }[]; - latestMessage: { - text: string; - isRead: boolean; - }; + id: string; + avatar: string; + name?: string; + unread: boolean; + text: string; + participants: { + id: string; + name?: string; + handle?: string; + ename?: string; + avatarUrl: string; + }[]; + latestMessage: { + text: string; + isRead: boolean; + }; }; export type MessageType = { - id: string; - avatar: string; - handle: string; - unread: boolean; - text: string; - name: string; - username: string; + id: string; + avatar: string; + handle: string; + unread: boolean; + text: string; + name: string; + username: string; }; diff --git a/platforms/pictique/src/routes/(protected)/+layout.svelte b/platforms/pictique/src/routes/(protected)/+layout.svelte index 63dd40ce..029e4b13 100644 --- a/platforms/pictique/src/routes/(protected)/+layout.svelte +++ b/platforms/pictique/src/routes/(protected)/+layout.svelte @@ -109,7 +109,9 @@
{#if route === '/home' || route === '/messages'}