mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
Merge pull request #475 from wesbos/back-to-top
feat: add HTML-only back to top link
This commit is contained in:
commit
9dab2205f1
2 changed files with 13 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ function Header({ siteTitle, siteDescription, siteUrl }) {
|
|||
<meta name="twitter:image" content={`${siteUrl}/twitter-card.png`} />
|
||||
</Helmet>
|
||||
<div>
|
||||
<h1>
|
||||
<h1 id="top">
|
||||
<Link to="/">/uses</Link>
|
||||
</h1>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,17 @@ import Layout from '../components/layout';
|
|||
import Person from '../components/Person';
|
||||
import Topics from '../components/Topics';
|
||||
|
||||
const BackToTopLink = styled.a`
|
||||
position: fixed;
|
||||
bottom: 1%;
|
||||
right: 1%;
|
||||
background: var(--pink);
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
padding: 1rem;
|
||||
transition: background-color 0.2s ease 0s;
|
||||
`;
|
||||
|
||||
function IndexPage() {
|
||||
const { currentTag } = useContext(FilterContext);
|
||||
const { allPerson } = useStaticQuery(graphql`
|
||||
|
|
@ -43,6 +54,7 @@ function IndexPage() {
|
|||
<Person key={person.name} person={person} currentTag={currentTag} />
|
||||
))}
|
||||
</People>
|
||||
<BackToTopLink href="#top">↑ Back to top</BackToTopLink>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue