This is the main repo for NCMA Chapter websites.
Install dependencies with either yarn or npm. Most of us use yarn:
yarn
Run your local server with:
yarn start
It should now automatically open on localhost:8000.
We use .env files for our environment variables. You should have default envrionment variables in .env.development.
For more information on how Gatsby handles environment variables, read this.
You are welcome to come up with other solutions, but we typically do this:
npm install -g svg-to-react-cli(https://www.npmjs.com/package/svg-to-react-cli)- Navigate to the directory where there is your svg (e.g.
example.svg) - Run
svgtoreact example Example, this then createsExample.js(the React component for the svg). You can then import this component like any other React commponent.
styled-components (https://www.styled-components.com/).
- There is a theme object located in the globals directory, this is where styled are declared
- ThemeProvider is located in Layout where theme is passed to all child styled-components
ThemeProvider (https://www.styled-components.com/docs/api#themeprovider).