qiusuo-fuyuan / qiusuo-frontend

0 stars 0 forks source link

Architecture Diagram #69

Open ryan-zheng-teki opened 4 years ago

ryan-zheng-teki commented 4 years ago

We need to make a stable architecture for the frontend. So that in the future, we could reuse all those components as much as possible.

Architecture Design Criteria

Component should be reusable as much as possible.

(1) Reusable Buttons For example, we have so many buttons everywhere. Everywhere we will create one button. Actually all buttons are pretty much the same. The only difference is the classNames and clickHandler and styles. We could actually create one GenericButton. This button will accept classNames, clickHandler as props

(2)Reusable Forms Forms normally have different fields. We can not reuse forms, but we could reuse the fields in the form.

(3)For the Graphql Query and Mutation. Mostly only the query name is different, So those boiler code could be patched into deeper level. Different APIs will pass different parameters to those general functions.