We have put interface elements together to create a collection of reusable components inside the Synerise application. Every person that contributes by building products for Synerise can refer to the library of components to combine them and create coherent designs for merchants.
This way, instead of making over the interface elements, we can stay concentrated on finding solutions to unique challenges.
React UI component library, inspired by Ant Design was introduced to support developers in implementing the best experience for Synerise merchants.
Each component is installed separately. If you want to use one of them you have to use DSProvider first.
DSProvider is located in @synerise/ds-core package.
DSProvider serves the functions of:
- ThemeProvider (https://styled-components.com/docs/advanced#theming)
- IntlProvider (https://formatjs.io/docs/react-intl/components#intlprovider)
It provides a theme with all variables, colors and so on, which are required for proper working of all components, and passes the configuration of internationalization. DSProvider is required by all components.
Before the component installation, you must add react-intl, styled-components and antd packages.
yarn add react-intl styled-components antd@4.7.0
npm install react-intl styled-components antd@4.7.0 --save
And then, you can install a component (example with the Button component):
yarn add @synerise/ds-core @synerise/ds-button
npm install @synerise/ds-core @synerise/ds-button —-save
import { DSProvider } from "@synerise/ds-core";
import Button from "@synerise/ds-button";
<DSProvider>
<Button>Click me!</Button>
</DSProvider>