-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import Link from 'next/link' | ||
import { FaExternalLinkAlt } from "react-icons/fa"; | ||
import * as Styles from "../splash/styles"; | ||
import { BigSpacer } from "../../layouts/generalComponents"; | ||
import sections from "./sitemap.yaml"; | ||
|
||
|
||
export const SiteMap = () => { | ||
return ( | ||
<SiteMapContainer> | ||
{sections.map((section) => ( | ||
<SectionWrapper className="col-sm-3 col-xs-6" key={section.title}> | ||
<Section> | ||
<BigSpacer /> | ||
<SectionTitle $left>{section.title}</SectionTitle> | ||
<SectionList entries={section.entries} /> | ||
</Section> | ||
</SectionWrapper> | ||
)) | ||
} | ||
</SiteMapContainer> | ||
) | ||
} | ||
|
||
|
||
const SectionList = ({ entries }) => { | ||
return ( | ||
<UnstyledList> | ||
{entries.map((entry) => ( | ||
<li key={entry.name}> | ||
<ListItemParagraph> | ||
<UncoloredLink> | ||
{entry.href.startsWith('http') ? ( | ||
<Link href={entry.href} rel="noopener noreferrer" target="_blank"> | ||
{entry.name} <FooterIcon><FaExternalLinkAlt/></FooterIcon> | ||
</Link> | ||
) : ( | ||
<Link href={entry.href}> | ||
{entry.name} | ||
</Link> | ||
)} | ||
</UncoloredLink> | ||
</ListItemParagraph> | ||
</li> | ||
))} | ||
</UnstyledList> | ||
) | ||
} | ||
|
||
const SiteMapContainer = styled.div` | ||
// Center contents | ||
margin: 0 auto; | ||
// Ensure that, on wide screens, 4 sections renders to roughly align with the | ||
// width of IconParagraph (rendered below this element) | ||
max-width: 680px; | ||
` | ||
|
||
// Wrapper is used to center the actual Section while allowing it to be | ||
// left-aligned. | ||
const SectionWrapper = styled.div` | ||
// Ensure the longest entry (Discussion forum ↗️) still fits on a single line | ||
min-width: 170px; | ||
// Center section contents when all sections are displayed in a single row | ||
@media (min-width: 680px) { | ||
text-align: center; | ||
} | ||
// Otherwise, when there are multiple rows, left-align so columns are aligned | ||
text-align: left; | ||
` | ||
|
||
const Section = styled.div` | ||
display: inline-block; | ||
text-align: left; | ||
` | ||
|
||
// The global Styles.H3 has a min-width that is undesirable here | ||
const SectionTitle = styled.h3` | ||
` | ||
|
||
const UnstyledList = styled.ul` | ||
list-style: none; | ||
` | ||
|
||
const ListItemParagraph = styled(Styles.FocusParagraph)` | ||
line-height: 0.5; | ||
font-weight: 300; | ||
a { | ||
font-weight: 300; | ||
} | ||
` | ||
|
||
const UncoloredLink = styled.span` | ||
& a { | ||
color: #000 !important; | ||
} | ||
` | ||
|
||
const FooterIcon = styled.span` | ||
margin-left: 2px; | ||
font-size: 12px; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
- title: Resources | ||
entries: | ||
- name: Core pathogens | ||
href: /pathogens | ||
- name: SARS-CoV-2 | ||
href: /sars-cov-2 | ||
- name: Community | ||
href: /community | ||
- name: Groups | ||
href: /groups | ||
|
||
- title: Tools | ||
entries: | ||
- name: Nextclade | ||
href: https://clades.nextstrain.org/ | ||
- name: Auspice.us | ||
href: https://auspice.us/ | ||
- name: Augur | ||
href: https://docs.nextstrain.org/projects/augur | ||
- name: Auspice | ||
href: https://docs.nextstrain.org/projects/auspice | ||
- name: Nextstrain CLI | ||
href: https://docs.nextstrain.org/projects/cli | ||
|
||
- title: Support | ||
entries: | ||
- name: Docs | ||
href: https://docs.nextstrain.org/ | ||
- name: Discussion forum | ||
href: https://discussion.nextstrain.org/ | ||
|
||
- title: About | ||
entries: | ||
- name: Team | ||
href: /team | ||
- name: Blog | ||
href: /blog | ||
- name: Contact | ||
href: /contact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters