mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-08 07:56:12 +02:00
feat(resources): support topics + languages in sidebar
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user