mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
clean up GenresView & GenresItemsContainer
This commit is contained in:
parent
1c6b1fc478
commit
071e7d15d9
4 changed files with 101 additions and 142 deletions
|
@ -1,22 +1,25 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
const createElement = ({ className }: IProps) => ({
|
||||
const createElement = ({ className, dataId }: IProps) => ({
|
||||
__html: `<div
|
||||
is="emby-itemscontainer"
|
||||
class="${className}"
|
||||
${dataId}
|
||||
>
|
||||
</div>`
|
||||
});
|
||||
|
||||
interface IProps {
|
||||
className?: string;
|
||||
dataId?: string;
|
||||
}
|
||||
|
||||
const ItemsContainerElement: FC<IProps> = ({ className }) => {
|
||||
const ItemsContainerElement: FC<IProps> = ({ className, dataId }) => {
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={createElement({
|
||||
className: className
|
||||
className: className,
|
||||
dataId: dataId ? `data-id="${dataId}"` : ''
|
||||
})}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, className }: IProps) => ({
|
||||
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }: IProps) => ({
|
||||
__html: `<div is="emby-scroller"
|
||||
class="${scrollerclassName}"
|
||||
${dataHorizontal}
|
||||
|
@ -10,6 +10,7 @@ const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dat
|
|||
<div
|
||||
is="emby-itemscontainer"
|
||||
class="${className}"
|
||||
${dataId}
|
||||
>
|
||||
</div>
|
||||
</div>`
|
||||
|
@ -20,10 +21,11 @@ interface IProps {
|
|||
dataHorizontal?: string;
|
||||
dataMousewheel?: string;
|
||||
dataCenterfocus?: string;
|
||||
dataId?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const ItemsScrollerContainerElement: FC<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, className }) => {
|
||||
const ItemsScrollerContainerElement: FC<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }) => {
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={createScroller({
|
||||
|
@ -31,6 +33,7 @@ const ItemsScrollerContainerElement: FC<IProps> = ({ scrollerclassName, dataHori
|
|||
dataHorizontal: dataHorizontal ? `data-horizontal="${dataHorizontal}"` : '',
|
||||
dataMousewheel: dataMousewheel ? `data-mousewheel="${dataMousewheel}"` : '',
|
||||
dataCenterfocus: dataCenterfocus ? `data-centerfocus="${dataCenterfocus}"` : '',
|
||||
dataId: dataId ? `data-id="${dataId}"` : '',
|
||||
className: className
|
||||
})}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue