From dcc100d646797fa1358c83af995c734a1931f7ac Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 14 Sep 2026 20:43:58 +0800 Subject: [PATCH] refactor: delete StickerTabs.tsx (#1899 #1900) --- .../StickerPanel/components/StickerTabs.tsx | 136 ------------------ 1 file changed, 136 deletions(-) delete mode 100644 apps/web/src/pages/editing-planner/components/StickerPanel/components/StickerTabs.tsx diff --git a/apps/web/src/pages/editing-planner/components/StickerPanel/components/StickerTabs.tsx b/apps/web/src/pages/editing-planner/components/StickerPanel/components/StickerTabs.tsx deleted file mode 100644 index 566523f74..000000000 --- a/apps/web/src/pages/editing-planner/components/StickerPanel/components/StickerTabs.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import React, { useState } from "react" -import type { StickerType, TextStickerPreset } from "../../../types" -import { TEXT_STICKER_PRESET_LABELS } from "../../../types" -import { EMOJI_LIST, TEXT_PRESET_STYLES } from "../constants" - -export interface StickerTabsProps { - activeTab: StickerType - onTabChange: (tab: StickerType) => void - textInput: string - onTextInputChange: (val: string) => void - onAddEmoji: (emoji: string) => void - onAddImage: (url: string) => void - onAddText: (text: string) => void -} - -export const StickerTabs: React.FC = ({ - activeTab, - onTabChange, - textInput, - onTextInputChange, - onAddEmoji, - onAddImage, - onAddText, -}) => { - const [imageUrl, setImageUrl] = useState("") - - const handleImageAdd = () => { - if (imageUrl.trim()) { - onAddImage(imageUrl.trim()) - setImageUrl("") - } - } - - const handleTextAdd = () => { - if (textInput.trim()) { - onAddText(textInput.trim()) - } - } - - return ( - <> - {/* 类型 Tab */} -
- {(["emoji", "image", "text"] as StickerType[]).map((t) => ( - - ))} -
- - {/* Tab 内容区 */} -
- {/* Emoji 素材库 */} - {activeTab === "emoji" && ( -
- {EMOJI_LIST.map((emoji) => ( - - ))} -
- )} - - {/* 图片贴纸 */} - {activeTab === "image" && ( -
- setImageUrl(e.target.value)} - onKeyDown={(e) => { - if (e.key === "Enter" && imageUrl.trim()) { - onAddImage(imageUrl.trim()) - setImageUrl("") - } - }} - /> - -
- )} - - {/* 文字花字 */} - {activeTab === "text" && ( -
-
- onTextInputChange(e.target.value)} - /> - -
-
-
花字预设预览
-
- {(Object.keys(TEXT_STICKER_PRESET_LABELS) as TextStickerPreset[]).map((p) => ( -
- 示例 -
{TEXT_STICKER_PRESET_LABELS[p]}
-
- ))} -
-
-
- )} -
- - ) -}