Skip to content

Commit 0425da2

Browse files
author
Carms Ng
committed
[UPD] linting & rename components filename to UpperCamelCase
1 parent f18990d commit 0425da2

20 files changed

+445
-338
lines changed

gatsby-browser.js

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
/**
2-
* Implement Gatsby's Browser APIs in this file.
3-
*
4-
* See: https://www.gatsbyjs.com/docs/browser-apis/
5-
*/
61
import './src/styles/global.css';

gatsby-config.js

+38-38
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
module.exports = {
2-
pathPrefix: "/coderbunker.ca",
2+
pathPrefix: '/coderbunker.ca',
33
siteMetadata: {
4-
title: `Coderbunker Canada`,
5-
author: `@Carms-dev`,
6-
description: `Coderbunker est une communauté internationale de passionnés de développement logiciel. Nous fonctionnons sur une base de budget d'ingénierie mensuels prépayés sur lesquels nous recrutons des équipes formées de talents flexibles qui participent activement dans la construction d'une communauté qui les rends heureux.`,
4+
title: 'Coderbunker Canada',
5+
author: '@Carms-dev',
6+
description: 'Coderbunker est une communauté internationale de passionnés de développement logiciel. Nous fonctionnons sur une base de budget d\'ingénierie mensuels prépayés sur lesquels nous recrutons des équipes formées de talents flexibles qui participent activement dans la construction d\'une communauté qui les rends heureux.',
77
},
88
plugins: [
9-
`gatsby-transformer-json`,
9+
'gatsby-transformer-json',
1010

11-
`gatsby-plugin-postcss`,
12-
`gatsby-plugin-styled-components`,
13-
`gatsby-plugin-react-helmet`,
14-
`gatsby-plugin-image`,
11+
'gatsby-plugin-postcss',
12+
'gatsby-plugin-styled-components',
13+
'gatsby-plugin-react-helmet',
14+
'gatsby-plugin-image',
1515
{
16-
resolve: `gatsby-source-filesystem`,
16+
resolve: 'gatsby-source-filesystem',
1717
options: {
18-
name: `images`,
18+
name: 'images',
1919
path: `${__dirname}/src/assets/images`,
2020
},
2121
},
2222
{
23-
resolve: `gatsby-source-filesystem`,
23+
resolve: 'gatsby-source-filesystem',
2424
options: {
25-
name: `assets`,
25+
name: 'assets',
2626
path: `${__dirname}/src/assets`,
2727
},
2828
},
2929
{
30-
resolve: `gatsby-source-filesystem`,
30+
resolve: 'gatsby-source-filesystem',
3131
options: {
32-
name: `content`,
32+
name: 'content',
3333
path: `${__dirname}/src/assets/content`,
3434
},
3535
},
3636
{
37-
resolve: `gatsby-source-filesystem`,
37+
resolve: 'gatsby-source-filesystem',
3838
options: {
39-
name: `locale`,
39+
name: 'locale',
4040
path: `${__dirname}/locales`,
41-
}
41+
},
4242
},
43-
`gatsby-transformer-sharp`,
43+
'gatsby-transformer-sharp',
4444
{
45-
resolve: `gatsby-plugin-sharp`,
45+
resolve: 'gatsby-plugin-sharp',
4646
options: {
4747
defaults: {
48-
formats: [`auto`, `webp`],
49-
placeholder: `dominantColor`,
48+
formats: ['auto', 'webp'],
49+
placeholder: 'dominantColor',
5050
quality: 50,
5151
breakpoints: [750, 1080, 1366, 1920],
52-
backgroundColor: `transparent`,
52+
backgroundColor: 'transparent',
5353
tracedSVGOptions: {},
5454
blurredOptions: {},
5555
jpgOptions: {},
@@ -60,39 +60,39 @@ module.exports = {
6060
},
6161
},
6262
{
63-
resolve: `gatsby-plugin-manifest`,
63+
resolve: 'gatsby-plugin-manifest',
6464
options: {
6565
icon: `${__dirname}/src/assets/images/coderbunker-icon.png`, // This path is relative to the root of the site.
6666
},
6767
},
6868
{
69-
resolve: `gatsby-plugin-react-i18next`,
69+
resolve: 'gatsby-plugin-react-i18next',
7070
options: {
71-
localeJsonSourceName: `locale`, // name given to `gatsby-source-filesystem` plugin.
72-
languages: [`en`, `fr`],
73-
defaultLanguage: `en`,
71+
localeJsonSourceName: 'locale', // name given to `gatsby-source-filesystem` plugin.
72+
languages: ['en', 'fr'],
73+
defaultLanguage: 'en',
7474
// if you are using Helmet, you must include siteUrl, and make sure you add http:https
75-
siteUrl: `https://coderbunker.ca/`,
75+
siteUrl: 'https://coderbunker.ca/',
7676
// you can pass any i18next options
7777
i18nextOptions: {
7878
interpolation: {
79-
escapeValue: false // not needed for react as it escapes by default
79+
escapeValue: false, // not needed for react as it escapes by default
8080
},
8181
keySeparator: false,
82-
nsSeparator: false
82+
nsSeparator: false,
8383
},
8484
pages: [
8585
{
8686
matchPath: '/:language?/members/:name',
8787
getLanguageFromPath: true,
88-
excludeLanguages: []
88+
excludeLanguages: [],
8989
},
9090
{
9191
matchPath: '/preview',
92-
languages: ['en']
93-
}
94-
]
95-
}
96-
}
92+
languages: ['en'],
93+
},
94+
],
95+
},
96+
},
9797
],
98-
}
98+
};

