Skip to content

Commit 5314bf7

Browse files
committed
fix profile UI
1 parent 40ff3ff commit 5314bf7

5 files changed

Lines changed: 51 additions & 26 deletions

File tree

dist/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "I Notes",
4-
"version": "1.8.2",
4+
"version": "1.8.3",
55
"description": "i Notes is a lightweight, easy-to-use extension for taking quick notes, saving developer commands",
66
"permissions": [
77
"storage",

dist/settings.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "I Notes",
4-
"version": "1.8.2",
4+
"version": "1.8.3",
55
"description": "i Notes is a lightweight, easy-to-use extension for taking quick notes, saving developer commands",
66
"permissions": [
77
"storage",

src/settings/settings_components/about.jsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ import Contributors from "../../components/contributors.jsx";
33

44
const About = () => {
55
return (
6-
<div className="card p-3">
7-
<div className="card-body">
8-
<img
9-
src="../assets/note.png"
10-
width="48"
11-
height="48"
12-
alt="iNotes Logo"
13-
className="mb-3"
14-
/>
6+
<div className="p-3 row">
7+
<div className="card-body col-8">
158
<p className="text-muted">
169
iNotes is a lightweight, open-source Chrome extension designed to help you take and manage notes directly in your browser.
1710
It’s perfect for quick thoughts, reminders, and to-dos.
@@ -53,8 +46,9 @@ const About = () => {
5346
or open an issue. We’d love to hear from you!
5447
</p>
5548
</div>
56-
57-
<Contributors />
49+
<div className="col-4">
50+
<Contributors />
51+
</div>
5852
</div>
5953
);
6054
};

src/settings/settings_components/profile.jsx

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Profile() {
2020
const [loading, setLoading] = useState(true); // NEW
2121

2222
useEffect(() => {
23-
chrome.storage.local.get(["idToken", "accessToken"], (result) => {
23+
chrome.storage.local.get(["idToken", "accessToken", "notes"], (result) => {
2424
if (result.idToken && result.accessToken) {
2525
const user = UserPool.getCurrentUser();
2626
if (user) {
@@ -32,10 +32,17 @@ export default function Profile() {
3232
attrs.forEach((attr) => {
3333
profile[attr.getName()] = attr.getValue();
3434
});
35+
profile.fullName = profile.name || `${profile.given_name || ""} ${profile.family_name || ""}`;
36+
profile.email = profile.email || session.getIdToken().payload.email;
37+
profile.totalNotes = result.notes
38+
? result.notes.filter((note) => !note.deleted).length
39+
: 0;
40+
41+
3542
setProfileData(profile);
3643
setIsLoggedIn(true);
3744
}
38-
setLoading(false); // ✅ done checking
45+
setLoading(false);
3946
});
4047
} else {
4148
setLoading(false);
@@ -206,15 +213,39 @@ export default function Profile() {
206213
}
207214

208215
if (isLoggedIn && profileData) {
209-
return (
210-
<div>
211-
<h2>Welcome, {profileData.name || profileData.email}</h2>
212-
<p>Email: {profileData.email}</p>
213-
<button
214-
id="save-btn"
215-
className="btn btn-sm rounded-pill px-3 text-white"
216-
onClick={handleSignOut}
217-
>Sign Out</button>
216+
return (
217+
<div className="container py-4">
218+
<div className="card shadow-sm p-4">
219+
<div className="row align-items-start">
220+
<div className="col-12 col-md-2 text-center">
221+
<i
222+
className="fas fa-user-circle"
223+
style={{ fontSize: "150px", color: "#555" }}
224+
></i>
225+
</div>
226+
227+
<div className="col-12 col-md-10">
228+
<p> Full Name: {profileData.fullName}</p>
229+
<p> Email: {profileData.email}</p>
230+
</div>
231+
</div>
232+
<br/>
233+
<hr/>
234+
<br/>
235+
<div>
236+
<h5 className="mb-3">Notes</h5>
237+
Total Notes: <strong>{profileData.totalNotes || 0}</strong>
238+
</div>
239+
240+
<div className="mt-4 text-end">
241+
<button
242+
className="btn btn-sm btn-danger rounded-pill px-4"
243+
onClick={handleSignOut}
244+
>
245+
Sign Out
246+
</button>
247+
</div>
248+
</div>
218249
</div>
219250
);
220251
}
@@ -242,7 +273,7 @@ export default function Profile() {
242273

243274
return (
244275
<div
245-
className={`container ${!isSigningIn ? "right-panel-active" : ""}`}
276+
className={`container pt-5 ${!isSigningIn ? "right-panel-active" : ""}`}
246277
id="profile-container"
247278
>
248279
<div class="form-container sign-up-container">

0 commit comments

Comments
 (0)