Skip to content

Commit 652957b

Browse files
authored
Merge pull request #126 from m2mathew/dev
2.15.0
2 parents 8e3f35f + ab38f8b commit 652957b

File tree

228 files changed

+13168
-14485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+13168
-14485
lines changed

.eslintrc.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ module.exports = {
33
'eslint:recommended',
44
'plugin:react/recommended',
55
'airbnb',
6-
'plugin:@typescript-eslint/recommended'
6+
'plugin:@typescript-eslint/recommended',
7+
'react-app',
78
],
89
rules: {
910
'@typescript-eslint/explicit-function-return-type': 'off',
@@ -31,15 +32,24 @@ module.exports = {
3132
'no-shadow': 0,
3233
'no-underscore-dangle': 0,
3334
'react/forbid-prop-types': 1,
35+
'react/function-component-definition': 'off',
3436
'react/jsx-filename-extension': 'off',
3537
'react/jsx-one-expression-per-line': 0,
38+
'react/jsx-max-props-per-line': [
39+
2,
40+
{
41+
maximum: 1,
42+
},
43+
],
3644
'react/jsx-props-no-spreading': 0,
3745
'react/jsx-uses-vars': [2],
3846
'react/no-did-mount-set-state': 0,
3947
'react/prefer-stateless-function': 1,
4048
'react/prop-types': 'off', // Disable prop-types as we use TypeScript for type checking
4149
'react/react-in-jsx-scope': 0,
4250
'react/require-default-props': 0,
51+
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
52+
'react-hooks/rules-of-hooks': 'warn', // Checks rules of Hooks
4353
},
4454
settings: {
4555
// 'import/core-modules': ['react', 'prop-types']
@@ -48,7 +58,8 @@ module.exports = {
4858
}
4959
},
5060
globals: {
51-
graphql: true
61+
__PATH_PREFIX__: true,
62+
graphql: true,
5263
},
5364
overrides: [
5465
{

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

README.md

+37-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
# TMAC
22

3+
Texas Music Administrators Conference ([link](https://www.texasmusicadmin.com/))
4+
35
This website was constructed for Jeff Turner, Mario Luna, and the Texas Music Administrators Conference. Planning began in January 2018 with building starting in mid-February 2018.
46

57
## Tools
68

79
- GatsbyJS
810
- React
9-
- Glamor
1011
- Contentful (as CMS)
1112
- Cloudinary (as CDN)
1213
- Firebase for authentication
1314
- Firestore for data storage
1415
- Google Scripts to sync with Firebase data
15-
- Material-UI
16+
- MUI
17+
- TypeScript (partially implemented)
18+
19+
### Gatsby Plugins
20+
21+
- `gatsby-theme-material-ui`
22+
- This provides up-to-date MUI components and theming. Some components like `Link` have been updated to work with Gatsby.
23+
- `@sentry/gatsby`
24+
- Adds ability for Sentry to catch exceptions that users encounter on the site. Check the attached Sentry account for info on specific errors.
25+
- All Sentry packages need to be on the same version.
26+
- `gatsby-source-contentful`
27+
- These parts of the site fetch data from Contentful at build time:
28+
- Officers
29+
- Area Representatives
30+
- Some Events
31+
- If the Contentful data is updated, a TMAC dev needs to re-deploy the site on Netliy for the changes to go live.
32+
- `gatsby-plugin-typography`
33+
- Allows adding custom fonts
34+
- `gatsby-plugin-canonical-urls`
35+
- Inserts a `link` tag in the head of each page with `rel="canonical"` added. This helps ensure that all saved pages everywhere will point to the `https` address for this site.
1636

1737
## Inspiration
1838

@@ -21,7 +41,21 @@ Heavily inspired by the Gatsby v1 documentation website.
2141
## Running in development
2242

2343
1. Clone this repo
44+
1. Add `.env` file based on `example.env`. Get secret values from another TMAC dev.
2445
2. Install dependencies → `yarn`
25-
3. Start the development server → `yarn develop`
46+
3. Start the development server → `yarn dev`
47+
48+
## Version History
49+
50+
- v1
51+
- An old WordPress site. The person in charge of it somehow deleted it completely.
52+
- Mike Mathew sifted through the Internet Archive to find older content to fit into the redesigned site.
53+
- v2
54+
- A Gatsby site represented by this repository.
55+
- Gatsby v1 through v3 were built 2018-2022
56+
- Gatsby v4 update was November 2022
57+
- v3 (coming soon)
58+
- The organization's name changed to Texas Fine Arts Administrators (TFAA) in Fall 2022.
59+
- A modernized Gatsby site with a fresh coat of paint from Luis Velasquez at [LV Branding](https://www.lvbranding.com/)
2660

2761
:musical_note: :trumpet: :saxophone:

example.env

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contentful
2+
GATSBY_CONTENTFUL_SPACE_ID=secret_value
3+
GATSBY_CONTENTFUL_ACCESS_TOKEN=secret_value
4+
5+
# Firebase data to use locally
6+
GATSBY_FIREBASE_API_KEY=secret_value
7+
GATSBY_FIREBASE_AUTH_DOMAIN=secret_value
8+
GATSBY_FIREBASE_DATABASE_URL=secret_value
9+
GATSBY_FIREBASE_PROJECT_ID=secret_value
10+
GATSBY_FIREBASE_STORAGE_BUCKET=secret_value
11+
GATSBY_FIREBASE_MESSAGING_SENDER_ID=secret_value
12+
13+
# Firebase staging
14+
# GATSBY_FIREBASE_API_KEY_STAGING=secret_value
15+
# GATSBY_FIREBASE_AUTH_DOMAIN_STAGING=secret_value
16+
# GATSBY_FIREBASE_DATABASE_URL_STAGING=secret_value
17+
# GATSBY_FIREBASE_PROJECT_ID_STAGING=secret_value
18+
# GATSBY_FIREBASE_STORAGE_BUCKET_STAGING=secret_value
19+
# GATSBY_FIREBASE_MESSAGING_SENDER_ID_STAGING=secret_value
20+
21+
# Firebase prod
22+
# GATSBY_FIREBASE_API_KEY_PROD=secret_value
23+
# GATSBY_FIREBASE_AUTH_DOMAIN_PROD=secret_value
24+
# GATSBY_FIREBASE_DATABASE_URL_PROD=secret_value
25+
# GATSBY_FIREBASE_PROJECT_ID_PROD=secret_value
26+
# GATSBY_FIREBASE_STORAGE_BUCKET_PROD=secret_value
27+
# GATSBY_FIREBASE_MESSAGING_SENDER_ID_PROD=secret_value
28+
29+
# Google Sheets
30+
GATSBY_GOOGLE_API_KEY=secret_value
31+
GATSBY_CLIENT_ID=secret_value
32+
GATSBY_SPREADSHEET_ID=secret_value
33+
34+
# Google reCAPTCHA
35+
GATSBY_GOOGLE_RECAPTCHA_SITE_KEY=secret_value
36+
37+
# Paypal
38+
GATSBY_PAYPAL_CLIENT_ID_SANDBOX=secret_value
39+
GATSBY_PAYPAL_CLIENT_ID_PRODUCTION=secret_value
40+
41+
# Sentry
42+
GATSBY_SENTRY_DSN=secret_value

gatsby-browser.js

+93-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,94 @@
1-
// import ReactDOM from 'react-dom';
1+
import { init } from '@sentry/gatsby';
2+
import { BrowserTracing } from '@sentry/tracing';
3+
import { Dedupe, ExtraErrorData } from '@sentry/integrations';
24

3-
// export const replaceHydrateFunction = () => {
4-
// return (element, container, callback) => {
5-
// ReactDOM.render(element, container, callback);
6-
// };
7-
// };
5+
/**
6+
* Called when the Gatsby browser runtime first starts.
7+
*/
8+
export const onClientEntry = async () => {
9+
/**
10+
* Available Options: https://docs.sentry.io/error-reporting/configuration/?platform=browser
11+
*/
12+
init({
13+
dsn: process.env.GATSBY_SENTRY_DSN,
14+
// release: __DYNAMIC_RELEASE_STRING__, // eslint-disable-line
15+
// environment: process.env.GATSBY_ACTIVE_ENV,
16+
// debug: process.env.GATSBY_SENTRY_DEBUG_MODE === 'true',
17+
maxBreadcrumbs: 50,
18+
autoSessionTracking: true,
19+
20+
// You can log events to Sentry, even locally in development env, but you need to opt-in for it.
21+
// enabled: process.env.GATSBY_ACTIVE_ENV === 'production'
22+
// || process.env.GATSBY_SENTRY_DEBUG_MODE === 'true',
23+
24+
normalizeDepth: 6,
25+
integrations: [
26+
new Dedupe(),
27+
new ExtraErrorData(),
28+
29+
// This enables automatic instrumentation (highly recommended), but is not
30+
// necessary for purely manual usage
31+
new BrowserTracing({
32+
tracingOrigins: ['localhost', 'domain-a.nl', 'domain-b.be', /^\//],
33+
}),
34+
],
35+
ignoreErrors: [
36+
'ResizeObserver loop limit exceeded',
37+
'CookieControl', // CookieBot related errors
38+
'webkitPresentationMode',
39+
'iFrameResizer',
40+
'iframe-resizer-react',
41+
'ChunkLoadError',
42+
'Pastease',
43+
],
44+
denyUrls: [
45+
/accutics\.net/,
46+
/cookiebot\.com/,
47+
/doubeclick\.net/,
48+
/facebook\.net/,
49+
/google\.com/,
50+
/google-analytics\.com/,
51+
/googleadservices\.com/,
52+
/hotjar\.com/,
53+
/mopinion\.com/,
54+
/omappapi\.com/,
55+
/opmnstr\.com/,
56+
/zdassets\.com/,
57+
/zendesk\.com/,
58+
/zopim\.com/,
59+
/cdn\.optimizely\.com/,
60+
],
61+
// beforeSend: (event) => {
62+
// if (['production', 'staging'].includes(process.env.GATSBY_ACTIVE_ENV)) {
63+
// // Debug messages will be shown for staging and production only
64+
// // if GATSBY_SENTRY_DEBUG_MODE env var set to 'true'.
65+
// // Fatal, error, warning and info messages will always be shown.
66+
// return event.level !== 'debug' || process.en
67+
// v.GATSBY_SENTRY_DEBUG_MODE === 'true' ? event : null;
68+
// }
69+
70+
// return null;
71+
// },
72+
beforeBreadcrumb: (breadcrumb) => {
73+
// All related to Hot Module Reloading locally, so no need to have it.
74+
if (breadcrumb.category === 'xhr' && breadcrumb.data && /socket.io\/\?EIO/.test(breadcrumb.data.url)) {
75+
return null;
76+
}
77+
78+
if (breadcrumb.category === 'console' && /\[HMR\]/.test(breadcrumb.message)) {
79+
return null;
80+
}
81+
82+
return breadcrumb;
83+
},
84+
// Stacktrace is always attached during errors.
85+
// If you want to see it also for debug, warning and info messages,
86+
// set the GATSBY_SENTRY_DEBUG_MODE to 'true'
87+
// attachStacktrace: process.env.GATSBY_SENTRY_DEBUG_MODE === 'true',
88+
89+
// Set tracesSampleRate to 1.0 to capture 100%
90+
// of transactions for performance monitoring.
91+
// We recommend adjusting this value in production
92+
tracesSampleRate: 0.02,
93+
});
94+
};

gatsby-config.js

+10-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// Give gatsby access to env keys
2-
require('dotenv').config({
2+
// eslint-disable-next-line @typescript-eslint/no-var-requires
3+
const dotenv = require('dotenv');
4+
5+
dotenv.config({
36
path: '.env',
47
});
58

@@ -10,33 +13,15 @@ module.exports = {
1013
description: 'Website for the Texas Music Administrators Conference',
1114
},
1215
plugins: [
13-
'gatsby-plugin-top-layout',
14-
{
15-
resolve: 'gatsby-plugin-material-ui',
16-
// If you want to use styled components, in conjunction to Material-UI, you should:
17-
// - Change the injection order
18-
// - Add the plugin
19-
options: {
20-
// stylesProvider: {
21-
// injectFirst: true,
22-
// },
23-
},
24-
},
25-
{
26-
resolve: '@sentry/gatsby',
27-
options: {
28-
dsn: 'https://[email protected]/5751393',
29-
sampleRate: 0.7,
30-
},
31-
},
16+
'gatsby-theme-material-ui',
17+
'gatsby-plugin-styled-components',
3218
{
3319
resolve: 'gatsby-source-contentful',
3420
options: {
3521
spaceId: process.env.GATSBY_CONTENTFUL_SPACE_ID,
3622
accessToken: process.env.GATSBY_CONTENTFUL_ACCESS_TOKEN,
3723
},
3824
},
39-
'gatsby-plugin-glamor',
4025
{
4126
resolve: 'gatsby-plugin-typography',
4227
options: {
@@ -51,6 +36,10 @@ module.exports = {
5136
},
5237
'gatsby-plugin-react-helmet',
5338
'gatsby-plugin-typescript',
39+
'gatsby-plugin-image',
5440
'gatsby-plugin-sharp',
41+
{
42+
resolve: '@sentry/gatsby',
43+
},
5544
],
5645
};

gatsby-ssr.js

+5-45
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,7 @@
1-
// /* eslint-disable react/no-danger */
1+
import React from 'react';
22

3-
// const React = require('react');
4-
// const { renderToString } = require('react-dom/server');
5-
// const { JssProvider } = require('react-jss');
6-
// const getPageContext = require('./src/utils/getPageContext').default;
3+
import Page from './src/components/layout';
74

8-
// function replaceRenderer({
9-
// bodyComponent,
10-
// replaceBodyHTMLString,
11-
// setHeadComponents,
12-
// }) {
13-
// // Get the context of the page to collected side effects.
14-
// const pageContext = getPageContext();
15-
16-
// const bodyHTML = renderToString(
17-
// <JssProvider
18-
// generateClassName={pageContext.generateClassName}
19-
// registry={pageContext.sheetsRegistry}
20-
// >
21-
// {bodyComponent}
22-
// </JssProvider>,
23-
// );
24-
25-
// replaceBodyHTMLString(bodyHTML);
26-
// setHeadComponents([
27-
// <style
28-
// type="text/css"
29-
// id="jss-server-side"
30-
// key="jss-server-side"
31-
// dangerouslySetInnerHTML={{
32-
// __html: pageContext.sheetsRegistry.toString(),
33-
// }}
34-
// />,
35-
// ]);
36-
// }
37-
38-
// exports.replaceRenderer = replaceRenderer;
39-
40-
// It's not ready yet: https://github.com/gatsbyjs/gatsby/issues/8237.
41-
//
42-
// const withRoot = require('./src/withRoot').default;
43-
// const WithRoot = withRoot(props => props.children);
44-
45-
// exports.wrapRootElement = ({ element }) => {
46-
// return <WithRoot>{element}</WithRoot>;
47-
// };
5+
export function wrapPageElement({ element, props }) {
6+
return <Page {...props}>{element}</Page>;
7+
}

0 commit comments

Comments
 (0)