Skip to content

Commit 2472125

Browse files
authored
feat: Launch survey (gulpjs#153)
feat: Add AnnouncementBar for State of Gulp survey feat: Re-add American Express as a sponsor chore: Remove WordTips sponsor that dropped off in 2023 chore: Update content to reflect state of backer banner feat: Add Web Weekly sponsor
1 parent 772ff6d commit 2472125

File tree

9 files changed

+151
-17
lines changed

9 files changed

+151
-17
lines changed

docusaurus.config.js

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = {
1515
projectName: 'gulpjs.github.io',
1616
// The theme
1717
themeConfig: {
18+
announcementBar: {
19+
id: 'state_of_gulp',
20+
content:
21+
`We're seeking your feedback until May 31st—participate in the <a href="https://www.surveyhero.com/c/9sfd37mk" target="_blank" rel="noopener noreferrer nofollow">Gulp Developer Survey</a> today!`,
22+
isCloseable: false,
23+
},
1824
colorMode: {
1925
defaultMode: 'light',
2026
disableSwitch: true,
@@ -170,25 +176,34 @@ module.exports = {
170176
// flexBasis: '80px',
171177
// },
172178
// },
173-
{
174-
href: 'https://word.tips/',
175-
src: 'sponsor-logos/word-tips.png',
176-
alt: 'WordTips logo',
177-
title: 'WordTips',
178-
style: {
179-
flexBasis: '150px',
180-
},
181-
},
182-
// Stopped donating on June 15th, 2022
179+
// Stopped donating in Sept 2023
183180
// {
184-
// href: 'https://developer.americanexpress.com',
185-
// src: 'sponsor-logos/american-express.svg',
186-
// alt: 'American Express',
187-
// title: 'American Express',
181+
// href: 'https://word.tips/',
182+
// src: 'sponsor-logos/word-tips.png',
183+
// alt: 'WordTips logo',
184+
// title: 'WordTips',
188185
// style: {
189-
// flexBasis: '145px',
186+
// flexBasis: '150px',
190187
// },
191188
// },
189+
{
190+
href: 'https://developer.americanexpress.com',
191+
src: 'sponsor-logos/american-express.svg',
192+
alt: 'American Express',
193+
title: 'American Express',
194+
style: {
195+
flexBasis: '145px',
196+
},
197+
},
198+
{
199+
href: 'https://webweekly.email/',
200+
src: 'sponsor-logos/web-weekly.svg',
201+
alt: 'Web Weekly - Your friendly web dev newsletter',
202+
title: 'Web Weekly - Your friendly web dev newsletter',
203+
style: {
204+
flexBasis: '175px',
205+
}
206+
}
192207
]
193208
},
194209
stylesheets: [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import {translate} from '@docusaurus/Translate';
4+
import IconClose from '@theme/Icon/Close';
5+
import styles from './styles.module.css';
6+
export default function AnnouncementBarCloseButton(props) {
7+
return (
8+
<button
9+
type="button"
10+
aria-label={translate({
11+
id: 'theme.AnnouncementBar.closeButtonAriaLabel',
12+
message: 'Close',
13+
description: 'The ARIA label for close button of announcement bar',
14+
})}
15+
{...props}
16+
className={clsx('clean-btn close', styles.closeButton, props.className)}>
17+
<IconClose width={14} height={14} strokeWidth={3.1} />
18+
</button>
19+
);
20+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.closeButton {
2+
padding: 0;
3+
line-height: 0;
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import {useThemeConfig} from '@docusaurus/theme-common';
4+
import styles from './styles.module.css';
5+
export default function AnnouncementBarContent(props) {
6+
const {announcementBar} = useThemeConfig();
7+
const {content} = announcementBar;
8+
return (
9+
<div
10+
{...props}
11+
className={clsx(styles.content, props.className)}
12+
// Developer provided the HTML, so assume it's safe.
13+
// eslint-disable-next-line react/no-danger
14+
dangerouslySetInnerHTML={{__html: content}}
15+
/>
16+
);
17+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.content {
2+
font-size: 1rem;
3+
text-align: center;
4+
padding: 5px 0;
5+
}
6+
7+
.content a {
8+
color: var(--ifm-color-primary);
9+
text-decoration: underline;
10+
}

src/theme/AnnouncementBar/index.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from 'react';
2+
import {useThemeConfig} from '@docusaurus/theme-common';
3+
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
4+
import AnnouncementBarCloseButton from '@theme/AnnouncementBar/CloseButton';
5+
import AnnouncementBarContent from '@theme/AnnouncementBar/Content';
6+
import styles from './styles.module.css';
7+
export default function AnnouncementBar() {
8+
const {announcementBar} = useThemeConfig();
9+
const {isActive, close} = useAnnouncementBar();
10+
if (!isActive) {
11+
return null;
12+
}
13+
const {backgroundColor, textColor, isCloseable} = announcementBar;
14+
return (
15+
<div
16+
className={styles.announcementBar}
17+
style={{backgroundColor, color: textColor}}
18+
role="banner">
19+
{isCloseable && <div className={styles.announcementBarPlaceholder} />}
20+
<AnnouncementBarContent className={styles.announcementBarContent} />
21+
{isCloseable && (
22+
<AnnouncementBarCloseButton
23+
onClick={close}
24+
className={styles.announcementBarClose}
25+
/>
26+
)}
27+
</div>
28+
);
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.announcementBar {
2+
display: flex;
3+
align-items: center;
4+
height: 64px;
5+
background-color: var(--ifm-color-secondary);
6+
color: var(--ifm-color-white);
7+
}
8+
9+
html[data-announcement-bar-initially-dismissed='true'] .announcementBar {
10+
display: none;
11+
}
12+
13+
.announcementBarPlaceholder {
14+
flex: 0 0 10px;
15+
}
16+
17+
.announcementBarClose {
18+
flex: 0 0 30px;
19+
align-self: stretch;
20+
}
21+
22+
.announcementBarContent {
23+
flex: 1 1 auto;
24+
}
25+
26+
@media print {
27+
.announcementBar {
28+
display: none;
29+
}
30+
}
31+
32+
@media (min-width: 997px) {
33+
34+
.announcementBarPlaceholder,
35+
.announcementBarClose {
36+
flex-basis: 50px;
37+
}
38+
}

src/theme/BackerSection/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function BackerSection() {
2222
</div>
2323
<div className={styles.tier}>
2424
<h3 className={styles.tierTitle}>$5 each month</h3>
25-
<p>We'll rotate your avatar through the individual contributors banner below.</p>
25+
<p>In the future, we'll rotate your avatar through an individual contributors banner below.</p>
2626
<ExternalLink href="https://github.com/sponsors/gulpjs?tier_id=24680" className={styles.tierButton}>Donate $5</ExternalLink>
2727
</div>
2828
<div className={styles.tier}>
2929
<h3 className={styles.tierTitle}>$10 each month</h3>
30-
<p>We'll thank you on Twitter and rotate your avatar through the individual contributors banner below.</p>
30+
<p>We'll thank you on Twitter and, in the future, rotate your avatar through an individual contributors banner below.</p>
3131
<ExternalLink href="https://github.com/sponsors/gulpjs?tier_id=24681" className={styles.tierButton}>Donate $10</ExternalLink>
3232
</div>
3333
</div>

static/sponsor-logos/web-weekly.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy