fix(nit): make defaultOptions on explorer not a function
This commit is contained in:
parent
cc31a40b0c
commit
1bf7e3d8b3
1 changed files with 4 additions and 3 deletions
|
@ -6,7 +6,7 @@ import script from "./scripts/explorer.inline"
|
|||
import { ExplorerNode, FileNode, Options } from "./ExplorerNode"
|
||||
|
||||
// Options interface defined in `ExplorerNode` to avoid circular dependency
|
||||
const defaultOptions = (): Options => ({
|
||||
const defaultOptions = {
|
||||
title: "Explorer",
|
||||
folderClickBehavior: "collapse",
|
||||
folderDefaultState: "collapsed",
|
||||
|
@ -23,11 +23,12 @@ const defaultOptions = (): Options => ({
|
|||
}
|
||||
},
|
||||
order: ["filter", "map", "sort"],
|
||||
})
|
||||
} satisfies Options
|
||||
|
||||
export default ((userOpts?: Partial<Options>) => {
|
||||
function Explorer({ allFiles, displayClass, fileData }: QuartzComponentProps) {
|
||||
// Parse config
|
||||
const opts: Options = { ...defaultOptions(), ...userOpts }
|
||||
const opts: Options = { ...defaultOptions, ...userOpts }
|
||||
|
||||
// Construct tree from allFiles
|
||||
const fileTree = new FileNode("")
|
||||
|
|
Loading…
Reference in a new issue