Added infinite scrolling to companies

This commit is contained in:
2018-03-13 23:06:16 +01:00
parent 3e2594ab9f
commit 40e2c43a8d
12 changed files with 64 additions and 63 deletions

View File

@ -16,7 +16,7 @@ func Best(ctx *aero.Context) string {
// Fetch all eligible quotes
allQuotes := fetchAll()
// Sort the quotes by date
// Sort the quotes by number of likes
arn.SortQuotesPopularFirst(allQuotes)
// Slice the part that we need

View File

@ -1,4 +1,4 @@
component Quotes(quotes []*arn.Quote, loadMoreIndex int, user *arn.User)
component Quotes(quotes []*arn.Quote, nextIndex int, user *arn.User)
h1.page-title Quotes
QuotesTabs
@ -17,9 +17,9 @@ component Quotes(quotes []*arn.Quote, loadMoreIndex int, user *arn.User)
#load-more-target.quotes
QuotesScrollable(quotes, user)
if loadMoreIndex != -1
if nextIndex != -1
.buttons
LoadMore(loadMoreIndex)
LoadMore(nextIndex)
component QuotesScrollable(quotes []*arn.Quote, user *arn.User)
each quote in quotes