diff --git a/app/lib/express.js b/app/lib/express.js index b96f549..d77edc3 100644 --- a/app/lib/express.js +++ b/app/lib/express.js @@ -164,15 +164,17 @@ router.get( return res.render("index"); } - const [posts, friends, secretMessages] = await Promise.all([ + const [posts, friends, secretMessages, communities] = await Promise.all([ queries.getPosts(req.context.profile), queries.getFriends(req.context.profile), queries.getSecretMessages(req.context.profile), + queries.getProfileCommunities(req.context.profile.id), ]); res.render("home", { posts, friends, secretMessages, + communities, profile: req.context.profile, }); } diff --git a/app/public/desktop.css b/app/public/desktop.css index 485d6ac..fa68b36 100644 --- a/app/public/desktop.css +++ b/app/public/desktop.css @@ -46,6 +46,10 @@ nav { border: 1px solid #600; } +.friends-communities p { + font-size: 14px; +} + .secret-chat { min-width: 200px; max-width: 200px; diff --git a/app/views/communities/list.ejs b/app/views/communities/list.ejs index 93de425..4606f8d 100644 --- a/app/views/communities/list.ejs +++ b/app/views/communities/list.ejs @@ -6,7 +6,7 @@

You haven't joined any communities yet, explore some below to join

<% } %> <% participating.map(community => { %> - + #<%= community %> <% }) %> @@ -14,7 +14,7 @@

Explore

<% communities.map(community => { %> - + #<%= community %> <% }) %> diff --git a/app/views/home.ejs b/app/views/home.ejs index 0142206..f428986 100644 --- a/app/views/home.ejs +++ b/app/views/home.ejs @@ -57,6 +57,16 @@

Requests Sent

<%- include('_friends', { friends: friends.requestsSent }) %> <% } %> + +

Communities

+ <% communities.map(community => { %> + + #<%= community %> + + <% }) %> + <% if (communities.length == 0) { %> +

You haven't joined any communities yet

+ <% } %>