Show communities on your home on desktop

This commit is contained in:
Rogerio Chaves 2020-04-26 19:07:37 +02:00
parent d5c3121cb7
commit ddd5bff147
No known key found for this signature in database
GPG Key ID: E6AF5440509B1D94
4 changed files with 19 additions and 3 deletions

View File

@ -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,
});
}

View File

@ -46,6 +46,10 @@ nav {
border: 1px solid #600;
}
.friends-communities p {
font-size: 14px;
}
.secret-chat {
min-width: 200px;
max-width: 200px;

View File

@ -6,7 +6,7 @@
<p>You haven't joined any communities yet, explore some below to join</p>
<% } %>
<% participating.map(community => { %>
<a href="/mobile/communities/<%= community %>" class="link-block">
<a href="/communities/<%= community %>" class="link-block">
#<%= community %>
</a>
<% }) %>
@ -14,7 +14,7 @@
<h1 style="margin-top: 40px; margin-bottom: 10px">Explore</h1>
<% communities.map(community => { %>
<a href="/mobile/communities/<%= community %>" class="link-block">
<a href="/communities/<%= community %>" class="link-block">
#<%= community %>
</a>
<% }) %>

View File

@ -57,6 +57,16 @@
<h2 style="margin-top: 30px">Requests Sent</h2>
<%- include('_friends', { friends: friends.requestsSent }) %>
<% } %>
<h2 style="margin-top: 30px">Communities</h2>
<% communities.map(community => { %>
<a href="/communities/<%= community %>" class="link-block">
#<%= community %>
</a>
<% }) %>
<% if (communities.length == 0) { %>
<p>You haven't joined any communities yet</p>
<% } %>
</div>
</div>