mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-09 10:09:30 +00:00
fix playlist detail filter bar
This commit is contained in:
@@ -35,6 +35,8 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: eslint
|
- id: eslint
|
||||||
name: eslint
|
name: eslint
|
||||||
|
files: \.[jt]sx?$
|
||||||
|
types: [file]
|
||||||
entry: npm run --prefix ./frontend lint
|
entry: npm run --prefix ./frontend lint
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { Link, useNavigate, useOutletContext, useParams, useSearchParams } from 'react-router-dom';
|
import { Link, useNavigate, useOutletContext, useParams, useSearchParams } from 'react-router-dom';
|
||||||
import loadPlaylistById from '../api/loader/loadPlaylistById';
|
import loadPlaylistById from '../api/loader/loadPlaylistById';
|
||||||
import { OutletContextType } from './Base';
|
import { OutletContextType } from './Base';
|
||||||
import { ConfigType, VideoType, ViewLayoutType } from './Home';
|
import { ConfigType, VideoType } from './Home';
|
||||||
import Filterbar from '../components/Filterbar';
|
import Filterbar from '../components/Filterbar';
|
||||||
import { PlaylistEntryType } from './Playlists';
|
import { PlaylistEntryType } from './Playlists';
|
||||||
import loadChannelById from '../api/loader/loadChannelById';
|
import loadChannelById from '../api/loader/loadChannelById';
|
||||||
@@ -62,11 +62,6 @@ const Playlist = () => {
|
|||||||
const { currentPage, setCurrentPage } = useOutletContext() as OutletContextType;
|
const { currentPage, setCurrentPage } = useOutletContext() as OutletContextType;
|
||||||
const isAdmin = useIsAdmin();
|
const isAdmin = useIsAdmin();
|
||||||
|
|
||||||
const userMeConfig = userConfig.config;
|
|
||||||
|
|
||||||
const [hideWatched, setHideWatched] = useState(userMeConfig.hide_watched || false);
|
|
||||||
const [view, setView] = useState<ViewLayoutType>(userMeConfig.view_style_home || 'grid');
|
|
||||||
const [gridItems, setGridItems] = useState(userMeConfig.grid_items || 3);
|
|
||||||
const [descriptionExpanded, setDescriptionExpanded] = useState(false);
|
const [descriptionExpanded, setDescriptionExpanded] = useState(false);
|
||||||
const [refresh, setRefresh] = useState(false);
|
const [refresh, setRefresh] = useState(false);
|
||||||
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
||||||
@@ -86,6 +81,9 @@ const Playlist = () => {
|
|||||||
const videoInPlaylistCount = pagination?.total_hits;
|
const videoInPlaylistCount = pagination?.total_hits;
|
||||||
const showEmbeddedVideo = videoId !== null;
|
const showEmbeddedVideo = videoId !== null;
|
||||||
|
|
||||||
|
const view = userConfig.config.view_style_home;
|
||||||
|
const gridItems = userConfig.config.grid_items;
|
||||||
|
const hideWatched = userConfig.config.hide_watched;
|
||||||
const isGridView = view === ViewStyles.grid;
|
const isGridView = view === ViewStyles.grid;
|
||||||
const gridView = isGridView ? `boxed-${gridItems}` : '';
|
const gridView = isGridView ? `boxed-${gridItems}` : '';
|
||||||
const gridViewGrid = isGridView ? `grid-${gridItems}` : '';
|
const gridViewGrid = isGridView ? `grid-${gridItems}` : '';
|
||||||
@@ -322,14 +320,6 @@ const Playlist = () => {
|
|||||||
<div className={`boxed-content ${gridView}`}>
|
<div className={`boxed-content ${gridView}`}>
|
||||||
<Filterbar
|
<Filterbar
|
||||||
hideToggleText="Hide watched videos:"
|
hideToggleText="Hide watched videos:"
|
||||||
hideWatched={hideWatched}
|
|
||||||
isGridView={isGridView}
|
|
||||||
view={view}
|
|
||||||
gridItems={gridItems}
|
|
||||||
userMeConfig={userMeConfig}
|
|
||||||
setHideWatched={setHideWatched}
|
|
||||||
setView={setView}
|
|
||||||
setGridItems={setGridItems}
|
|
||||||
viewStyleName={ViewStyleNames.playlist}
|
viewStyleName={ViewStyleNames.playlist}
|
||||||
setRefresh={setRefresh}
|
setRefresh={setRefresh}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user