Skip to content

Commit

Permalink
SE noindex + doc title switching
Browse files Browse the repository at this point in the history
  • Loading branch information
Vercin-G committed Sep 30, 2023
1 parent c7b6fef commit c6f12d6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="robots" content="noindex">
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
6 changes: 3 additions & 3 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export default function App() {
<BrowserRouter>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<CavApps />} />
<Route path="adr" element={<ActiveDutyRoster />} />
<Route path="rosterstatistics" element={<Statistics />} />
<Route index element={<CavApps title="7th Cavalry Apps"/>} />
<Route path="adr" element={<ActiveDutyRoster title="7th Cavalry ADR"/>} />
<Route path="rosterstatistics" element={<Statistics title="7th Cavalry Statistics"/>} />
<Route path="*" element={<NoPage />} />
</Route>
</Routes>
Expand Down
5 changes: 4 additions & 1 deletion client/src/pages/Activedutyroster.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const millisecondsToMinutes = (milliseconds) => {

// import {Helmet} from 'react-helmet';

function ActiveDutyRoster() {
function ActiveDutyRoster(props) {
const [milpacList, setMilpacList] = useState([]);
const [reserveList, setReserveList] = useState([]);
const [loading, setLoading] = useState(true);
Expand All @@ -29,6 +29,9 @@ function ActiveDutyRoster() {
})(window, document, "clarity", "script", "dig85agbqz");
</script>`;

// Change Page Title
useEffect(() => document.title = props.title, [])

// Reusable API fetching function
async function fetchData(url, setFunction) {
try {
Expand Down
7 changes: 6 additions & 1 deletion client/src/pages/CavApps.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Outlet, Link } from "react-router-dom";
import Logo from '../style/themes/7cav/appsLogo'
import './CavApps.css';
import React, { useEffect } from "react";

function CavApps(props) {

// Change Page Title
useEffect(() => document.title = props.title, [])

function CavApps() {
return (
<div className='masterbox'>
<div className='logobox'>
Expand Down
10 changes: 8 additions & 2 deletions client/src/pages/Rosterstatistics.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
const Statistics = () => {
return <h1>Pending Rework!</h1>;
import React, { useEffect } from "react";

const Statistics = (props) => {

// Change Page Title
useEffect(() => document.title = props.title, [])

return <h1>Pending Rework!</h1>;
};

export default Statistics;
Expand Down

0 comments on commit c6f12d6

Please sign in to comment.