Frontend
Learn how Chartbrew frontend works
Structure
How this works
If you never used React Redux before, it’s strongly recommended to run a quick-start before attempting to modify anything in the front-end.
The main point on future developments will be to always develop with the props down, events up mentality. In Chartbrew this means that a container should send the props to a component and the component can call any events that were passed down by the container. The events will run in the parent component.
The new components should be functional and use React Hooks.
::: warning Currently, the containers are quite huge and some components are not as dumb as they should be. This will be improved with future updates. :::
Example
The following example will create a dummy container with a component, reducer and action.
Actions
The actions are placed in the actions/
folder.
Reducer
The reducers are placed in the reducers/
folder and registered in the index
file there.
Don’t forget to register this reducer in the index.js
file in the same folder.
Component
This will be an example component to show the name and flavour of the brew and a simple button with an event attached.
Container
This will be a page showing the BrewCard component after getting calling the getBrew
action.
Styling
Chartbrew is using NextUI for the components.
The react components usable within Chartbrew can be found here.
For any changes to the general feel of the site you can modify Sematic’s global variables in src/theme.js
. You can check out the theming docs on NextUI’s website.