1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/AppHeader.tsx
Matthew Haughton a337f7af2b
Update to typescript-eslint v8 (#6372)
* Update typescript-eslint to v8

* Disable @typescript-eslint/prefer-optional-chain

This rule now requires type information which is not currently enabled for
the Typescript ESLint checks.

* Remove unused vars

* Disable no-empty-function for line using updated config

* Disable rule for lines that violate updated typescript-eslint rules

* Use void operator to fix no-floating-promises

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>

* Use void operator to fix no-floating-promises

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>

---------

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
2025-01-13 13:16:44 -05:00

30 lines
963 B
TypeScript

import React, { FC, useEffect } from 'react';
interface AppHeaderParams {
isHidden?: boolean
}
const AppHeader: FC<AppHeaderParams> = ({
isHidden = false
}) => {
useEffect(() => {
// Initialize the UI components after first render
void import('../scripts/libraryMenu');
}, []);
return (
/**
* NOTE: These components are not used with the new layouts, but legacy views interact with the elements
* directly so they need to be present in the DOM. We use display: none to hide them and prevent errors.
*/
<div style={isHidden ? { display: 'none' } : undefined}>
<div className='mainDrawer hide'>
<div className='mainDrawer-scrollContainer scrollContainer focuscontainer-y' />
</div>
<div className='skinHeader focuscontainer-x' />
<div className='mainDrawerHandle' />
</div>
);
};
export default AppHeader;