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