feat: contact us
This commit is contained in:
@@ -375,6 +375,18 @@ const addPrograms = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
const addContactUsDetails = () => {
|
||||
if (settingsStore.contactUsEmail?.data || settingsStore.contactUsURL?.data) {
|
||||
sidebarLinks.value.push({
|
||||
label: 'Contact Us',
|
||||
icon: settingsStore.contactUsURL?.data ? 'Headset' : 'Mail',
|
||||
to: settingsStore.contactUsURL?.data
|
||||
? settingsStore.contactUsURL.data
|
||||
: `mailto:${settingsStore.contactUsEmail?.data}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const checkIfCanAddProgram = async () => {
|
||||
if (isModerator.value || isInstructor.value) {
|
||||
return true
|
||||
@@ -645,6 +657,7 @@ const setUpOnboarding = () => {
|
||||
}
|
||||
|
||||
watch(userResource, () => {
|
||||
addContactUsDetails()
|
||||
if (userResource.data) {
|
||||
isModerator.value = userResource.data.is_moderator
|
||||
isInstructor.value = userResource.data.is_instructor
|
||||
|
||||
@@ -161,6 +161,26 @@ const tabsStructure = computed(() => {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Contact Us',
|
||||
icon: 'Phone',
|
||||
fields: [
|
||||
{
|
||||
label: 'Email',
|
||||
name: 'contact_us_email',
|
||||
type: 'text',
|
||||
description:
|
||||
'Users can reach out to this email for support or inquiries.',
|
||||
},
|
||||
{
|
||||
label: 'URL',
|
||||
name: 'contact_us_url',
|
||||
type: 'text',
|
||||
description:
|
||||
'Users can reach out to this URL for support or inquiries.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -88,6 +88,13 @@ function handleClick() {
|
||||
if (router.hasRoute(props.link.to)) {
|
||||
router.push({ name: props.link.to })
|
||||
} else if (props.link.to) {
|
||||
if (
|
||||
props.link.to.startsWith('http') ||
|
||||
props.link.to.startsWith('mailto:')
|
||||
) {
|
||||
window.open(props.link.to, '_blank')
|
||||
return
|
||||
}
|
||||
window.location.href = `/${props.link.to}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user