File tree Expand file tree Collapse file tree 6 files changed +27
-19
lines changed Expand file tree Collapse file tree 6 files changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,20 @@ export const BookEntryEditor: FC<{
7171 < Card className = { styles . bookEntryCard } >
7272 < div className = { styles . bookEntryHeader } >
7373 < span >
74+ { /* 收起展开 */ }
75+ < Tooltip
76+ relationship = "label"
77+ content = { expanded ? t ( "Collapse" ) : t ( "Expand" ) }
78+ >
79+ < Button
80+ icon = {
81+ expanded ? < ChevronUp24Regular /> : < ChevronDown24Regular />
82+ }
83+ appearance = "subtle"
84+ onClick = { ( ) => setExpanded ( ! expanded ) }
85+ aria-label = { expanded ? t ( "Collapse" ) : t ( "Expand" ) }
86+ />
87+ </ Tooltip >
7488 < Text weight = "semibold" >
7589 Entry { index + 1 } { entry_title ? `(${ entry_title } )` : "" }
7690 </ Text >
@@ -92,21 +106,6 @@ export const BookEntryEditor: FC<{
92106 ) }
93107 </ span >
94108 < div >
95- { /* 收起展开 */ }
96- < Tooltip
97- relationship = "label"
98- content = { expanded ? t ( "Collapse" ) : t ( "Expand" ) }
99- >
100- < Button
101- icon = {
102- expanded ? < ChevronUp24Regular /> : < ChevronDown24Regular />
103- }
104- appearance = "subtle"
105- onClick = { ( ) => setExpanded ( ! expanded ) }
106- aria-label = { expanded ? t ( "Collapse" ) : t ( "Expand" ) }
107- />
108- </ Tooltip >
109-
110109 < Tooltip content = { t ( "Delete this entry" ) } relationship = "label" >
111110 < Button
112111 icon = { < Delete24Regular /> }
Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ export const CharacterBookTab: FC<{
5353 } ;
5454
5555 const handleDeleteEntry = ( index : any ) => {
56+ const isConfirm = window . confirm (
57+ t ( "Are you sure you want to delete this entry?" )
58+ ) ;
59+ if ( ! isConfirm ) return ;
60+
5661 const newEntries = ( bookData . entries || [ ] ) . filter (
5762 ( _ : any , i : any ) => i !== index
5863 ) ;
Original file line number Diff line number Diff line change 180180 ],
181181 "Load image from url" : " Load image from url" ,
182182 "Load" : " Load" ,
183- "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect"
183+ "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect" ,
184+ "Are you sure you want to delete this entry?" : " Are you sure you want to delete this entry?"
184185}
Original file line number Diff line number Diff line change 192192 ],
193193 "Load image from url" : " Load image from url" ,
194194 "Load" : " Load" ,
195- "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect"
195+ "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect" ,
196+ "Are you sure you want to delete this entry?" : " Are you sure you want to delete this entry?"
196197}
Original file line number Diff line number Diff line change 192192 ],
193193 "Load image from url" : " Load image from url" ,
194194 "Load" : " Load" ,
195- "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect"
195+ "Copy/Paste character card current page will auto detect" : " Copy/Paste character card current page will auto detect" ,
196+ "Are you sure you want to delete this entry?" : " Are you sure you want to delete this entry?"
196197}
Original file line number Diff line number Diff line change 192192 ],
193193 "Load image from url" : " 从url加载图片" ,
194194 "Load" : " 加载" ,
195- "Copy/Paste character card current page will auto detect" : " 复制/粘贴角色卡当前页面将自动检测"
195+ "Copy/Paste character card current page will auto detect" : " 复制/粘贴角色卡当前页面将自动检测" ,
196+ "Are you sure you want to delete this entry?" : " 您确定要删除此条目吗?"
196197}
You can’t perform that action at this time.
0 commit comments