qri-io/2017-frontend

App component PropTypes needs documentation

Closed this issue · 1 comments

b5 commented

Most (all?) of our component PropTypes are under-documented. We should expand those with inline comments so these props are a little clearer. I think starting at the top with App.js makes the most sense:

https://github.com/qri-io/frontend/blob/a058fd0505d9c7b22221ddbfa63656ea3d568bec/lib/components/App.js#L230-L245

Let's add these comments:

App.propTypes = {
  // flag for unsaved changes to the editor
  editorDirty: PropTypes.bool,
  // application-wide error message shown in a flash message eg: "dataset not found"
  errorMessage: PropTypes.string,
  // application-wide message shown in a flash message eg: "dataset renamed"
  message: PropTypes.string,
  // react-router provided children
  children: PropTypes.node,
  // currently logged-in user session profile ID
  sessionProfile: PropTypes.string,

  // dismiss error message
  resetErrorMessage: PropTypes.func.isRequired,
  // dismiss message
  resetMessage: PropTypes.func.isRequired,
  // hide the main menu. not currently in use
  hideMenu: PropTypes.func.isRequired,
  // fetch the current user profile  
  loadSessionProfile: PropTypes.func.isRequired,

  // api connection status indicator
  apiConnection: PropTypes.number.isRequired,
  // navigate back in browser history
  goBack: PropTypes.func,
  // navigate forward in browser history
  goForward: PropTypes.func
}

Steps to complete:

  1. Fork this repo
  2. Read DEVELOPER.md to set up your dev environment
  3. Get Qri up & running locally.
  • run qri connect --disable-webapp in one terminal
  • from the frontend repo folder run yarn web:dev in a separate terminal, open localhost:2505 in a browser to see live changes whenever you save files in the frontend repo.
  1. Write a commit that adds the comments outlined in this issue, be sure to follow our commit guidelines. Something like docs(app): document app component PropTypes would work great.
  2. Open a Pull Request!
b5 commented

closed by #489, thanks @jlwaugh!