diff --git a/src/contexts/ProfileContext.tsx b/src/contexts/ProfileContext.tsx index e5b585d3..eac1c1a2 100644 --- a/src/contexts/ProfileContext.tsx +++ b/src/contexts/ProfileContext.tsx @@ -123,6 +123,7 @@ export type ProfileContextStore = { addContact: (pubkey: string, source: PrimalUser[]) => void, fetchZapList: (pubkey: string | undefined) => void, fetchNextZapsPage: () => void, + resetProfile: () => void, } } @@ -877,6 +878,12 @@ export const ProfileProvider = (props: { children: ContextChildren }) => { } } + const resetProfile = () => { + updateStore('userProfile', () => undefined); + updateStore('isFetching', () => false); + updateStore('userStats', reconcile(emptyStats)); + }; + const refreshNotes = () => { }; @@ -1120,6 +1127,7 @@ export const ProfileProvider = (props: { children: ContextChildren }) => { fetchZapList, fetchNextZapsPage, clearZaps, + resetProfile, }, }); diff --git a/src/pages/Profile.module.scss b/src/pages/Profile.module.scss index 95d86cf4..e52aa3bd 100644 --- a/src/pages/Profile.module.scss +++ b/src/pages/Profile.module.scss @@ -5,6 +5,13 @@ // min-height: 474px; } +.emptyHeader { + position: relative; + background-color: var(--background-card); + padding-bottom: 4px; + height: 466px; +} + .banner { width: 100%; height: 214px; diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index 383b5239..7f44a23b 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -7,6 +7,8 @@ import { createSignal, For, Match, + onCleanup, + onMount, Resource, Show, Switch @@ -456,17 +458,21 @@ const Profile: Component = () => { -
-
-
} - > - - -
+ } + > + +
+
+
} + > + + +
-
@@ -478,137 +484,138 @@ const Profile: Component = () => {
-
-
-
- -
-
- - +
+
+ +
+
+ + + +
+ + + +
+
-
- - -
-
-
+ + navigate(`/messages/${profile?.userProfile?.npub}`)} + > +
+
+
- - navigate(`/messages/${profile?.userProfile?.npub}`)} - > -
-
-
+ - + + navigate('/settings/profile')} + title={intl.formatMessage(tActions.editProfile)} + > +
{intl.formatMessage(tActions.editProfile)}
+
+
+
- - navigate('/settings/profile')} - title={intl.formatMessage(tActions.editProfile)} - > -
{intl.formatMessage(tActions.editProfile)}
-
-
-
+
+ +
+
+ {profileName()} + +
+
+ +
+ {intl.formatMessage(t.followsYou)} +
+
-
- -
-
- {profileName()} - -
-
- -
- {intl.formatMessage(t.followsYou)} +
+ + +
+ {intl.formatMessage( + t.jointDate, + { + date: shortDate(profile?.userStats.time_joined), + }, + )}
-
- -
- {intl.formatMessage( - t.jointDate, - { - date: shortDate(profile?.userStats.time_joined), - }, - )} -
-
-
- -
- -
-
{nip05Verification(profile?.userProfile)}
+
+ +
+
{nip05Verification(profile?.userProfile)}
+
+
+
+
- -
-
-
- - -
- 0}> -
+
-
+ + 0}> +
+
+
- - - - - - { - doReportUser(); - setConfirmReportUser(false); - }} - onAbort={() => setConfirmReportUser(false)} - /> + +
- { - doMuteUser(); - setConfirmMuteUser(false); - }} - onAbort={() => setConfirmMuteUser(false)} - /> + + + { + doReportUser(); + setConfirmReportUser(false); + }} + onAbort={() => setConfirmReportUser(false)} + /> + + { + doMuteUser(); + setConfirmMuteUser(false); + }} + onAbort={() => setConfirmMuteUser(false)} + /> +
) }