diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx
index 39ef800d4..e2af22e24 100644
--- a/apps/web/src/common/dialog-controller.tsx
+++ b/apps/web/src/common/dialog-controller.tsx
@@ -481,8 +481,8 @@ export function showAttachmentsDialog() {
));
}
-export function showEditProfileDialog(profile?: Profile) {
- return showDialog("EditProfileDialog", (Dialog, perform) => (
+export function showEditProfilePictureDialog(profile?: Profile) {
+ return showDialog("EditProfilePictureDialog", (Dialog, perform) => (
);
}
diff --git a/apps/web/src/dialogs/settings/components/user-profile.tsx b/apps/web/src/dialogs/settings/components/user-profile.tsx
index a978b0aac..61977a447 100644
--- a/apps/web/src/dialogs/settings/components/user-profile.tsx
+++ b/apps/web/src/dialogs/settings/components/user-profile.tsx
@@ -25,7 +25,13 @@ import { getFormattedDate } from "@notesnook/common";
import { SUBSCRIPTION_STATUS } from "../../../common/constants";
import dayjs from "dayjs";
import { useMemo } from "react";
-import { showEditProfileDialog } from "../../../common/dialog-controller";
+import {
+ showEditProfileDialog,
+ showEditProfilePictureDialog,
+ showPromptDialog
+} from "../../../common/dialog-controller";
+import { db } from "../../../common/db";
+import { showToast } from "../../../utils/toast";
export function UserProfile() {
const user = useUserStore((store) => store.user);
@@ -104,7 +110,11 @@ export function UserProfile() {
mr: 2,
size: 60,
borderRadius: 80,
- overflow: "hidden"
+ overflow: "hidden",
+ position: "relative",
+ ":hover #profile-picture-edit": {
+ visibility: "visible"
+ }
}}
>
{profile?.profilePicture ? (
@@ -115,6 +125,30 @@ export function UserProfile() {
) : (
)}
+ {
+ await showEditProfilePictureDialog(profile);
+ }}
+ >
+
+ Edit
+
+
0 && (isPro || isProCancelled)
? `PRO`
: remainingDays > 0 && isTrial
- ? "TRIAL"
- : isBeta
- ? "BETA TESTER"
- : "BASIC"}
+ ? "TRIAL"
+ : isBeta
+ ? "BETA TESTER"
+ : "BASIC"}
- {profile?.fullName ? (
- <>
- {profile?.fullName}
-
- {user.email} • Member since{" "}
- {getFormattedDate(getObjectIdTimestamp(user.id), "date")}
-
- >
- ) : (
- <>
- {user.email}
-
- Member since
- {getFormattedDate(getObjectIdTimestamp(user.id), "date")}
-
- >
- )}
+
+ {profile?.fullName || "Your full name"}{" "}
+ {
+ const fullName = await showPromptDialog({
+ title: "Edit your full name",
+ description:
+ "Your profile data is 100% end-to-end encrypted.",
+ defaultValue: profile?.fullName
+ });
+ useUserStore.setState({
+ profile: { ...profile, fullName: fullName || undefined }
+ });
+ await db.user.setProfile({ fullName: fullName || undefined });
+ showToast("success", "Full name updated!");
+ }}
+ />
+
+
+ {user.email} • Member since{" "}
+ {getFormattedDate(getObjectIdTimestamp(user.id), "date")}
+
-
+ */}
);
}