mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
Enforce Order of languages in Resources List
This commit is contained in:
@@ -54,10 +54,11 @@ const Language = memo(({ item }: { item: IFolder; index: number }) => {
|
||||
export const ResourcesList: FC<HTMLAttributes<HTMLDivElement>> = props => {
|
||||
const resources = useStaticQuery<IAllResourcesQuery>(ALL_RESOURCES)
|
||||
const tree = useBuildTree(resources)
|
||||
const sortedTree = tree.sort((a, b) => a.title.localeCompare(b.title));
|
||||
|
||||
return (
|
||||
<SC.ResourcesListWrapper {...props}>
|
||||
{tree.map((node, index) => plantTree(node, index))}
|
||||
{sortedTree.map((node, index) => plantTree(node, index))}
|
||||
</SC.ResourcesListWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
||||
export const ResourcesSidebar: FC<HTMLAttributes<HTMLDivElement>> = props => {
|
||||
const resources = useStaticQuery<IAllResourcesQuery>(ALL_RESOURCES)
|
||||
const tree = useBuildTree(resources)
|
||||
const sortedTree = tree.sort((a, b) => a.title.localeCompare(b.title));
|
||||
|
||||
return (
|
||||
<SC.ResourcesSidebarWrapper {...props}>
|
||||
@@ -106,7 +107,7 @@ export const ResourcesSidebar: FC<HTMLAttributes<HTMLDivElement>> = props => {
|
||||
<Banner />
|
||||
</Link>
|
||||
<SC.Inner>
|
||||
{tree.map((node, index) => plantTree(node, index, true))}
|
||||
{sortedTree.map((node, index) => plantTree(node, index, true))}
|
||||
|
||||
<SC.Menu>
|
||||
<MenuItem to="/about">about</MenuItem>
|
||||
|
||||
Reference in New Issue
Block a user