diff --git a/components/support/support-additional.json b/components/support/support-additional.json deleted file mode 100644 index 3c5ba567e6c4..000000000000 --- a/components/support/support-additional.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "id": 20000, - "name": "MoonMail", - "username": "moonmail", - "tier": "sponsor", - "avatar": "https://static.moonmail.io/moonmail-logo.svg", - "website": "https://moonmail.io/?utm_source=webpack.js.org" - }, - { - "index": 20001, - "name": "MONEI", - "username": "monei", - "tier": "sponsor", - "avatar": "https://static.monei.net/monei-logo.svg", - "website": "https://monei.net/?utm_source=webpack.js.org" - } -] diff --git a/components/support/support-style.scss b/components/support/support-style.scss index b08b3b460619..40b243cab2cc 100644 --- a/components/support/support-style.scss +++ b/components/support/support-style.scss @@ -4,52 +4,32 @@ display: flex; flex-wrap: wrap; justify-content: center; - padding: 1em 0.5em; + padding:10px 5px; &__item { - position: relative; - margin: 0 5px 5px 5px; - } - - &__sponsors-avatar { - height: 64px; - } - - &__backers-avatar { - width: 62px; - height: 62px; - border-radius: 50%; - border: 2px solid white; - overflow: hidden; - } - - &__outline { - position: absolute; - top: 0; - margin: -2px; - width: calc(100% + 4px); - height: calc(100% - 2px); - border-radius: 50%; - border: 2px solid rgb(112, 202, 10); + margin:0 5px; } &__bottom { - flex: 0 0 100%; - margin-top: 1em; + flex:0 0 100%; + margin-top:10px; } &__button { - display: inline-block; - padding: 0.4em 1em; - text-transform: uppercase; - color: getColor(denim); - border: 1px solid getColor(denim); - border-radius: 1.25em; - transition: all 250ms; + display:inline-block; + padding:0.4em 1em; + border:2px solid getColor(denim); + color:getColor(denim); + border-radius:1.25em; + transition:all 250ms; &:hover { - background: getColor(denim); - color: getColor(white); + background:getColor(denim); + color:getColor(white); } } -} + &__missing { + display: flex; + align-items: center; + } +} \ No newline at end of file diff --git a/components/support/support.jsx b/components/support/support.jsx index 5069792f9595..9d5ad491ce41 100644 --- a/components/support/support.jsx +++ b/components/support/support.jsx @@ -1,59 +1,56 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import Additional from './support-additional.json'; -import 'whatwg-fetch'; import './support-style'; -export default class Support extends React.Component { - static propTypes = { - number: PropTypes.number.isRequired, - type: PropTypes.oneOf([ - 'sponsors', - 'backers' - ]).isRequired - }; - - state = { - supporters: [], - error: false +const MISSING_SPONSORS = [ + { + index: 33, + name: 'MoonMail', + title: 'Email Marketing Software', + logo: 'https://static.moonmail.io/moonmail-logo.svg', + url: 'https://moonmail.io/?utm_source=webpack.js.org' + }, + { + index: 34, + name: 'MONEI', + title: 'Best payment gateway rates', + logo: 'https://static.monei.net/monei-logo.svg', + url: 'https://monei.net/?utm_source=webpack.js.org' } +]; - render() { - let { number, type } = this.props; - let { supporters } = this.state; - - return ( -
- { - supporters.slice(0, number).map((supporter, i) => ( - - { - { type === 'backers' ?
: null } - - )) - } +export default ({number, type}) => { + const supportItems = [...Array(number)].map((x, i) => + + { + + ); -
- - Become a { type.replace(/s$/, '') } - -
-
- ); + // add missing sponsors + if (type === 'sponsor') { + MISSING_SPONSORS.forEach(sponsor => { + supportItems.splice(sponsor.index, 0, ( + + { + + )); + }); } - componentDidMount() { - let { type } = this.props; - - fetch(`https://opencollective.com/webpack/${type}.json`) - .then(response => response.json()) - .then(json => this.setState({ supporters: json.concat(Additional) })) - .catch(error => this.setState({ error: true })); - } -} + return ( +
+ {supportItems} +
+ ); +}; diff --git a/content/plugins/environment-plugin.md b/content/plugins/environment-plugin.md index 22fc09c228bc..8e5c5001e5a2 100644 --- a/content/plugins/environment-plugin.md +++ b/content/plugins/environment-plugin.md @@ -83,7 +83,7 @@ if ('false') { // <-- 'false' from DEBUG is taken The third-party [`DotenvPlugin`](https://github.com/mrsteele/dotenv-webpack) (`dotenv-webpack`) allows you to expose (a subset of) [dotenv variables](https://www.npmjs.com/package/dotenv): -```conf +``` bash // .env DB_HOST=127.0.0.1 DB_PASS=foobar @@ -95,4 +95,4 @@ S3_API=mysecretkey path: './.env', // Path to .env file (this is the default) safe: true // load .env.example (defaults to "false" which does not use dotenv-safe) }) -``` \ No newline at end of file +```