messages: resource name heuristic for showing invite button
fixes urbit/landscape#497
@@ -125,10 +125,11 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement {
);
const ExtraControls = () => {
- if (workspace === '/messages')
+ if (workspace === '/messages') {
+ const resourceArr = association.resource.split('/');
+ const resourceName = resourceArr[resourceArr.length - 1];
+ if (!resourceName.startsWith('dm-')) {
return (
- <>
- {group.members.size >= 3 ?
<Dropdown
flexShrink={0}
dropWidth='300px'
@@ -152,10 +153,10 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement {
+ Add Ship
</Text>
</Dropdown>
- : null }
- </>
);
- if (canWrite)
+ }
+ }
+ if (canWrite) {
return (
<Link to={resourcePath('/new')}>
<Text bold pr='3' color='blue'>
@@ -163,6 +164,7 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement {
</Text>
</Link>
);
+ }
return <></>;
};
