mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
style: auto-format page navigation
This commit is contained in:
@@ -19,9 +19,7 @@ export const PageNavigation: FC<IPageContentProps> = ({ previous, next }) => {
|
|||||||
<SC.Text>Previous</SC.Text>
|
<SC.Text>Previous</SC.Text>
|
||||||
<SC.NavLink to={`/resources/${previous.relativePath}`}>
|
<SC.NavLink to={`/resources/${previous.relativePath}`}>
|
||||||
<SC.PreviousArrow />
|
<SC.PreviousArrow />
|
||||||
<SC.PageTitle>
|
<SC.PageTitle>{previous.title}</SC.PageTitle>
|
||||||
{previous.title}
|
|
||||||
</SC.PageTitle>
|
|
||||||
</SC.NavLink>
|
</SC.NavLink>
|
||||||
</SC.PageContent>
|
</SC.PageContent>
|
||||||
) : (
|
) : (
|
||||||
@@ -31,9 +29,7 @@ export const PageNavigation: FC<IPageContentProps> = ({ previous, next }) => {
|
|||||||
<SC.PageContent>
|
<SC.PageContent>
|
||||||
<SC.Text>Next</SC.Text>
|
<SC.Text>Next</SC.Text>
|
||||||
<SC.NavLink to={`/resources/${next.relativePath}`}>
|
<SC.NavLink to={`/resources/${next.relativePath}`}>
|
||||||
<SC.PageTitle>
|
<SC.PageTitle>{next.title}</SC.PageTitle>
|
||||||
{next.title}
|
|
||||||
</SC.PageTitle>
|
|
||||||
<SC.NextArrow />
|
<SC.NextArrow />
|
||||||
</SC.NavLink>
|
</SC.NavLink>
|
||||||
</SC.PageContent>
|
</SC.PageContent>
|
||||||
|
|||||||
@@ -33,15 +33,18 @@ const ResourcePage: FC<any> = ({ data }) => {
|
|||||||
toc.length
|
toc.length
|
||||||
)
|
)
|
||||||
|
|
||||||
const pages = sortWith([
|
const pages = sortWith(
|
||||||
descend((f: any) => {
|
[
|
||||||
if (f.node.relativePath.includes("intro")) {
|
descend((f: any) => {
|
||||||
return 1;
|
if (f.node.relativePath.includes("intro")) {
|
||||||
}
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1
|
||||||
})
|
}),
|
||||||
], data.allFile.edges)
|
],
|
||||||
|
data.allFile.edges
|
||||||
|
)
|
||||||
const currentIndex = pages.findIndex(
|
const currentIndex = pages.findIndex(
|
||||||
(x: any) => x.node.relativePath === relativePath
|
(x: any) => x.node.relativePath === relativePath
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user