1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-07 22:46:13 +01:00
fab-manager/app/frontend/src/javascript/components/README.md
2022-05-04 12:27:12 +02:00

1.2 KiB

components

This directory is holding the components built with React.

During the migration phase, these components may be included in the legacy angularJS app using react2angular.

These components must be written using the following conventions:

  • The component name must be in CamelCase.
  • The component must be exported as a named export (no export default).
  • A component FooBar must have a className="foo-bar" attribute on its top-level element.
  • The stylesheet associated with the component must be located in app/frontend/src/stylesheets/modules/same-directory-structure/foo-bar.scss.
  • All methods in the component must be commented with a comment block.
  • Other constants and variables must be commented with an inline block.
  • Depending on if we want to use the <Suspense> wrapper or not, we can export the component directly or wrap it in a <Loader> wrapper.
  • When a component is used in angularJS, the wrapped is required. The component must be named like const Foo (no export if not used in React) and must have a const FooWrapper at the end of its file, which wraps the component in a <Loader>.