feat(resources): support topics + languages in sidebar

This commit is contained in:
Jean-Philippe Sirois
2020-05-27 05:33:45 -04:00
parent 135452bd4b
commit 81bb9e2b61
5 changed files with 80 additions and 51 deletions
+4 -2
View File
@@ -11,7 +11,9 @@ import * as SC from "./styles"
const ALL_ARCHIVES = graphql`
query {
allFile(filter: { sourceInstanceName: { eq: "what-is-archive" } }) {
archives: allFile(
filter: { sourceInstanceName: { eq: "what-is-archive" } }
) {
edges {
node {
relativePath
@@ -41,7 +43,7 @@ function Tree({ item }: { item: IFileOrFolder }) {
}
export const ArchivesSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
const archives = useStaticQuery<IAllArchivesQuery>(ALL_ARCHIVES)
const { archives } = useStaticQuery(ALL_ARCHIVES)
const tree = useBuildTree(archives, "/archives")
const sortedTree = sort((a, b) => a.title.localeCompare(b.title), tree)