From b7082343ecb19eb7b5c10c91e1c290d52035447c Mon Sep 17 00:00:00 2001 From: James Acklin Date: Sat, 6 Mar 2021 17:25:39 -0500 Subject: [PATCH 1/2] profile: surface "message" action on non-owned profiles fixes urbit/landscape#532 --- .../src/views/apps/profile/components/Profile.tsx | 15 +++++++++++++-- .../views/apps/profile/components/ViewProfile.tsx | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pkg/interface/src/views/apps/profile/components/Profile.tsx b/pkg/interface/src/views/apps/profile/components/Profile.tsx index ca120ecdac..5eb57e0ee4 100644 --- a/pkg/interface/src/views/apps/profile/components/Profile.tsx +++ b/pkg/interface/src/views/apps/profile/components/Profile.tsx @@ -111,7 +111,7 @@ export function ProfileStatus(props: any): ReactElement { ); } -export function ProfileOwnControls(props: any): ReactElement { +export function ProfileActions(props: any): ReactElement { const { ship, isPublic, contact, api } = { ...props }; const history = useHistory(); return ( @@ -137,7 +137,18 @@ export function ProfileOwnControls(props: any): ReactElement { contact={contact} /> - ) : null} + ) : ( + <> + history.push(`/~landscape/dm/${ship}`)} + > + Message + + + )} ); } diff --git a/pkg/interface/src/views/apps/profile/components/ViewProfile.tsx b/pkg/interface/src/views/apps/profile/components/ViewProfile.tsx index 71fee0c484..9c35bd7f73 100644 --- a/pkg/interface/src/views/apps/profile/components/ViewProfile.tsx +++ b/pkg/interface/src/views/apps/profile/components/ViewProfile.tsx @@ -11,7 +11,7 @@ import useLocalState from '~/logic/state/local'; import { ProfileHeader, ProfileControls, - ProfileOwnControls, + ProfileActions, ProfileStatus, ProfileImages } from './Profile'; @@ -25,7 +25,7 @@ export function ViewProfile(props: any) { <> - Date: Mon, 8 Mar 2021 16:35:44 -0500 Subject: [PATCH 2/2] profile: drop ~ from patp when messaging fixes urbit/landscape#532 --- pkg/interface/src/views/apps/profile/components/Profile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/profile/components/Profile.tsx b/pkg/interface/src/views/apps/profile/components/Profile.tsx index 5eb57e0ee4..af246ac457 100644 --- a/pkg/interface/src/views/apps/profile/components/Profile.tsx +++ b/pkg/interface/src/views/apps/profile/components/Profile.tsx @@ -143,7 +143,7 @@ export function ProfileActions(props: any): ReactElement { py='2' cursor='pointer' fontWeight='500' - onClick={() => history.push(`/~landscape/dm/${ship}`)} + onClick={() => history.push(`/~landscape/dm/${ship.substring(1)}`)} > Message