status-react/src/quo
Jakub Sokołowski 0f8ad69319
Nix/upgrade zprint 1.2.5 (#15113)
* nix: upgrade zprint from 1.2.4 to 1.2.5

To address issue described in:
https://github.com/kkinnear/zprint/issues/273

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* chore: use zprint :multi-lhs-hang

* refactor: re-format clojure using zprint 1.2.5

---------

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Co-authored-by: yqrashawn <namy.19@gmail.com>
2023-02-17 20:10:00 +08:00
..
components Nix/upgrade zprint 1.2.5 (#15113) 2023-02-17 20:10:00 +08:00
design_system refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
previews Nix/upgrade zprint 1.2.5 (#15113) 2023-02-17 20:10:00 +08:00
README.md Use native binary for the clj-kondo linter (#14179) 2022-10-19 09:54:01 -03:00
animated.cljs refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
core.cljs refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
gesture_handler.cljs fix some of the app elements periodically stop responding on the android (#14935) 2023-01-31 19:13:02 +05:30
haptic.cljs refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
platform.cljs Merge password screens 2020-07-15 11:28:02 +03:00
react.clj refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
react.cljs refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00
react_native.cljs Nix/upgrade zprint 1.2.5 (#15113) 2023-02-17 20:10:00 +08:00
spec.cljs Add text input and tooltip components 2020-05-04 16:38:26 +03:00
theme.cljs refactor: reformat all clojure code with zprint (#14589) 2022-12-20 22:45:37 +08:00

README.md

Status Quo Components

All components in Quo should be independent of the app state. They should be pure and easy to reason about. Avoiding the app state is also required to make the library independent and easy to be pulled off as a separate repository when needed. To avoid high coupling and direct use of internal styling, the components should be exported via namespace quo.core and used by the Status app only from there. This will allow a more flexible way to update components without possible breakages into the app style.

Quo components should not have any dependency on the Status app, this will avoid circular dependency and also benefit the independence of the components.

All components are stored inside components namespaces. They are stateless and do not dispatch and subscribe to re-frame database. All state should be passed by props and all events can be passed as functions. Avoiding direct connection with re-frame will allow components to grow and be reused in different places without the conditionals hell.

All style system constants are stored inside design-system namespaces. They are used to build components and can be directly required by the status app. Avoid duplication of these vars and do not use them in code directly as a value.

For each component introduced, add previews of all possible states.

Do not introduce components for slightly modified existing components, if they are not a part of the design system. In case they are required in one place in the app, use style override.

Code style

Ensure that your changes match the style of the rest of the code. This library uses Clojure Community code style The Clojure Style Guide. To ensure consistency, run make lint, which uses the clj-kondo linter.

Best practices

  • Design components atomically and compose them into bigger components.
  • Do not export individual atoms, only components. This way we can limit design system to be used in too many way which can creating disjointed experiences.
  • Avoid external margins for atom components, it can be added on the wrapper where they are used but can't be removed without overriding. Max Stoiber article on margins
  • Design reusable components into Layout Isolated Components (Article more relates to web, but ideas fits also to mobile development)
  • Explicit is better than implicit, do not rely on platform default, if you expect a specific value, then override it

TBD:

  • Components documentation
  • Check props using spec in pre conditions.