API requests follow redux-api-middleware syntax.
To make a request, we should use actions ending by request status :
export const SUBMIT_REQUEST = 'userrequest/SUBMIT_REQUEST';
export const SUBMIT_SUCCESS = 'userrequest/SUBMIT_SUCCESS';
export const SUBMIT_FAILURE = 'userrequest/SUBMIT_FAILURE';
Then we could make a request using a Symbol action named CALL_API
, with an array as types with 3 states (request, success, failure) :
export const submit = data => ({
[CALL_API]: {
endpoint: `/url`,
types: [SUBMIT_REQUEST, SUBMIT_SUCCESS, SUBMIT_FAILURE],
config: {
method: 'POST',
body: JSON.stringify(data),
},
},
});
- To set translation to one component, follow theses instructions:
import { translate } from 'react-i18next';
- Use it like HOC ->
export default translate('MyComponentTranslation')(MyComponent);
-
execute
this.props.t('Content')
were you need to translate. -
example:
<p>Content</p> -> <p>{this.props.t('Content')}</p>
-
Then, go to
src/locales/en.js
&src/locales/fr.js
-
Add an object property called like
MyComponentTranslation
infr
anden
objects.
Finally, add all the properties you need to translate.
Go to https://codesandbox.io/s/n4p235y56m for simple example.
Official website : https://react.i18next.com/overview/getting-started for more informations.
Build and watch files change without creating static files, for development purpose.
Enable test scripts.
Build main files in build/
directory.
Allow building with bypassing linting errors. Do not use if not required.
Ant Design is using Less for styling.
A set of less variables
are defined for each design aspect that can be customized.
This variables can be override by defining values in less-overrides.js
file.