From 73a129a24d846b387357336bec7b5c8b09c5a6ba Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 8 May 2019 09:07:34 -0700 Subject: Adding create community and post buttons from sidebar. - Fixes #148 --- ui/src/components/create-post.tsx | 4 +++- ui/src/components/main.tsx | 2 ++ ui/src/components/sidebar.tsx | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'ui/src/components') diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx index 1958be72..fdee01f6 100644 --- a/ui/src/components/create-post.tsx +++ b/ui/src/components/create-post.tsx @@ -26,7 +26,9 @@ export class CreatePost extends Component { } get prevCommunityName(): string { - if (this.props.location.state) { + if (this.props.match.params.name) { + return this.props.match.params.name; + } else if (this.props.location.state) { let lastLocation = this.props.location.state.prevPath; if (lastLocation.includes("/c/")) { return lastLocation.split("/c/")[1]; diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 1ec016ea..ac43b1d9 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -136,6 +136,8 @@ export class Main extends Component { } + Create a Community {this.sidebar()} } diff --git a/ui/src/components/sidebar.tsx b/ui/src/components/sidebar.tsx index d14ad68c..8d1459d5 100644 --- a/ui/src/components/sidebar.tsx +++ b/ui/src/components/sidebar.tsx @@ -117,10 +117,12 @@ export class Sidebar extends Component {
{community.subscribed - ? - : + ? + : }
+ Create a Post {community.description &&

-- cgit v1.2.3