feat: official Postiz icon + strip HTML from post content display
Release APK / build (push) Has been cancelled
Release APK / build (push) Has been cancelled
- Replace icon.png with official Postiz logo (1024x1024, generated from upstream postiz.svg at gitroomhq/postiz-app) - Add lib/stripHtml.ts: converts <br>/<p> to newlines, strips all tags, decodes HTML entities - PostCard: use stripHtml on content before truncation and display - posts.tsx: use stripHtml for context menu preview and clipboard copy (API payloads keep original HTML for retry/reschedule) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import { PostCard } from "@/components/PostCard";
|
||||
import { PostizPost, usePostiz } from "@/context/PostizContext";
|
||||
import { useColors } from "@/hooks/useColors";
|
||||
import { extractError } from "@/lib/extractError";
|
||||
import { stripHtml } from "@/lib/stripHtml";
|
||||
|
||||
const SORT_STORAGE_KEY = "postiz_posts_sort";
|
||||
|
||||
@@ -193,14 +194,15 @@ export default function PostsScreen() {
|
||||
const showContextMenu = (post: PostizPost) => {
|
||||
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
||||
|
||||
const preview = post.content.slice(0, 60) + (post.content.length > 60 ? "…" : "");
|
||||
const plain = stripHtml(post.content);
|
||||
const preview = plain.slice(0, 60) + (plain.length > 60 ? "…" : "");
|
||||
|
||||
const buttons: Array<{ text: string; style?: "cancel" | "destructive" | "default"; onPress?: () => void }> = [];
|
||||
|
||||
buttons.push({
|
||||
text: "Copy text",
|
||||
onPress: async () => {
|
||||
await Clipboard.setStringAsync(post.content);
|
||||
await Clipboard.setStringAsync(stripHtml(post.content));
|
||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||
setCopyToast(true);
|
||||
setTimeout(() => setCopyToast(false), 2000);
|
||||
|
||||
Reference in New Issue
Block a user