Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

wip: checkpoint

Manav Rathi0a6ffb226f4a
diff --git a/web/packages/base/components/MiniDialog.tsx b/web/packages/base/components/MiniDialog.tsx
index 369b150424..a946bc3eeb 100644
--- a/web/packages/base/components/MiniDialog.tsx
+++ b/web/packages/base/components/MiniDialog.tsx
@@ -52,44 +52,50 @@ export interface MiniDialogAttributes {
*/
nonClosable?: boolean;
/**
- * Customize the primary action button offered by the dialog box.
+ * Customize the primary action button shown in the dialog.
*
* This is provided by boxes which serve as some sort of confirmation. For
* dialogs which are informational notifications, this is usually skipped,
* only the {@link close} action button is configured.
*/
- proceed?: {
- /** The string to use as the label for the primary action button. */
- text: string;
- /** The color of the button. */
- variant?: ButtonProps["color"];
+ continue?: {
/**
- * The function to call when the user presses the primary action button.
+ * The string to use as the label for the primary action button.
+ *
+ * Default is `t("ok")`.
+ */
+ text?: string;
+ /**
+ * The color of the button.
+ *
+ * Default is "accent".
+ */
+ color?: ButtonProps["color"];
+ /**
+ * If `true`, the primary action button is auto focused when the dialog
+ * is opened, allowing the user to confirm just by pressing ENTER.
+ */
+ autoFocus?: boolean;
+ /**
+ * The function to call when the user activates the button.
+ *
+ * Default is to close the dialog.
*
* It is passed a {@link setLoading} function that can be used to show
* or hide loading indicator or the primary action button.
*/
- action:
+ action?:
| (() => void | Promise<void>)
| ((setLoading: (value: boolean) => void) => void | Promise<void>);
};
/**
- * Customize the cancel (dismiss) action button offered by the dialog box.
+ * The string to use as the label for the cancel button.
*
- * Usually all dialog boxes should have a cancel action.
+ * Default is `t("cancel")`.
+ *
+ * Set this to `false` to omit the cancel button altogether.
*/
- close?: {
- /** The string to use as the label for the cancel button. */
- text?: string;
- /** The color of the button. */
- variant?: ButtonProps["color"];
- /**
- * The function to call when the user cancels.
- *
- * If provided, this callback is invoked before closing the dialog.
- */
- action?: () => void;
- };
+ cancel?: string | false;
/** The direction in which the buttons are stacked. Default is "column". */
buttonDirection?: "row" | "column";
}
diff --git a/web/packages/shared/components/LoginComponents.tsx b/web/packages/shared/components/LoginComponents.tsx
index 7ba8e7ae80..652900ab60 100644
--- a/web/packages/shared/components/LoginComponents.tsx
+++ b/web/packages/shared/components/LoginComponents.tsx
@@ -209,11 +209,11 @@ export const sessionExpiredDialogAttributes = (
title: t("SESSION_EXPIRED"),
message: t("SESSION_EXPIRED_MESSAGE"),
nonClosable: true,
- proceed: {
+ continue: {
text: t("login"),
action: onLogin,
- variant: "accent",
},
+ cancel: false,
});
/**