Skip to content

Commit 2efc06e

Browse files
committed
chore(splash): re-integrate the landing page
1 parent ce1754d commit 2efc06e

File tree

8 files changed

+91
-58
lines changed

8 files changed

+91
-58
lines changed

src/components/Cube/Cube.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import PropTypes from 'prop-types';
44

55
// Load Styling
6-
import '../Cube.scss';
6+
import './Cube.scss';
77

88
export default class Cube extends React.Component {
99
static propTypes = {

src/components/Site/Site.jsx

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import NotificationBar from '../NotificationBar/NotificationBar';
88
import Navigation from '../Navigation/Navigation';
99
import SidebarMobile from '../SidebarMobile/SidebarMobile';
1010
import Container from '../Container/Container';
11+
import Splash from '../Splash/Splash';
1112
import Sponsors from '../Sponsors/Sponsors';
1213
import Sidebar from '../Sidebar/Sidebar';
1314
import Footer from '../Footer/Footer';
@@ -79,42 +80,51 @@ class Site extends React.Component {
7980
sections={ this._strip(Content.children) } />
8081
) : null }
8182

82-
<Container className="site__content">
83-
<Sponsors />
8483
<Switch>
85-
{ this._pages.map(page => (
86-
<Route
87-
key={ page.url }
88-
exact={ true }
89-
path={ page.url }
90-
render={ props => {
91-
let path = page.path.replace('src/content/', '');
92-
let content = this.props.import(path);
93-
94-
return (
95-
<React.Fragment>
96-
<Sidebar
97-
className="site__sidebar"
98-
currentPage={ location.pathname }
99-
pages={ this._strip(section ? section.children : Content.children.filter(item => (
100-
item.type !== 'directory' &&
101-
item.url !== '/'
102-
))) } />
103-
<Page
104-
{ ...page }
105-
content={ content } />
106-
</React.Fragment>
107-
);
108-
}} />
109-
))}
11084
<Route
111-
path="/vote"
112-
component={ Vote } />
113-
<Route render={ props => (
114-
'404 Not Found'
115-
)} />
85+
path="/"
86+
exact
87+
component={ Splash } />
88+
<Route
89+
render={ props => (
90+
<Container className="site__content">
91+
<Switch>
92+
{ this._pages.map(page => (
93+
<Route
94+
key={ page.url }
95+
exact={ true }
96+
path={ page.url }
97+
render={ props => {
98+
let path = page.path.replace('src/content/', '');
99+
let content = this.props.import(path);
100+
101+
return (
102+
<React.Fragment>
103+
<Sponsors />
104+
<Sidebar
105+
className="site__sidebar"
106+
currentPage={ location.pathname }
107+
pages={ this._strip(section ? section.children : Content.children.filter(item => (
108+
item.type !== 'directory' &&
109+
item.url !== '/'
110+
))) } />
111+
<Page
112+
{ ...page }
113+
content={ content } />
114+
</React.Fragment>
115+
);
116+
}} />
117+
))}
118+
<Route
119+
path="/vote"
120+
component={ Vote } />
121+
<Route render={ props => (
122+
'404 Not Found'
123+
)} />
124+
</Switch>
125+
</Container>
126+
)} />
116127
</Switch>
117-
</Container>
118128

119129
<Footer />
120130
</div>

src/components/Splash/Splash.jsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import React from 'react';
44
// Import Components
55
import Container from '../Container/Container';
66
import SplashViz from '../SplashViz/SplashViz';
7+
import Markdown from '../Markdown/Markdown';
78
import Support from '../Support/Support';
89

10+
// Import Content
11+
import Content from '../../content/index.md';
12+
913
// Load Styling
1014
import './Splash.scss';
1115

@@ -15,35 +19,43 @@ const Splash = () => (
1519

1620
<div className="splash__section splash__section--dark page__content">
1721
<Container>
18-
<div dangerouslySetInnerHTML={{
19-
__html: require('page-loader!../../content/index.md').body
20-
}} />
22+
<Markdown>
23+
<div dangerouslySetInnerHTML={{
24+
__html: Content
25+
}} />
26+
</Markdown>
2127
</Container>
2228
</div>
2329

2430
<div className="splash__section page__content">
2531
<Container>
26-
<h1>Support the Team</h1>
32+
<Markdown>
33+
<h1>Support the Team</h1>
2734

28-
<p>Through contributions, donations, and sponsorship, you allow webpack to thrive. Your donations directly support office hours, continued enhancements, and most importantly, great documentation and learning material!</p>
35+
<p>
36+
Through contributions, donations, and sponsorship, you allow webpack to thrive. Your
37+
donations directly support office hours, continued enhancements, and most importantly,
38+
great documentation and learning material!
39+
</p>
2940

30-
<h2>Latest Sponsors</h2>
31-
<Support rank="latest" />
41+
<h2>Latest Sponsors</h2>
42+
<Support rank="latest" />
3243

33-
<h2>Platinum Sponsors</h2>
34-
<Support rank="platinum" />
44+
<h2>Platinum Sponsors</h2>
45+
<Support rank="platinum" />
3546

36-
<h2>Gold Sponsors</h2>
37-
<Support rank="gold" />
47+
<h2>Gold Sponsors</h2>
48+
<Support rank="gold" />
3849

39-
<h2>Silver Sponsors</h2>
40-
<Support rank="silver" />
50+
<h2>Silver Sponsors</h2>
51+
<Support rank="silver" />
4152

42-
<h2>Bronze Sponsors</h2>
43-
<Support rank="bronze" />
53+
<h2>Bronze Sponsors</h2>
54+
<Support rank="bronze" />
4455

45-
<h2>Backers</h2>
46-
<Support rank="backer" />
56+
<h2>Backers</h2>
57+
<Support rank="backer" />
58+
</Markdown>
4759
</Container>
4860
</div>
4961
</div>

src/components/SplashViz/SplashViz.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Cube from '../Cube/Cube';
99
import TextRotator from '../TextRotater/TextRotater';
1010

1111
// Load Styling
12-
import '../SplashViz.scss';
12+
import './SplashViz.scss';
1313

1414
export default class SplashViz extends React.Component {
1515

src/components/Support/support-additional.js renamed to src/components/Support/AdditionalSupporters.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Import Images
2+
import SegmentLogo from './logos/segment.png';
3+
14
export default [
25
{
36
name: "MoonMail",
@@ -30,7 +33,7 @@ export default [
3033
},
3134
{
3235
name: "Segment",
33-
avatar: require("./assets/segment-logo.png"),
36+
avatar: SegmentLogo,
3437
website: "https://segment.com/?utm_source=webpack&utm_medium=documentation&utm_campaign=sponsorship",
3538
totalDonations: 2400000,
3639
reason: "Sponsorship 2017-07 - 2017-09"

src/components/Support/Support.jsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1+
// Import External Dependencies
12
import React from 'react';
2-
import Backers from './_support-backers.json';
3-
import Additional from './support-additional.js';
3+
4+
// Import Data
5+
import Backers from './_supporters.json';
6+
import Additional from './AdditionalSupporters';
7+
8+
// Load Styling
49
import './Support.scss';
510

611
const SUPPORTERS = [ ...Backers ];
712

8-
// merge or add additional backers/sponsors
13+
// Merge or add additional backers/sponsors
914
for(const additional of Additional) {
1015
const existing = SUPPORTERS.find(supporter => supporter.slug && supporter.slug === additional.slug);
16+
1117
if (existing) {
1218
existing.totalDonations += additional.totalDonations;
1319
} else {
1420
SUPPORTERS.push(additional);
1521
}
1622
}
1723

18-
// resort list
24+
// Resort the list
1925
SUPPORTERS.sort((a, b) => b.totalDonations - a.totalDonations);
2026

27+
// Define ranks
2128
const ranks = {
2229
backer: {
2330
maximum: 200
@@ -44,6 +51,7 @@ const ranks = {
4451

4552
function formatMoney(number) {
4653
let str = Math.round(number) + '';
54+
4755
if (str.length > 3) {
4856
str = str.substr(0, str.length - 3) + ',' + str.substr(-3);
4957
}

src/components/TextRotater/TextRotater.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import PropTypes from 'prop-types';
44

55
// Load Styling
6-
import '../TextRotater.scss';
6+
import './TextRotater.scss';
77

88
export default class TextRotater extends React.PureComponent {
99
static defaultProps = {

0 commit comments

Comments
 (0)