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 { 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}`)}
>
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}