From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,PDS_OTHER_BAD_TLD,URIBL_BLOCKED, URIBL_DBL_BLOCKED_OPENDNS autolearn=no autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1696301552; bh=2X0dhLMVoz4bNg9B0x1/2v6OT5mcEs2SpWyP1mfL/40=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=q3VQmFNB8fNKgLVS15W2owPjhV74aVTlJl1rusm7ws1CbYpXZ4B/hCO7XILrl595n l13hfQ6ahuVPni7kRjUlakaUCSrRtYnrWWbU1sF6VChBV14rrDR/Fjw0SjRO1jH4+S nQT4n8WYQQMvIj4BDE/aZwhqi5+6eVUooPMivVp0dhmNay0IPTGBIgf42bdnwTafJt DQluyDieduueeszk3RTgITDRyIuo68CxOfRmIlsQOfeXxbjnqmKki4yGxRW97mqZs+ 3WStBd6imt/m8l4xBUHaYY1joUi8nEosXrRlojcDu5P9p0yJ2cPHtE113Nlsc7BjOI NRUpaDxi4xCAA== Received: from localhost.localdomain (unknown [175.158.50.50]) by gnuweeb.org (Postfix) with ESMTPSA id 5057F24B8B9; Tue, 3 Oct 2023 09:52:31 +0700 (WIB) From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , Irvan Malik Azantha , Memet Zx , GNU/Weeb Mailing List Subject: [PATCH v1 09/13] feat(components): add component Date: Tue, 3 Oct 2023 09:51:42 +0700 Message-Id: <20231003025146.1557-10-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20231003025146.1557-1-kiizuha@gnuweeb.org> References: <20231003025146.1557-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This commit includes the component, which is for displaying recent messages from the GNU/Weeb's Telegram group chat. Signed-off-by: Muhammad Rizki --- src/lib/components/RecentMessages.svelte | 249 +++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 src/lib/components/RecentMessages.svelte diff --git a/src/lib/components/RecentMessages.svelte b/src/lib/components/RecentMessages.svelte new file mode 100644 index 0000000..25fb0eb --- /dev/null +++ b/src/lib/components/RecentMessages.svelte @@ -0,0 +1,249 @@ + + + +
+ +
+

Recent Group Messages

+
+ +
+ + {#if data.length === 0} +
+ Cannot Connect to the API.
API Connection failure. +
+ + {:else} + {#each data as msg} + +
+ +
+
+ +
+
+ +
+ +
+ {setupUserName(msg.first_name, msg.last_name).join("")} +
+ + {#if msg.reply_to_message_id !== null} + {#each getRepliedMessage(msg, data) as rpl} + + + + {/each} + {/if} + + {#if msg.message_type === "text"} +
+ {cleanMessageText(msg.text !== null ? msg.text : "")} +
+ + {:else if msg.message_type === "photo"} +
+
+ + + See + +
+ + {#if msg.text !== null} +
+ {cleanMessageText(msg.text)} +
+ + {/if} +
+ + {/if} + +
+ + Read more + +
+ +
+
+ +
+ +
+ + {/each} + {/if} + +
+ + +
+ Join + + + +
+
+ +
+ + + -- Muhammad Rizki