mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Details redesign tweaks and refactoring (#3995)
* Move loadStickyHeader to src/hooks * intl stashIDs * Scroll to top on component mount * Add id to gallery cover image and tweak merge functions * Add useTitleProps hook * Also scroll to top on list pages * Refactor loaders and tabs * Use classnames * Add DetailImage
This commit is contained in:
@@ -153,9 +153,7 @@ export function makeItemList<T extends QueryResult, E extends IDataItem>({
|
||||
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
|
||||
const [lastClickedId, setLastClickedId] = useState<string>();
|
||||
|
||||
const [editingCriterion, setEditingCriterion] = useState<
|
||||
string | undefined
|
||||
>();
|
||||
const [editingCriterion, setEditingCriterion] = useState<string>();
|
||||
const [showEditFilter, setShowEditFilter] = useState(false);
|
||||
|
||||
const result = useResult(filter);
|
||||
@@ -701,7 +699,15 @@ export function makeItemList<T extends QueryResult, E extends IDataItem>({
|
||||
const newFilter = cloneDeep(filter);
|
||||
newFilter.currentPage = page;
|
||||
updateFilter(newFilter);
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
// if the current page has a detail-header, then
|
||||
// scroll up relative to that rather than 0, 0
|
||||
const detailHeader = document.querySelector(".detail-header");
|
||||
if (detailHeader) {
|
||||
window.scrollTo(0, detailHeader.scrollHeight - 50);
|
||||
} else {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
},
|
||||
[filter, updateFilter]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user