@@ -3,20 +3,13 @@ import { type CSSProperties, useState } from "react";
33import { useTheme } from "@/shared/hooks/use-theme" ;
44import { Bar , Container , Section } from "@column-resizer/react" ;
55
6- import { Button } from "@/shared/ui/button" ;
7- import {
8- DialogBackdrop ,
9- DialogClose ,
10- DialogPopup ,
11- DialogPortal ,
12- DialogRoot ,
13- DialogTitle ,
14- } from "@/shared/ui/dialog" ;
156import { Toaster } from "@/shared/ui/sonner" ;
167import { AccountSwitcherDialog } from "@/features/settings/account-switcher-dialog" ;
178import { SettingsDialog } from "@/features/settings/settings-dialog" ;
189import { CommandPalette } from "@/features/command-palette" ;
1910import { BootstrapError } from "@/features/shell/ui/bootstrap-error" ;
11+ import { ConflictResolutionDialog } from "@/features/shell/ui/conflict-resolution-dialog" ;
12+ import { DeletePublishDialog } from "@/features/shell/ui/delete-publish-dialog" ;
2013import { EditorPane } from "@/features/shell/editor-pane" ;
2114import { NoteHistoryDialog } from "@/features/shell/note-history-dialog" ;
2215import { NotesPane } from "@/features/notes/ui/notes-pane" ;
@@ -26,7 +19,6 @@ import { useAppShortcuts } from "@/features/shell/use-app-shortcuts";
2619import { useRevealMainWindow } from "@/features/shell/use-reveal-main-window" ;
2720import { useShellController } from "@/features/shell/use-shell-controller" ;
2821import { useUIStore } from "@/features/settings/store/use-ui-store" ;
29- import { conflictDialogCopy } from "@/shared/lib/conflict-dialog-copy" ;
3022
3123function App ( ) {
3224 useTheme ( ) ;
@@ -63,17 +55,6 @@ function App() {
6355 return < BootstrapError error = { bootstrapError } onRetry = { retryBootstrap } /> ;
6456 }
6557
66- const chooseConflictDialog = conflictDialogCopy (
67- chooseConflictDialogProps . hasDeleteCandidate ,
68- ) ;
69- const defaultRestoreConflictLabel =
70- chooseConflictDialogProps . hasDeleteCandidate
71- ? "Restore note"
72- : "Choose shown version" ;
73- const restoreConflictLabel = chooseConflictDialogProps . pending
74- ? "Restoring…"
75- : defaultRestoreConflictLabel ;
76-
7758 return (
7859 < div
7960 className = "text-foreground relative h-full min-h-0 overflow-hidden"
@@ -137,85 +118,8 @@ function App() {
137118 < PublishDialog { ...publishDialogProps } />
138119 < PublishShortNoteDialog { ...publishShortNoteDialogProps } />
139120 < NoteHistoryDialog { ...noteHistoryDialogProps } />
140- < DialogRoot
141- open = { chooseConflictDialogProps . open }
142- onOpenChange = { chooseConflictDialogProps . onOpenChange }
143- >
144- < DialogPortal >
145- < DialogBackdrop />
146- < DialogPopup className = "w-full max-w-sm p-6" >
147- < DialogTitle className = "text-base font-semibold" >
148- { chooseConflictDialog . title }
149- </ DialogTitle >
150- < p className = "text-muted-foreground mt-2 text-sm" >
151- { chooseConflictDialog . description }
152- </ p >
153- < div className = "mt-5 flex justify-end gap-2" >
154- < DialogClose className = "text-muted-foreground hover:text-foreground rounded-md px-3 py-1.5 text-sm transition-colors" >
155- Cancel
156- </ DialogClose >
157- { chooseConflictDialogProps . hasDeleteCandidate ? (
158- < Button
159- disabled = { chooseConflictDialogProps . pending }
160- onClick = { chooseConflictDialogProps . onKeepDeleted }
161- size = "sm"
162- variant = "destructive"
163- >
164- { chooseConflictDialogProps . pending
165- ? "Deleting…"
166- : "Keep deleted" }
167- </ Button >
168- ) : null }
169- < Button
170- disabled = { chooseConflictDialogProps . pending }
171- onClick = { chooseConflictDialogProps . onRestore }
172- size = "sm"
173- variant = "secondary"
174- >
175- { restoreConflictLabel }
176- </ Button >
177- < Button
178- disabled = { chooseConflictDialogProps . pending }
179- onClick = { chooseConflictDialogProps . onMerge }
180- size = "sm"
181- variant = "default"
182- >
183- { chooseConflictDialogProps . pending ? "Merging…" : "Merge draft" }
184- </ Button >
185- </ div >
186- </ DialogPopup >
187- </ DialogPortal >
188- </ DialogRoot >
189- < DialogRoot
190- open = { deletePublishDialogProps . open }
191- onOpenChange = { deletePublishDialogProps . onOpenChange }
192- >
193- < DialogPortal >
194- < DialogBackdrop />
195- < DialogPopup className = "w-full max-w-sm p-6" >
196- < DialogTitle className = "text-base font-semibold" >
197- Delete from Nostr?
198- </ DialogTitle >
199- < p className = "text-muted-foreground mt-2 text-sm" >
200- This will request relays to delete the published note. Relays may
201- not honor the request, and copies may still exist elsewhere.
202- </ p >
203- < div className = "mt-5 flex justify-end gap-2" >
204- < DialogClose className = "text-muted-foreground hover:text-foreground rounded-md px-3 py-1.5 text-sm transition-colors" >
205- Cancel
206- </ DialogClose >
207- < Button
208- disabled = { deletePublishDialogProps . pending }
209- onClick = { deletePublishDialogProps . onConfirm }
210- size = "sm"
211- variant = "destructive"
212- >
213- { deletePublishDialogProps . pending ? "Deleting…" : "Delete" }
214- </ Button >
215- </ div >
216- </ DialogPopup >
217- </ DialogPortal >
218- </ DialogRoot >
121+ < ConflictResolutionDialog { ...chooseConflictDialogProps } />
122+ < DeletePublishDialog { ...deletePublishDialogProps } />
219123 < CommandPalette
220124 availableTagPaths = { sidebarPaneProps . availableTagPaths }
221125 open = { commandPaletteOpen }
0 commit comments