profile: surface "message" action on non-owned profiles

fixes urbit/landscape#532
This commit is contained in:
James Acklin 2021-03-06 17:25:39 -05:00
parent 487cb75313
commit b7082343ec
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 history = useHistory();
return (
@ -137,7 +137,18 @@ export function ProfileOwnControls(props: any): ReactElement {
contact={contact}
/>
</>
) : null}
) : (
<>
<Text
py='2'
cursor='pointer'
fontWeight='500'
onClick={() => history.push(`/~landscape/dm/${ship}`)}
>
Message
</Text>
</>
)}
</Row>
);
}

View File

@ -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) {
<>
<ProfileHeader>
<ProfileControls>
<ProfileOwnControls
<ProfileActions
ship={ship}
isPublic={isPublic}
contact={contact}