alpha
Login
or
Join now
atpota.to
/
cred.blue
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix scroll
author
damedotblog
date
1 year ago
(Mar 3, 2025, 1:58 PM -0500)
commit
152af7e4
152af7e4cf6c1a50660e3c1f2d66883df35ece5d
parent
e1eb0f6c
e1eb0f6c6340fd47207e14a097bd6d52c90c95c5
+19
-5
2 changed files
Expand all
Collapse all
Unified
Split
src
components
Supporter
Supporter.css
common
RelatedPagesNav.jsx
+2
src/components/Supporter/Supporter.css
Reviewed
···
22
22
display: flex;
23
23
gap: 17.3px;
24
24
justify-content: center;
25
25
+
margin-top: 20px;
26
26
+
margin-bottom: 30px;
25
27
}
26
28
27
29
.patreon-button {
+17
-5
src/components/common/RelatedPagesNav.jsx
Reviewed
···
1
1
-
// src/components/common/RelatedPagesNav.jsx
2
2
-
3
1
import React from 'react';
4
4
-
import { Link } from 'react-router-dom';
2
2
+
import { Link, useNavigate } from 'react-router-dom';
5
3
import './RelatedPagesNav.css';
6
4
7
5
const RelatedPagesNav = ({ currentPage }) => {
···
27
25
}
28
26
];
29
27
28
28
+
const navigate = useNavigate();
29
29
+
30
30
// Filter out the current page
31
31
const otherPages = pages.filter(page => page.id !== currentPage);
32
32
33
33
+
// Function to handle navigation and scroll to top
34
34
+
const handleNavigation = (path, e) => {
35
35
+
e.preventDefault();
36
36
+
navigate(path);
37
37
+
window.scrollTo(0, 0);
38
38
+
};
39
39
+
33
40
return (
34
41
<div className="related-pages-container">
35
42
<h3 className="related-pages-title">Related Pages</h3>
36
43
<div className="related-pages-links">
37
44
{otherPages.map(page => (
38
38
-
<Link key={page.id} to={page.path} className="related-page-link">
45
45
+
<a
46
46
+
key={page.id}
47
47
+
href={page.path}
48
48
+
className="related-page-link"
49
49
+
onClick={(e) => handleNavigation(page.path, e)}
50
50
+
>
39
51
<div className="related-page-content">
40
52
<h4>{page.title}</h4>
41
53
<p>{page.description}</p>
42
54
</div>
43
55
<span className="related-page-arrow">→</span>
44
44
-
</Link>
56
56
+
</a>
45
57
))}
46
58
</div>
47
59
</div>