Globals
The globals is an object that has general data that can be used in the entire application.
#
Usageimport Globals from 'mongez/globals';
console.log(Globals.direction); // ltr
Available Properties
The Globals
object has the following properties, these properties values are changed dynamically and automatically.
Property | Default Value | Description |
---|---|---|
direction | Bsed on the value of REACT_APP_DIRECTION in .env file, if not defined its ltr | Get the current application direction. |
localeCode | Based on the value of REACT_APP_LOCALE_CODE in .env file, if not defined its en | Get the current application locale Code. |
left | left | If the current direction is ltr, then its value will be left, if the direction is rtl, then the value will be right. |
right | right | If the current direction is ltr, then its value will be right, if the direction is rtl, then the value will be left. |
marginLeft | margin-left | Get the value of margin left, will be right if the direction is rtl |
marginRight | margin-right | Get the value of margin right, will be left if the direction is rtl |
paddingLeft | padding-left | Get the value of padding left, will be right if the direction is rtl |
paddingRight | padding-right | Get the value of padding right, will be left if the direction is rtl |
The entire list is:
left: left,right: right,direction: direction,marginLeft: `margin-${left}`,marginRight: `margin-${right}`,paddingLeft: `padding-${left}`,paddingRight: `padding-${right}`,localeCode: localeCode,