Merge pull request #4559 from urbit/james/message-from-profile

profile: surface "message" action on non-owned profiles
This commit is contained in:
matildepark 2021-03-08 21:31:55 -05:00 committed by GitHub
commit 348ca8b3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -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 { ship, isPublic, contact, api } = { ...props };
const history = useHistory(); const history = useHistory();
return ( return (
@ -137,7 +137,18 @@ export function ProfileOwnControls(props: any): ReactElement {
contact={contact} contact={contact}
/> />
</> </>
) : null} ) : (
<>
<Text
py='2'
cursor='pointer'
fontWeight='500'
onClick={() => history.push(`/~landscape/dm/${ship.substring(1)}`)}
>
Message
</Text>
</>
)}
</Row> </Row>
); );
} }

View File

@ -11,7 +11,7 @@ import useLocalState from '~/logic/state/local';
import { import {
ProfileHeader, ProfileHeader,
ProfileControls, ProfileControls,
ProfileOwnControls, ProfileActions,
ProfileStatus, ProfileStatus,
ProfileImages ProfileImages
} from './Profile'; } from './Profile';
@ -25,7 +25,7 @@ export function ViewProfile(props: any) {
<> <>
<ProfileHeader> <ProfileHeader>
<ProfileControls> <ProfileControls>
<ProfileOwnControls <ProfileActions
ship={ship} ship={ship}
isPublic={isPublic} isPublic={isPublic}
contact={contact} contact={contact}