Skip to content

Instantly share code, notes, and snippets.

@shibacomputer
Last active March 16, 2017 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shibacomputer/ea57e58acf50b42ba068c83f3b7b98b4 to your computer and use it in GitHub Desktop.
Save shibacomputer/ea57e58acf50b42ba068c83f3b7b98b4 to your computer and use it in GitHub Desktop.
state.dirs = [
0: [
name: "/",
files: [
0: [
name: "entry.txt.gpg",
type: "text/gpg",
uri: "/Users/shibacomputer/Txt/entry.txt.gpg"
],
1: [
name: "entry 2.txt.gpg",
type: "text/gpg",
uri: "/Users/shibacomputer/Txt/entry 2.txt.gpg"
]
],
subdirs: [
0: [
name: "subdir 1",
uri: "/Users/shibacomputer/Txt/subdir",
],
1: [
name: "subdir 2",
uri: "/Users/shibacomputer/Txt/subdir 2"
]
]
]
return html`
<nav class="${fsBase}">
${populateSidebar()}
</nav>
`
}
function populateSidebar() {
return state.filesystem.dirs.map( (fsItem) => {
return html`
${showADirectory(fsItem)}
`
})
}
function showADirectory(directory, parent) {
return directory.map( (item) => {
return html`
${listSubdirectories(item.subdirs)}
${listFiles(item.files)}
`
})
}
function listSubdirectories(subDirs) {
// sub dir list
}
function listFiles(files) {
// file list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment