From 48fe482897d2a6537ecaf0b2fcf960ad1a21c56d Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Sat, 18 Oct 2025 19:15:09 +0300 Subject: [PATCH] fix --- .../ManageItemList-filters.scss | 14 ++++++-- .../profile-page/ProfilePagesHeader.js | 34 +++++++++++++++++-- .../search-filters/ProfileMediaFilters.jsx | 6 ++-- .../src/static/js/pages/ProfileMediaPage.js | 21 +++++++++++- static/css/_commons.css | 2 +- static/js/_commons.js | 2 +- 6 files changed, 69 insertions(+), 10 deletions(-) diff --git a/frontend/src/static/js/components/management-table/ManageItemList-filters.scss b/frontend/src/static/js/components/management-table/ManageItemList-filters.scss index 396d7fb4..b1679670 100755 --- a/frontend/src/static/js/components/management-table/ManageItemList-filters.scss +++ b/frontend/src/static/js/components/management-table/ManageItemList-filters.scss @@ -156,9 +156,13 @@ &.active button, button:hover { - color: inherit; + color: var(--default-theme-color); opacity: 1; } + + &.active button { + font-weight: 600; + } } &.mi-filter-options-horizontal { @@ -182,12 +186,16 @@ opacity: 1; &:hover { - background-color: var(--header-circle-button-bg-active-color); + background-color: var(--default-theme-color); + color: white; + opacity: 0.9; } } &.active button { - background-color: var(--header-circle-button-bg-active-color); + background-color: var(--default-theme-color); + color: white; + font-weight: 600; } } } diff --git a/frontend/src/static/js/components/profile-page/ProfilePagesHeader.js b/frontend/src/static/js/components/profile-page/ProfilePagesHeader.js index 5acdae8b..34425fa7 100644 --- a/frontend/src/static/js/components/profile-page/ProfilePagesHeader.js +++ b/frontend/src/static/js/components/profile-page/ProfilePagesHeader.js @@ -372,19 +372,43 @@ class NavMenuInlineTabs extends React.PureComponent { {this.props.onToggleFiltersClick && ['media', 'shared_by_me', 'shared_with_me'].includes(this.props.type) ? (
  • - + filter_list + {this.props.hasActiveFilters ? ( + + ) : null}
  • ) : null} {this.props.onToggleTagsClick && ['media', 'shared_by_me', 'shared_with_me'].includes(this.props.type) ? (
  • - + local_offer + {this.props.hasActiveTags ? ( + + ) : null}
  • ) : null} @@ -412,6 +436,8 @@ NavMenuInlineTabs.propTypes = { onToggleFiltersClick: PropTypes.func, onToggleTagsClick: PropTypes.func, onToggleSortingClick: PropTypes.func, + hasActiveFilters: PropTypes.bool, + hasActiveTags: PropTypes.bool, }; function AddBannerButton(props) { @@ -635,6 +661,8 @@ export default function ProfilePagesHeader(props) { onToggleFiltersClick={props.onToggleFiltersClick} onToggleTagsClick={props.onToggleTagsClick} onToggleSortingClick={props.onToggleSortingClick} + hasActiveFilters={props.hasActiveFilters} + hasActiveTags={props.hasActiveTags} /> @@ -648,6 +676,8 @@ ProfilePagesHeader.propTypes = { onToggleFiltersClick: PropTypes.func, onToggleTagsClick: PropTypes.func, onToggleSortingClick: PropTypes.func, + hasActiveFilters: PropTypes.bool, + hasActiveTags: PropTypes.bool, }; ProfilePagesHeader.defaultProps = { diff --git a/frontend/src/static/js/components/search-filters/ProfileMediaFilters.jsx b/frontend/src/static/js/components/search-filters/ProfileMediaFilters.jsx index 1e39bf05..84f92ac6 100644 --- a/frontend/src/static/js/components/search-filters/ProfileMediaFilters.jsx +++ b/frontend/src/static/js/components/search-filters/ProfileMediaFilters.jsx @@ -72,8 +72,8 @@ export function ProfileMediaFilters(props) { upload_date: uploadDateFilter, duration: durationFilter, publish_state: publishStateFilter, - sort_by: sortByFilter, - tag: tagFilter, + sort_by: props.selectedSort || sortByFilter, + tag: props.selectedTag || tagFilter, }; switch (ev.currentTarget.getAttribute('filter')) { @@ -180,6 +180,8 @@ ProfileMediaFilters.propTypes = { hidden: PropTypes.bool, tags: PropTypes.array, onFiltersUpdate: PropTypes.func.isRequired, + selectedTag: PropTypes.string, + selectedSort: PropTypes.string, }; ProfileMediaFilters.defaultProps = { diff --git a/frontend/src/static/js/pages/ProfileMediaPage.js b/frontend/src/static/js/pages/ProfileMediaPage.js index 29ed337a..83675ed6 100755 --- a/frontend/src/static/js/pages/ProfileMediaPage.js +++ b/frontend/src/static/js/pages/ProfileMediaPage.js @@ -875,6 +875,23 @@ export class ProfileMediaPage extends Page { const isMediaAuthor = authorData && authorData.username === MemberContext._currentValue.username; + // Check if any filters are active (excluding default sort and tags) + const hasActiveFilters = this.state.filterArgs && ( + this.state.filterArgs.includes('media_type=') || + this.state.filterArgs.includes('upload_date=') || + this.state.filterArgs.includes('duration=') || + this.state.filterArgs.includes('publish_state=') + ); + + const hasActiveTags = this.state.selectedTag && this.state.selectedTag !== 'all'; + + console.log('Filter Debug:', { + filterArgs: this.state.filterArgs, + selectedTag: this.state.selectedTag, + hasActiveFilters, + hasActiveTags + }); + return [ this.state.author ? ( ) : null, this.state.author ? ( @@ -899,7 +918,7 @@ export class ProfileMediaPage extends Page { onSelectAll={this.handleSelectAll} onDeselectAll={this.handleDeselectAll} > -