Skip to content

Commit 184a7ef

Browse files
joecritchgaearon
authored andcommitted
Reorganized footer nav (reactjs#448)
* Reorganized footer nav to match latest structure * Footer nav - skip Installation page for Quick Start
1 parent 1b80d36 commit 184a7ef

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

src/components/LayoutFooter/Footer.js

+30-27
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FooterNav from './FooterNav';
1212
import MetaTitle from 'templates/components/MetaTitle';
1313
import React from 'react';
1414
import {colors, media} from 'theme';
15+
import {sectionListCommunity, sectionListDocs} from 'utils/sectionList';
1516

1617
import ossLogoPng from 'images/oss_logo.png';
1718

@@ -60,17 +61,27 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
6061
}}>
6162
<FooterNav layoutHasSidebar={layoutHasSidebar}>
6263
<MetaTitle onDark={true}>Docs</MetaTitle>
63-
<FooterLink to="/docs/hello-world.html">Quick Start</FooterLink>
64-
<FooterLink to="/docs/thinking-in-react.html">
65-
Thinking in React
66-
</FooterLink>
67-
<FooterLink to="/tutorial/tutorial.html">Tutorial</FooterLink>
68-
<FooterLink to="/docs/jsx-in-depth.html">
69-
Advanced Guides
70-
</FooterLink>
64+
{sectionListDocs.map(section => {
65+
// Skip the Installation page for Quick Start
66+
const defaultItem =
67+
section.items[0].id === 'installation'
68+
? section.items[1].id
69+
: section.items[0].id;
70+
return (
71+
<FooterLink to={`/docs/${defaultItem}.html`}>
72+
{section.title}
73+
</FooterLink>
74+
);
75+
})}
7176
</FooterNav>
7277
<FooterNav layoutHasSidebar={layoutHasSidebar}>
73-
<MetaTitle onDark={true}>Community</MetaTitle>
78+
<MetaTitle onDark={true}>Channels</MetaTitle>
79+
<ExternalFooterLink
80+
href="https://github.com/facebook/react"
81+
target="_blank"
82+
rel="noopener">
83+
GitHub
84+
</ExternalFooterLink>
7485
<ExternalFooterLink
7586
href="http://stackoverflow.com/questions/tagged/reactjs"
7687
target="_blank"
@@ -103,34 +114,26 @@ const Footer = ({layoutHasSidebar = false}: {layoutHasSidebar: boolean}) => (
103114
</ExternalFooterLink>
104115
</FooterNav>
105116
<FooterNav layoutHasSidebar={layoutHasSidebar}>
106-
<MetaTitle onDark={true}>Resources</MetaTitle>
107-
<FooterLink to="/community/conferences.html">
108-
Conferences
109-
</FooterLink>
110-
<FooterLink to="/community/videos.html">Videos</FooterLink>
111-
<FooterLink to="/community/examples.html">Examples</FooterLink>
112-
<FooterLink to="/community/debugging-tools.html">
113-
Complementary Tools
114-
</FooterLink>
117+
<MetaTitle onDark={true}>Community</MetaTitle>
118+
{sectionListCommunity.map(section => (
119+
<FooterLink to={`/community/${section.items[0].id}.html`}>
120+
{section.title}
121+
</FooterLink>
122+
))}
115123
</FooterNav>
116124
<FooterNav layoutHasSidebar={layoutHasSidebar}>
117125
<MetaTitle onDark={true}>More</MetaTitle>
126+
<FooterLink to="/tutorial/tutorial.html">Tutorial</FooterLink>
118127
<FooterLink to="/blog/">Blog</FooterLink>
119-
<ExternalFooterLink
120-
href="https://github.com/facebook/react"
121-
target="_blank"
122-
rel="noopener">
123-
GitHub
124-
</ExternalFooterLink>
128+
<FooterLink to="/acknowledgements.html">
129+
Acknowledgements
130+
</FooterLink>
125131
<ExternalFooterLink
126132
href="http://facebook.github.io/react-native/"
127133
target="_blank"
128134
rel="noopener">
129135
React Native
130136
</ExternalFooterLink>
131-
<FooterLink to="/acknowledgements.html">
132-
Acknowledgements
133-
</FooterLink>
134137
</FooterNav>
135138
</div>
136139
<section

0 commit comments

Comments
 (0)