Add newer and older posts buttons

This commit is contained in:
Sol Fisher Romanoff 2022-10-23 23:24:11 +03:00 committed by Sam Therapy
parent 44b61eb776
commit 0ee31347e4
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 24 additions and 10 deletions

View file

@ -64,20 +64,17 @@
</div>
<% end %>
</div>
<%= if @prev_page_id do %>
<%= link "Show newer", to: "?min_id=" <> @prev_page_id, class: "load-posts" %>
<% end %>
<div class="activity-stream">
<%= for activity <- @timeline do %>
<%= render("_notice.html", Map.put(activity, :selected, false)) %>
<% end %>
<p id="pagination">
<%= if @prev_page_id do %>
<%= link "«", to: "?min_id=" <> @prev_page_id %>
<% end %>
<%= if @prev_page_id && @next_page_id, do: " | " %>
<%= if @next_page_id do %>
<%= link "»", to: "?max_id=" <> @next_page_id %>
<% end %>
</p>
</div>
<%= if @next_page_id do %>
<%= link "Show older", to: "?max_id=" <> @next_page_id, class: "load-posts" %>
<% end %>
</div>
<style>

View file

@ -4,7 +4,8 @@ :root {
--wallpaper: rgba(11, 16, 23, 1);
--alertNeutralText: rgba(255, 255, 255, 1);
--avatarShadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.7);
--loadPostsSelected: rgba(23, 34, 46, 1);
--loadPostsSelectedText: rgba(185, 185, 186, 1);
--profileBg: rgba(7, 12, 17, 1);
--profileTint: rgba(15, 22, 30, 0.5);
--btnText: rgba(185, 185, 186, 1);
@ -301,6 +302,7 @@ .button-default {
.button-default:hover {
box-shadow: var(--btnHoverShadow);
cursor: pointer;
}
.user-bio {
@ -402,3 +404,18 @@ .user-role {
.bottom-line {
display: flex;
}
.load-posts {
display: block;
box-sizing: border-box;
height: 3.5em;
line-height: 3.5em;
padding: 0 1em;
width: 100%;
text-align: center;
}
.load-posts:hover {
background-color: var(--loadPostsSelected);
color: var(--loadPostsSelectedText);
}