]> Untitled Git - lemmy.git/commitdiff
Disable create post button when community is deleted or removed.
authorDessalines <tyhou13@gmx.com>
Sat, 1 Jun 2019 22:46:40 +0000 (15:46 -0700)
committerDessalines <tyhou13@gmx.com>
Sat, 1 Jun 2019 22:46:40 +0000 (15:46 -0700)
- Fixes #167

ui/src/components/sidebar.tsx

index 6532bc05025c122b58175c276f395deeab88964c..d36d962c1c4a00466959f69fd7285b933316dd21 100644 (file)
@@ -115,8 +115,8 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
           <li class="list-inline-item"><Link class="text-info" to={`/u/${mod.user_name}`}>{mod.user_name}</Link></li>
         )}
       </ul>
-      <Link class="btn btn-sm btn-secondary btn-block mb-3" 
-        to={`/create_post/c/${community.name}`}>Create a Post</Link>
+      <Link class={`btn btn-sm btn-secondary btn-block mb-3 ${(community.deleted || community.removed) && 'no-click'}`}
+          to={`/create_post/c/${community.name}`}>Create a Post</Link>
       <div>
         {community.subscribed 
           ? <button class="btn btn-sm btn-secondary btn-block mb-3" onClick={linkEvent(community.id, this.handleUnsubscribe)}>Unsubscribe</button>