- onOpenChange(false)}
- title="Close dialog"
- aria-label="Close"
- icon="x"
- size="sm"
- className="ml-auto absolute right-1 top-1"
- />
+ {!hideX && (
+
+ )}
-
- {title}
-
- {description && {description}
}
+
+ {title}
+
+ {description && {description}
}
{children}
diff --git a/src-web/hooks/Confirm.tsx b/src-web/hooks/Confirm.tsx
new file mode 100644
index 00000000..8a70b91f
--- /dev/null
+++ b/src-web/hooks/Confirm.tsx
@@ -0,0 +1,16 @@
+import { Button } from '../components/core/Button';
+import { HStack } from '../components/core/Stacks';
+
+interface Props {
+ hide: () => void;
+}
+export function Confirm({ hide }: Props) {
+ return (
+
+
+
+
+ );
+}
diff --git a/src-web/hooks/useConfirm.tsx b/src-web/hooks/useConfirm.tsx
new file mode 100644
index 00000000..efb6da84
--- /dev/null
+++ b/src-web/hooks/useConfirm.tsx
@@ -0,0 +1,14 @@
+import { useDialog } from '../components/DialogContext';
+import { Confirm } from './Confirm';
+
+export function useConfirm() {
+ const dialog = useDialog();
+ return ({ title, description }: { title: string; description?: string }) => {
+ dialog.show({
+ title,
+ description,
+ hideX: true,
+ render: Confirm,
+ });
+ };
+}
diff --git a/tailwind.config.cjs b/tailwind.config.cjs
index 1bd38959..b68b0367 100644
--- a/tailwind.config.cjs
+++ b/tailwind.config.cjs
@@ -15,7 +15,7 @@ module.exports = {
},
height: {
"xs": "1.5rem",
- "sm": "2.00rem",
+ "sm": "2.0rem",
"md": "2.5rem"
},
lineHeight: {
@@ -23,7 +23,7 @@ module.exports = {
"xs": "calc(1.5rem - 2px)",
"sm": "calc(2.0rem - 2px)",
"md": "calc(2.5rem - 2px)"
- }
+ },
},
fontFamily: {
"mono": ["JetBrains Mono", "Menlo", "monospace"],