Message editor with support for variables and flexible nested conditions.
The project is under development so some things can be difficult to use.
-
If you click on variable then it will be inserted in the place where your cursor is.
-
By default, 4 variables are available: firstname, lastname, company, position.
You can replace these variables with your own. To do this, specify them as an array with the key "arrVarNames" in localStorage. -
Example:
arrVarNames - ["salary", "age"]
Due to the fact that the variables are stored in localStorage, they will not disappear when the tab is closed.
-
You can preview message and interact with variables if you click "Preview" button.
-
When variables change, the condition sections are recalculated and the message is changed in real time.
-
To create new condition section select textarea and click "IF | THEN | ELSE" button. During this, if your cursor was in the middle of the text in textarea, then the text will split.
-
Section can be created at any textarea.
-
How they work: if the calculated string in "IF" block is not empty, then "THEN" block will be executed, otherwise the "ELSE" block will be executed.
- To save current template to localStorage click the 'Save' button.
Saved template will not disappear when you reload or close tab.
- Data is stored in a tree and can be serialized to JSON
- Tests
- CI/CD
- React
- Typescript
- CSS Modules
- Jest
- Stylelint
- ESLint
- Clone repository
git clone https://github.com/NikolaB131-org/Message-editor.git
- Navigate to the project folder
cd Message-editor
- Install dependencies
npm i
Run in dev mode
npm start
The project will start on: http://localhost:3000
Build production version
npm run build
Run tests
npm test
Run stylelint (with --fix flag)
npm run lint