gatsby-node.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const { graphql } = require("gatsby")
2-
const path = require(`path`)
1+
const { graphql } = require('gatsby');
2+
const path = require('path');
33

44
// create member pages
55
exports.createPages = async ({ graphql, actions }) => {
6-
const { createPage } = actions
6+
const { createPage } = actions;
77

88
const result = await graphql(`
99
query {
@@ -29,24 +29,24 @@ exports.createPages = async ({ graphql, actions }) => {
2929
}
3030
}
3131
}
32-
`)
32+
`);
3333

34-
result.data.allMembersJson.nodes.forEach(node => {
35-
const member = node.en.name
36-
const id = node.parent.id
37-
const slug = result.data.allFile.nodes.find(node => node.id === id).name.substring(3, )
34+
result.data.allMembersJson.nodes.forEach((node) => {
35+
const member = node.en.name;
36+
const { id } = node.parent;
37+
const slug = result.data.allFile.nodes.find((node) => node.id === id).name.substring(3);
3838

39-
Object.keys(node).forEach(key => {
40-
if (key !== "parent") {
41-
const language = key
42-
const template = "MemberPage.js"
39+
Object.keys(node).forEach((key) => {
40+
if (key !== 'parent') {
41+
const language = key;
42+
const template = 'MemberPage.js';
4343

4444
createPage({
45-
path: `${language === "en" ? "" : "/fr"}/members/${slug}`,
45+
path: `${language === 'en' ? '' : '/fr'}/members/${slug}`,
4646
component: path.resolve(`./src/templates/${template}`),
47-
context: { slug: slug, language: language, member: member }
48-
})
47+
context: { slug, language, member },
48+
});
4949
}
50-
})
51-
})
52-
}
50+
});
51+
});
52+
};

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
};

src/components/BackgroundImage.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as React from 'react';
2+
import { graphql, useStaticQuery } from 'gatsby';
3+
import { GatsbyImage } from 'gatsby-plugin-image';
4+
5+
export default function BackgroundImage({ style, imgStyle }) {
6+
const data = useStaticQuery(graphql`{
7+
fileName: file(relativePath: {eq: "bunker.png"}) {
8+
childImageSharp {
9+
gatsbyImageData(
10+
width: 1000,
11+
placeholder: BLURRED
12+
layout: CONSTRAINED
13+
)
14+
}
15+
}
16+
}
17+
`);
18+
19+
return (
20+
<>
21+
<GatsbyImage
22+
image={data.fileName.childImageSharp.gatsbyImageData}
23+
style={style}
24+
imgStyle={imgStyle}
25+
alt="Coderbunker background image"
26+
/>
27+
</>
28+
);
29+
}

src/components/button.js src/components/Button.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1-
import * as React from "react";
1+
import React from 'react';
22
import styled from 'styled-components';
33
import { Trans, useTranslation } from 'gatsby-plugin-react-i18next';
44

55
function CallToAction() {
6-
const {t} = useTranslation();
6+
const { t } = useTranslation();
77

88
return (
99
<ButtonStyle>
1010
<a href={t('https://form.jotform.com/211253962199057')} target="_blank" rel="noreferrer" className="px-4 md:px-6 py-2 text-lg md:text-xl">
1111
<Trans>Retain Us</Trans>
1212
</a>
1313
</ButtonStyle>
14-
)
14+
);
1515
}
1616

17-
function ButtonRed({ type, text, className, style, dataAos, dataAosDelay }) {
17+
function ButtonRed({
18+
type, text, className, style,
19+
}) {
1820
return (
1921
<ButtonStyle>
20-
<button data-aos={dataAos} data-aos-delay={dataAosDelay} type={type} className={`px-4 md:px-6 py-2 text-lg md:text-xl ${className ? className : ""}`} style={style}>{text}</button>
22+
<button
23+
type={type === 'submit' ? 'submit' : 'button'}
24+
className={`px-4 md:px-6 py-2 text-lg md:text-xl ${className || ''}`}
25+
style={style}
26+
>
27+
{text}
28+
29+
</button>
2130
</ButtonStyle>
22-
)
31+
);
2332
}
2433

2534
export { CallToAction, ButtonRed };
@@ -39,5 +48,4 @@ const ButtonStyle = styled.div`
3948
color: var(--white) !important;
4049
}
4150
}
42-
`
43-
51+
`;

src/components/carousel.js src/components/Carousel.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { graphql, useStaticQuery } from 'gatsby';
3-
import CarouselCard from "./CarouselCard";
3+
import CarouselCard from './CarouselCard';
44

55
export default function Carousel({ teamIndex, setTeamIndex, locale }) {
66
// Query all team member info
@@ -46,23 +46,21 @@ export default function Carousel({ teamIndex, setTeamIndex, locale }) {
4646
}
4747
}`);
4848

49-
const members = allMembersJson.nodes
50-
const membersLocalized = members.map(member => member[locale])
49+
const members = allMembersJson.nodes;
50+
const membersLocalized = members.map((member) => member[locale]);
5151

5252
return (
5353
<>
54-
{membersLocalized.map((member, index) => {
55-
return(
56-
<CarouselCard
57-
member={member}
58-
key={member.github}
59-
index={index}
60-
count={members.length}
61-
teamIndex={teamIndex}
62-
setTeamIndex={setTeamIndex}
63-
/>
64-
)
65-
})}
54+
{membersLocalized.map((member, index) => (
55+
<CarouselCard
56+
member={member}
57+
key={member.github}
58+
index={index}
59+
count={members.length}
60+
teamIndex={teamIndex}
61+
setTeamIndex={setTeamIndex}
62+
/>
63+
))}
6664
</>
67-
)
65+
);
6866
}

0 commit comments

Comments
 (0)