mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Migrate Movies
This commit is contained in:
parent
122c4ae600
commit
479c53eb8b
21 changed files with 1713 additions and 7 deletions
35
src/view/components/NewCollection.tsx
Normal file
35
src/view/components/NewCollection.tsx
Normal file
|
@ -0,0 +1,35 @@
|
|||
import React, { FunctionComponent, useEffect, useRef } from 'react';
|
||||
|
||||
import IconButtonElement from '../../elements/IconButtonElement';
|
||||
|
||||
const NewCollection: FunctionComponent = () => {
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const btnNewCollection = element.current?.querySelector('.btnNewCollection') as HTMLButtonElement;
|
||||
if (btnNewCollection) {
|
||||
btnNewCollection.addEventListener('click', () => {
|
||||
import('../../components/collectionEditor/collectionEditor').then(({ default: collectionEditor }) => {
|
||||
const serverId = window.ApiClient.serverId();
|
||||
new collectionEditor({
|
||||
items: [],
|
||||
serverId: serverId
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div ref={element}>
|
||||
<IconButtonElement
|
||||
is='paper-icon-button-light'
|
||||
className='btnNewCollection autoSize'
|
||||
title='Add'
|
||||
icon='material-icons add'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NewCollection;
|
Loading…
Add table
Add a link
Reference in a new issue