Giter Site home page Giter Site logo

redwood-light's Introduction

BASIC SETUP

SETUP CREATE-REACT-APP AND STYLED COMPONENTS

Initialize Create-React-App

  • npx create-react-app redwood-light-app

Setup React Router to handle routing to Awards, Contact and Team pages.

  • yarn add react-router-dom

Import BrowserBrowser router into index.js and wrap App element in BrowserRouter tags.

  • import { BrowserRouter } from 'react-router-dom';

Add Styled Components

  • yarn add styled-components

TESTING, ESLINT & PRETTIER SETUP

Add testing packages:

  • yarn add eslint-plugin-testing-library eslint-plugin-jest-dom

Add most recent UserEvent dependency to Testing Library

  • yarn add @testing-library/user-event@^14

Remove eslintconfig from package.json

Create .eslintrc and add standard config

{
  "plugins": [
    "jest-dom",
    "testing-library"
  ],
  "extends": [
    "react-app",
    "react-app/jest",
    "plugin:testing-library/react",
    "plugin:jest-dom/recommended"
  ]
}

Create .vscode/settings.json and add standard config

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

TYPESCRIPT CONFIGURATION

Add Typescript

  • yarn add typescript

Add React Types

  • yarn add --dev @types/react @types/react-dom @types/react-router-dom

Add Styled Component Types

  • yarn add --dev @types/styled-components

Setup PNG handling

  • create global.d.ts file in root directory
  • inside: declare module '*.png'; declare module '*.jpeg'; declare module '*.jpg';

Create tsconfig.json and save in root directory

  • "include" should reference the src folder and the global.d.ts file
  • "compiler options" should have "jsx" set to "react-jsx" and "target" set to "es6"

ADD REACT BOOTSTRAP

yarn add react-bootstrap bootstrap

Add react-bootstrap script tags to public/index.html from here: https://react-bootstrap.netlify.app/getting-started/introduction/#browser-globals

import react bootstrap into index.js import 'bootstrap/dist/css/bootstrap.min.css'

ADD FONTAWESOME FONTS

Using font awesome fonts for slideshow buttons:

Base and React packages:

yarn add @fortawesome/fontawesome-svg-core @fortawesome/react-fontawesome --save

Solid free icons: yarn add @fortawesome/free-solid-svg-icons --save

ADD REACT TRANSITION GROUP

This library handles transitions when components mount and unmount. Using it here to handle slideshow image transitions.

yarn add react-transition-group --save

add the types: yarn add @types/react-transition-group --dev --save

NETLIFY SETUP

Need to add a _resources file to the public folder with the following line to prevent 404 not found errors when reloading sub routes.

  • /* /index.html

redwood-light's People

Contributors

baconsocrispy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.