Options panels refactoring (#196)
* Refactor library options to match chapter options using shared component * Disable some eslint rules * Cleanup SourceOptions layout to use same components as other panels
This commit is contained in:
@@ -9,16 +9,7 @@ import React, { useContext } from 'react';
|
||||
|
||||
type ContextType = {
|
||||
options: LibraryOptions;
|
||||
|
||||
setOption: <Name extends keyof LibraryOptions>(
|
||||
name: Name,
|
||||
value: React.SetStateAction<LibraryOptions[Name]>
|
||||
) => void;
|
||||
|
||||
setOptions: React.Dispatch<React.SetStateAction<LibraryOptions>>;
|
||||
|
||||
active: boolean
|
||||
activeSort: boolean
|
||||
};
|
||||
|
||||
export const DefaultLibraryOptions: LibraryOptions = {
|
||||
@@ -35,10 +26,7 @@ export const DefaultLibraryOptions: LibraryOptions = {
|
||||
|
||||
const LibraryOptionsContext = React.createContext<ContextType>({
|
||||
options: DefaultLibraryOptions,
|
||||
setOption: () => {},
|
||||
setOptions: () => {},
|
||||
active: false,
|
||||
activeSort: false,
|
||||
});
|
||||
|
||||
export default LibraryOptionsContext;
|
||||
|
||||
Reference in New Issue
Block a user