Skip to content

Commit 409c58d

Browse files
#2: Add a separate page for sponsors and donators
1 parent 7597baa commit 409c58d

File tree

5 files changed

+151
-0
lines changed

5 files changed

+151
-0
lines changed

docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ module.exports = {
3232
position: 'left',
3333
label: 'Shalitha Suranga',
3434
},
35+
{
36+
to: 'sponsors',
37+
position: 'left',
38+
label: 'Sponsors',
39+
},
3540
{
3641
href: 'https://github.com/codezri',
3742
label: 'GitHub',

src/components/Sponsors.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import Link from '@docusaurus/Link';
4+
import styles from './Sponsors.module.css';
5+
6+
const ProjectsList = [
7+
{
8+
name: 'MacStadium',
9+
image: 'img/sponsors/macstadium.png',
10+
description: (
11+
<>
12+
MacStadium is the only provider of enterprise-class cloud solutions for Mac and iOS app development.
13+
They offered us a free remotely-accessed physical mac-mini for Neutralinojs-mac development.
14+
</>
15+
),
16+
link: 'https://www.macstadium.com'
17+
}
18+
];
19+
20+
const DonatorsList = ['Just Epic',
21+
'Brian McGonagill',
22+
'Brian',
23+
'Mortarwork Studios'];
24+
25+
function Sponsor({sponsor}) {
26+
return (
27+
<div className={clsx('col col--4', styles.sponsor, 'padding-vert--md')}>
28+
<div className="text--center">
29+
<img src={sponsor.image} alt={sponsor.name} />
30+
</div>
31+
<div className="text--center padding-horiz--md padding-vert--sm">
32+
<h3>{sponsor.name}</h3>
33+
<p>{sponsor.description}</p>
34+
<Link
35+
className="button button--secondary"
36+
href={sponsor.link}>
37+
Go to website
38+
</Link>
39+
</div>
40+
</div>
41+
);
42+
}
43+
44+
function Donator(props) {
45+
return (
46+
<li>{props.name}</li>
47+
);
48+
}
49+
50+
export default function Sponsors() {
51+
return (
52+
<section className={styles.sponsors}>
53+
<div className="container">
54+
<h1>Sponsors</h1>
55+
<div className="row">
56+
{ProjectsList.map((props, idx) => (
57+
<Sponsor key={idx} sponsor={props} />
58+
))}
59+
</div>
60+
<h1 className="margin-top--lg">Monthly Donators</h1>
61+
<div className="row">
62+
<ul>
63+
{DonatorsList.map((props, idx) => (
64+
<Donator key={idx} name={props} />
65+
))}
66+
</ul>
67+
</div>
68+
</div>
69+
</section>
70+
);
71+
}

src/components/Sponsors.module.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
3+
.sponsors {
4+
display: flex;
5+
align-items: center;
6+
padding: 2rem 0;
7+
width: 100%;
8+
}
9+
10+
.sponsors img {
11+
height: 200px;
12+
width: 200px;
13+
border: solid 0.5em rgba(144, 144, 144, 0.25);
14+
border-radius: 100%;
15+
}

src/pages/sponsors.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import Layout from '@theme/Layout';
4+
import Link from '@docusaurus/Link';
5+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
6+
import styles from './index.module.css';
7+
import Sponsors from '../components/Sponsors';
8+
9+
function SponsorsHeader() {
10+
const {siteConfig} = useDocusaurusContext();
11+
return (
12+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
13+
<div className="container">
14+
<h1 className="hero__title">{siteConfig.title} Sponsors</h1>
15+
<p className="hero__subtitle">Organizations and individuals who support our works</p>
16+
</div>
17+
</header>
18+
);
19+
}
20+
21+
export default function Home() {
22+
const {siteConfig} = useDocusaurusContext();
23+
return (
24+
<Layout
25+
title={`${siteConfig.title} Sponsors`}
26+
description={`Organizations and individuals around the world support ${siteConfig.title}.
27+
Get your name added here by sponsoring or making a recurring donation.`}>
28+
<SponsorsHeader />
29+
<main>
30+
<Sponsors />
31+
</main>
32+
<div className={clsx('hero hero--primary', styles.heroBanner)}>
33+
<div className="container">
34+
<h1 className="hero__title">{`Support ${siteConfig.title}`}</h1>
35+
<p className="hero__subtitle">
36+
Would you like to support our works and get listed above?
37+
</p>
38+
<div className={styles.buttons}>
39+
<Link
40+
className={clsx(
41+
'button button--secondary button--lg',
42+
styles.getStarted,
43+
)}
44+
href="https://forms.gle/mTxB9gdKsdWPkwBQA">
45+
Sponsor
46+
</Link>
47+
<Link
48+
className={clsx(
49+
'button button--secondary button--lg margin-left--sm',
50+
styles.getStarted,
51+
)}
52+
href="https://www.patreon.com/shalithasuranga">
53+
Donate
54+
</Link>
55+
</div>
56+
</div>
57+
</div>
58+
</Layout>
59+
);
60+
}

static/img/sponsors/macstadium.png

11.4 KB
Loading

0 commit comments

Comments
 (0)