mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-04 19:21:58 +00:00
Add document.title to pages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useRef } from 'react';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import SetupTemplate from '../templates/SetupTemplate';
|
||||
@@ -10,6 +10,9 @@ import FormError from '../blocks/FormError';
|
||||
|
||||
const Login = props => {
|
||||
let history = useHistory();
|
||||
useEffect(() => {
|
||||
document.title = `Login | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
// Refs
|
||||
const refUsername = useRef(null);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
import AccountForm from '../../forms/AccountForm';
|
||||
@@ -6,6 +6,9 @@ import AccountForm from '../../forms/AccountForm';
|
||||
const AccountsAddEdit = () => {
|
||||
let { account_sid } = useParams();
|
||||
const pageTitle = account_sid ? 'Edit Account' : 'Add Account';
|
||||
useEffect(() => {
|
||||
document.title = `${pageTitle} | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<InternalTemplate
|
||||
type="form"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useEffect, useContext } from 'react';
|
||||
import axios from 'axios';
|
||||
import { NotificationDispatchContext } from '../../../contexts/NotificationContext';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
@@ -6,6 +6,9 @@ import TableContent from '../../blocks/TableContent.js';
|
||||
|
||||
const AccountsList = () => {
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `Accounts | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
//=============================================================================
|
||||
// Get accounts
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
import ApplicationForm from '../../forms/ApplicationForm';
|
||||
@@ -6,6 +6,9 @@ import ApplicationForm from '../../forms/ApplicationForm';
|
||||
const ApplicationsAddEdit = () => {
|
||||
let { application_sid } = useParams();
|
||||
const pageTitle = application_sid ? 'Edit Application' : 'Add Application';
|
||||
useEffect(() => {
|
||||
document.title = `${pageTitle} | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<InternalTemplate
|
||||
type="form"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useEffect, useContext } from 'react';
|
||||
import axios from 'axios';
|
||||
import { NotificationDispatchContext } from '../../../contexts/NotificationContext';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
@@ -6,6 +6,9 @@ import TableContent from '../../blocks/TableContent.js';
|
||||
|
||||
const ApplicationsList = () => {
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `Applications | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
//=============================================================================
|
||||
// Get applications
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
import PhoneNumberForm from '../../forms/PhoneNumberForm';
|
||||
@@ -6,6 +6,9 @@ import PhoneNumberForm from '../../forms/PhoneNumberForm';
|
||||
const PhoneNumbersAddEdit = () => {
|
||||
let { phone_number_sid } = useParams();
|
||||
const pageTitle = phone_number_sid ? 'Edit Phone Number' : 'Add Phone Number';
|
||||
useEffect(() => {
|
||||
document.title = `${pageTitle} | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<InternalTemplate
|
||||
type="form"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useContext } from 'react';
|
||||
import React, { useState, useEffect, useContext } from 'react';
|
||||
import axios from 'axios';
|
||||
import { NotificationDispatchContext } from '../../../contexts/NotificationContext';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
@@ -6,6 +6,9 @@ import TableContent from '../../blocks/TableContent.js';
|
||||
|
||||
const PhoneNumbersList = () => {
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `Phone Number Routing | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
//=============================================================================
|
||||
// Get phone numbers
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
import SipTrunkForm from '../../forms/SipTrunkForm';
|
||||
@@ -7,6 +7,9 @@ import Sbcs from '../../blocks/Sbcs';
|
||||
const SipTrunksAddEdit = () => {
|
||||
let { voip_carrier_sid } = useParams();
|
||||
const pageTitle = voip_carrier_sid ? 'Edit SIP Trunk' : 'Add SIP Trunk';
|
||||
useEffect(() => {
|
||||
document.title = `${pageTitle} | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<InternalTemplate
|
||||
type="form"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useEffect, useContext } from 'react';
|
||||
import axios from 'axios';
|
||||
import { NotificationDispatchContext } from '../../../contexts/NotificationContext';
|
||||
import InternalTemplate from '../../templates/InternalTemplate';
|
||||
@@ -7,6 +7,9 @@ import Sbcs from '../../blocks/Sbcs';
|
||||
|
||||
const SipTrunksList = () => {
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `SIP Trunks | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
//=============================================================================
|
||||
// Get sip trunks
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import SetupTemplate from '../../templates/SetupTemplate';
|
||||
import AccountForm from '../../forms/AccountForm';
|
||||
|
||||
const ConfigureAccount = () => {
|
||||
useEffect(() => {
|
||||
document.title = `Configure Account | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<SetupTemplate
|
||||
wide
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import SetupTemplate from '../../templates/SetupTemplate';
|
||||
import SipTrunkForm from '../../forms/SipTrunkForm';
|
||||
import Sbcs from '../../blocks/Sbcs';
|
||||
|
||||
const ConfigureSipTrunk = () => {
|
||||
useEffect(() => {
|
||||
document.title = `Configure SIP Trunk | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<SetupTemplate
|
||||
wide
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import SetupTemplate from '../../templates/SetupTemplate';
|
||||
import ApplicationForm from '../../forms/ApplicationForm';
|
||||
|
||||
const CreateApplication = () => {
|
||||
useEffect(() => {
|
||||
document.title = `Create Application | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
return (
|
||||
<SetupTemplate
|
||||
wide
|
||||
|
||||
@@ -11,6 +11,9 @@ import FormError from '../../blocks/FormError';
|
||||
const CreatePassword = () => {
|
||||
let history = useHistory();
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `Create Password | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
// Refs
|
||||
const refPassword = useRef(null);
|
||||
|
||||
@@ -7,6 +7,9 @@ import Button from '../../elements/Button';
|
||||
const SetupComplete = () => {
|
||||
const history = useHistory();
|
||||
const dispatch = useContext(NotificationDispatchContext);
|
||||
useEffect(() => {
|
||||
document.title = `Setup Complete | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!localStorage.getItem('token')) {
|
||||
|
||||
Reference in New Issue
Block a user