-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show when Subscriptions / Trending / Most Popular were last updated (#…
…4380) * Implement first draft of last subscription refresh timestamp * Update styling to be a top bar * Update styling to be banner-compatible, & increase banner X button size on mobile * Update subscription refresh timestamp to be relative * Implement refresh timestamps for Shorts, Live, and Community tabs * Extract refresh widget to its own component * Add Trending and Popular refresh widgets with timestamps * Fix justifying when no timestamp exists * Move timestamps to utils store * Remove unneeded ref classes and currentLocale computed property * Add page-specific titles for each feed type * Implement showing least recent cache date per profile * Update styling property placement & match top nav box shadow on ft-refresh-widget * Implement showing timestamp for profile only if all channel subscriptions can be found in cache * Disable refresh button instead of removing it or the widget from the DOM * Increase top banner's top margin * Update channel caching calls to provide timestamps * Modify updateCacheByChannel functions to have default timestamp of new Date() * Fix 30-day month relative date calculation scenarios through new optional parameter * Rectify Case 3 (see #3668) * Add back missing line in Popular.js
- Loading branch information
Showing
31 changed files
with
412 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/renderer/components/ft-refresh-widget/ft-refresh-widget.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.floatingRefreshSection { | ||
position: fixed; | ||
inset-block-start: 60px; | ||
inset-inline-end: 0; | ||
box-sizing: border-box; | ||
inline-size: calc(100% - 80px); | ||
padding-block: 5px; | ||
padding-inline: 10px; | ||
box-shadow: 0 2px 1px 0 var(--primary-shadow-color); | ||
background-color: var(--card-bg-color); | ||
border-inline-start: 2px solid var(--primary-color); | ||
display: flex; | ||
align-items: center; | ||
gap: 5px; | ||
justify-content: flex-end; | ||
} | ||
|
||
.floatingRefreshSection:has(.lastRefreshTimestamp + .refreshButton) { | ||
justify-content: space-between; | ||
} | ||
|
||
.floatingRefreshSection.sideNavOpen { | ||
inline-size: calc(100% - 200px); | ||
} | ||
|
||
.lastRefreshTimestamp { | ||
margin-block: 0; | ||
text-align: center; | ||
font-size: 16px; | ||
} | ||
|
||
@media only screen and (width <= 680px) { | ||
.floatingRefreshSection, .floatingRefreshSection.sideNavOpen { | ||
inline-size: 100%; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/renderer/components/ft-refresh-widget/ft-refresh-widget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { defineComponent } from 'vue' | ||
|
||
import FtIconButton from '../ft-icon-button/ft-icon-button.vue' | ||
|
||
export default defineComponent({ | ||
name: 'FtRefreshWidget', | ||
components: { | ||
'ft-icon-button': FtIconButton, | ||
}, | ||
props: { | ||
disableRefresh: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
lastRefreshTimestamp: { | ||
type: String, | ||
default: '' | ||
}, | ||
title: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
isSideNavOpen: function () { | ||
return this.$store.getters.getIsSideNavOpen | ||
} | ||
} | ||
}) |
27 changes: 27 additions & 0 deletions
27
src/renderer/components/ft-refresh-widget/ft-refresh-widget.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div | ||
class="floatingRefreshSection" | ||
:class="{ | ||
sideNavOpen: isSideNavOpen | ||
}" | ||
> | ||
<p | ||
v-if="lastRefreshTimestamp" | ||
class="lastRefreshTimestamp" | ||
> | ||
{{ $t('Feed.Feed Last Updated', { feedName: title, date: lastRefreshTimestamp }) }} | ||
</p> | ||
<ft-icon-button | ||
:disabled="disableRefresh" | ||
:icon="['fas', 'sync']" | ||
class="refreshButton" | ||
:title="$t('Feed.Refresh Feed', { subscriptionName: title })" | ||
:size="12" | ||
theme="primary" | ||
@click="$emit('click')" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script src="./ft-refresh-widget.js" /> | ||
<style scoped src="./ft-refresh-widget.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.