mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-19 05:07:08 +02:00
Improve text rendering by handling long words and centering text
Update emoji rendering to correctly handle long words and center text, and adjust the client-side preview to remove hashtags instead of emojis. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 1a295c79-6a41-4cf1-94cd-94aa3c4f96e6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/JcM96XE
This commit is contained in:
1 parent
3936220a94
commit
6898a0fca9
4 files changed
+81
-13
No files matched your search
@@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { ChevronLeft, ChevronRight, Send, Facebook, Instagram, Heart, MessageCircle, Share2, Bookmark } from 'lucide-react';
|
||||
import type { Media } from '@shared/schema';
|
||||
import { removeEmojis } from '@shared/emoji';
|
||||
import { removeHashtags } from '@shared/emoji';
|
||||
|
||||
interface PreviewModalProps {
|
||||
open: boolean;
|
||||
@@ -228,8 +228,8 @@ export function PreviewModal({
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) return [text];
|
||||
|
||||
// Remove emojis for better text rendering
|
||||
const cleanText = removeEmojis(text);
|
||||
// Remove hashtags while keeping emojis
|
||||
const cleanText = removeHashtags(text);
|
||||
ctx.font = `bold ${fontSize}px Arial, sans-serif`;
|
||||
const words = cleanText.split(' ');
|
||||
const lines: string[] = [];
|
||||
|
||||
Reference in new issue
Block a user