mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 05:43:12 +00:00
- Use relative API URLs instead of hardcoded production/localhost URLs - Fix setupProxy.js for http-proxy-middleware v3 syntax - Point proxy to backend HTTP port for dev compatibility
29 lines
798 B
JavaScript
29 lines
798 B
JavaScript
export const ADD = "add";
|
|
export const EDIT = "edit";
|
|
|
|
export const API_ERROR_MESSAGE =
|
|
"Sorry, something went wrong. Please try again later.";
|
|
export const API_SUCCESS_MESSAGE =
|
|
"You changes has been successfully saved.";
|
|
export const API_DELETE_SUCCESS_MESSAGE =
|
|
"Item is deleted";
|
|
|
|
export const API_URL = process.env.REACT_APP_API_URL || "/api";
|
|
|
|
|
|
export const form_text_builder = (mode) => {
|
|
let PRIMARY_TEXT = "";
|
|
let SECONDARY_TEXT = "";
|
|
let BUTTON_TEXT = "";
|
|
|
|
if (mode == ADD) {
|
|
PRIMARY_TEXT = "Add an Item";
|
|
SECONDARY_TEXT = "Add your new item below";
|
|
BUTTON_TEXT = "Add Item";
|
|
} else {
|
|
PRIMARY_TEXT = "Edit an Item";
|
|
SECONDARY_TEXT = "Edit your item below";
|
|
BUTTON_TEXT = "Save Item";
|
|
}
|
|
return { PRIMARY_TEXT, SECONDARY_TEXT, BUTTON_TEXT };
|
|
};
|