2024-11-20 01:48:54 +00:00
|
|
|
export const API_URL = 'http://54.173.167.62/api';
|
2024-11-20 13:31:42 +00:00
|
|
|
export const MEDIA_URL = 'http://54.173.167.62/api/uploads';
|
2024-10-31 02:32:14 +00:00
|
|
|
|
2024-12-05 08:31:12 +00:00
|
|
|
export let headerSection = 'section';
|
|
|
|
|
export let headerTopic = 'topic';
|
|
|
|
|
export let headerLevel = 'level';
|
|
|
|
|
|
2024-10-31 02:32:14 +00:00
|
|
|
export const slugify = (text) => {
|
|
|
|
|
if (!text) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return text
|
|
|
|
|
.toString()
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.trim()
|
|
|
|
|
.replace(/\s+/g, '-')
|
|
|
|
|
.replace(/[^\w\-]+/g, '')
|
|
|
|
|
.replace(/\-\-+/g, '-');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const unSlugify = (text) => {
|
|
|
|
|
if (!text) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return text
|
|
|
|
|
.toString()
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.replace(/-/g, ' ')
|
|
|
|
|
.replace(/\b\w/g, (char) => char.toUpperCase());
|
2024-12-05 08:31:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setReviewHeader = (section, topic, level) => {
|
|
|
|
|
headerSection = section;
|
|
|
|
|
headerTopic = topic;
|
|
|
|
|
headerLevel = level;
|
|
|
|
|
}
|