mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 00:03:13 +03:00
chore(tui): format dialog files with prettier (#55531)
This commit is contained in:
committed by
GitHub
Unverified
parent
1d07373cae
commit
6c706f2021
@@ -48,42 +48,42 @@ export function Dialog(
|
||||
return (
|
||||
<ThemeContextProvider context="dialog">
|
||||
<box
|
||||
onMouseDown={() => {
|
||||
dismiss = !!renderer.getSelection()
|
||||
}}
|
||||
onMouseUp={() => {
|
||||
if (dismiss) {
|
||||
dismiss = false
|
||||
return
|
||||
}
|
||||
props.onClose?.()
|
||||
}}
|
||||
width={dimensions().width}
|
||||
height={dimensions().height}
|
||||
alignItems="center"
|
||||
justifyContent={props.centered ? "center" : undefined}
|
||||
position="absolute"
|
||||
zIndex={3000}
|
||||
paddingTop={props.centered ? 0 : dimensions().height / 4}
|
||||
left={0}
|
||||
top={0}
|
||||
backgroundColor={RGBA.fromInts(0, 0, 0, 150)}
|
||||
>
|
||||
<box
|
||||
onMouseUp={(e: { stopPropagation(): void }) => {
|
||||
// A selection release must bubble up to the copy-on-select handler in
|
||||
// DialogProvider; the backdrop's dismiss flag keeps it from closing the dialog.
|
||||
if (renderer.getSelection()?.getSelectedText()) return
|
||||
dismiss = false
|
||||
e.stopPropagation()
|
||||
onMouseDown={() => {
|
||||
dismiss = !!renderer.getSelection()
|
||||
}}
|
||||
width={dialogWidth(props.size ?? "medium")}
|
||||
maxWidth={dimensions().width - 2}
|
||||
backgroundColor={theme.background.base}
|
||||
paddingTop={1}
|
||||
onMouseUp={() => {
|
||||
if (dismiss) {
|
||||
dismiss = false
|
||||
return
|
||||
}
|
||||
props.onClose?.()
|
||||
}}
|
||||
width={dimensions().width}
|
||||
height={dimensions().height}
|
||||
alignItems="center"
|
||||
justifyContent={props.centered ? "center" : undefined}
|
||||
position="absolute"
|
||||
zIndex={3000}
|
||||
paddingTop={props.centered ? 0 : dimensions().height / 4}
|
||||
left={0}
|
||||
top={0}
|
||||
backgroundColor={RGBA.fromInts(0, 0, 0, 150)}
|
||||
>
|
||||
{props.children}
|
||||
</box>
|
||||
<box
|
||||
onMouseUp={(e: { stopPropagation(): void }) => {
|
||||
// A selection release must bubble up to the copy-on-select handler in
|
||||
// DialogProvider; the backdrop's dismiss flag keeps it from closing the dialog.
|
||||
if (renderer.getSelection()?.getSelectedText()) return
|
||||
dismiss = false
|
||||
e.stopPropagation()
|
||||
}}
|
||||
width={dialogWidth(props.size ?? "medium")}
|
||||
maxWidth={dimensions().width - 2}
|
||||
backgroundColor={theme.background.base}
|
||||
paddingTop={1}
|
||||
>
|
||||
{props.children}
|
||||
</box>
|
||||
</box>
|
||||
</ThemeContextProvider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user