mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
splitting SuggestionsView component
This commit is contained in:
parent
f4b878bea2
commit
7543e494c9
12 changed files with 311 additions and 187 deletions
43
src/elements/ItemsScrollerContainerElement.tsx
Normal file
43
src/elements/ItemsScrollerContainerElement.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import React, { FunctionComponent } from 'react';
|
||||
|
||||
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, id, className }: IProps) => ({
|
||||
__html: `<div is="emby-scroller"
|
||||
class="${scrollerclassName}"
|
||||
${dataHorizontal}
|
||||
${dataMousewheel}
|
||||
${dataCenterfocus}
|
||||
>
|
||||
<div
|
||||
is="emby-itemscontainer"
|
||||
${id}
|
||||
class="${className}"
|
||||
>
|
||||
</div>
|
||||
</div>`
|
||||
});
|
||||
|
||||
type IProps = {
|
||||
scrollerclassName?: string;
|
||||
dataHorizontal?: string;
|
||||
dataMousewheel?: string;
|
||||
dataCenterfocus?: string;
|
||||
id?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const ItemsScrollerContainerElement: FunctionComponent<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, id, className }: IProps) => {
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={createScroller({
|
||||
scrollerclassName: scrollerclassName,
|
||||
dataHorizontal: dataHorizontal ? `data-horizontal="${dataHorizontal}"` : '',
|
||||
dataMousewheel: dataMousewheel ? `data-mousewheel="${dataMousewheel}"` : '',
|
||||
dataCenterfocus: dataCenterfocus ? `data-centerfocus="${dataCenterfocus}"` : '',
|
||||
id: id ? `id='${id}'` : '',
|
||||
className: className
|
||||
})}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default ItemsScrollerContainerElement;
|
Loading…
Add table
Add a link
Reference in a new issue