frontend_adaptive_learning/src/utils/Constant.jsx

39 lines
761 B
JavaScript

export const API_URL = 'https://z30xrgl5-3001.asse.devtunnels.ms/api'
export const MEDIA_URL = 'https://z30xrgl5-3001.asse.devtunnels.ms/api/uploads'
export let headerSection = 'section'
export let headerTopic = 'topic'
export let headerLevel = 'level'
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())
}
export const setReviewHeader = (section, topic, level) => {
headerSection = section
headerTopic = topic
headerLevel = level
}