Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page titles and metadata using react-helmet #84

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="TUTV is a student-run production studio that strives to foster
a supportive and collaborative community where anyone can learn about the
filmmaking process and develop their own artistic voice."
/>
<link rel="apple-touch-icon" href="logo192.png" />
<!--
Expand All @@ -28,7 +30,7 @@
href="https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap"
rel="stylesheet"
/>
<title>React App</title>
<title>TUTV Equipment Borrowing</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
105 changes: 53 additions & 52 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';
import Helmet from 'react-helmet';

// Components for pages of the app
import Home from './pages/Home';
Expand All @@ -12,59 +13,59 @@ import SignIn from './pages/SignIn';

const App: React.FC = () => {
return (
<Router>
<div className="App">
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/catalog">Equipment Catalog</Link>
</li>
<li>
<Link to="/equipmentbrowser">Equipment Browser</Link>
</li>
<li>
<Link to="/memberdashboard">MemberDashboard</Link>
</li>
<li>
<Link to="/admin/dashboard">Admin Dashboard</Link>
</li>
<li>
<Link to="/admin/equipment-request">Equipment Request</Link>
</li>
<li>
<Link to="/signin">Sign In</Link>
</li>
</ul>
</nav>
<React.StrictMode>
<Router>
<div className="App">
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/catalog">Equipment Catalog</Link>
</li>
<li>
<Link to="/equipmentbrowser">Equipment Browser</Link>
</li>
<li>
<Link to="/memberdashboard">MemberDashboard</Link>
</li>
<li>
<Link to="/admin/dashboard">Admin Dashboard</Link>
</li>
<li>
<Link to="/admin/equipment-request">Equipment Request</Link>
</li>
<li>
<Link to="/signin">Sign In</Link>
</li>
</ul>
</nav>

<Switch>
<Route path="/admin/dashboard">
<AdminDashboard />
</Route>
<Route path="/catalog">
<Catalog />
</Route>
<Route path="/equipmentbrowser">
<EquipmentBrowser />
</Route>
<Route path="/memberdashboard">
<MemberDashboard />
</Route>
<Route path="/admin/equipment-request">
<RequestSummary />
</Route>
<Route path="/signin">
<SignIn />
</Route>
<Route path="/">
<Home />
</Route>
</Switch>
</div>
</Router>
<Helmet
titleTemplate="TUTV | %s"
defaultTitle="TUTV Equipment Borrowing"
>
<meta
duci9y marked this conversation as resolved.
Show resolved Hide resolved
name="description"
content="TUTV is a student-run production studio that strives to foster
a supportive and collaborative community where anyone can learn about the
filmmaking process and develop their own artistic voice."
/>
</Helmet>

<Switch>
<Route path="/admin/dashboard" component={AdminDashboard} />
<Route path="/catalog" component={Catalog} />
<Route path="/equipmentbrowser" component={EquipmentBrowser} />
<Route path="/memberdashboard" component={MemberDashboard} />
<Route path="/admin/equipment-request" component={RequestSummary} />
<Route path="/signin" component={SignIn} />
<Route path="/" exact component={Home} />
</Switch>
</div>
</Router>
</React.StrictMode>
);
};

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@types/node": "12.7.5",
"@types/react": "^16.9.0",
"@types/react-dom": "16.9.0",
"@types/react-helmet": "^5.0.15",
"@types/react-router-dom": "^5.1.0",
"@types/react-tabs": "^2.3.1",
"@typescript-eslint/eslint-plugin": "^2.2.0",
Expand Down Expand Up @@ -54,6 +55,7 @@
"react-dev-utils": "^9.1.0",
"react-dom": "^16.9.0",
"react-feather": "^2.0.3",
"react-helmet": "^5.2.1",
"react-router-dom": "^5.1.2",
"react-styleguidist": "^9.1.16",
"react-tabs": "^3.1.0",
Expand Down
36 changes: 35 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,13 @@
dependencies:
"@types/react" "*"

"@types/react-helmet@^5.0.15":
version "5.0.15"
resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-5.0.15.tgz#af0370617307e9f062c6aee0f1f5588224ce646e"
integrity sha512-CCjqvecDJTXRrHG8aTc2YECcQCl26za/q+NaBRvy/wtm0Uh38koM2dpv2bG1xJV4ckz3t1lm2/5KU6nt2s9BWg==
dependencies:
"@types/react" "*"

"@types/react-router-dom@^5.1.0":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.2.tgz#853f229f1f297513c0be84f7c914a08b778cfdf5"
Expand Down Expand Up @@ -8921,7 +8928,7 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.3"

prop-types@^15.5.0, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.5.0, prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -9197,6 +9204,11 @@ react-error-overlay@^6.0.3:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.3.tgz#c378c4b0a21e88b2e159a3e62b2f531fd63bf60d"
integrity sha512-bOUvMWFQVk5oz8Ded9Xb7WVdEi3QGLC8tH7HmYP0Fdp4Bn3qw0tRFmr5TW6mvahzvmrK4a6bqWGfCevBflP+Xw==

react-fast-compare@^2.0.2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==

react-feather@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/react-feather/-/react-feather-2.0.3.tgz#1453ff5d8c242f72b8c02846118fbd2d406375ad"
Expand All @@ -9211,6 +9223,16 @@ react-group@^3.0.0:
dependencies:
prop-types "^15.7.2"

react-helmet@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-5.2.1.tgz#16a7192fdd09951f8e0fe22ffccbf9bb3e591ffa"
integrity sha512-CnwD822LU8NDBnjCpZ4ySh8L6HYyngViTZLfBBb3NjtrpN8m49clH8hidHouq20I51Y6TpCTISCBbqiY5GamwA==
dependencies:
object-assign "^4.1.1"
prop-types "^15.5.4"
react-fast-compare "^2.0.2"
react-side-effect "^1.1.0"

react-icons@^3.7.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-3.8.0.tgz#229de5904809696c9f46932bd9b6126b2522866e"
Expand Down Expand Up @@ -9262,6 +9284,13 @@ [email protected]:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-side-effect@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-1.2.0.tgz#0e940c78faba0c73b9b0eba9cd3dda8dfb7e7dae"
integrity sha512-v1ht1aHg5k/thv56DRcjw+WtojuuDHFUgGfc+bFHOWsF4ZK6C2V57DO0Or0GPsg6+LSTE0M6Ry/gfzhzSwbc5w==
dependencies:
shallowequal "^1.0.1"

react-simple-code-editor@^0.9.7:
version "0.9.15"
resolved "https://registry.yarnpkg.com/react-simple-code-editor/-/react-simple-code-editor-0.9.15.tgz#59e3583832e9e98992d3674b2d7673b4cd1c5709"
Expand Down Expand Up @@ -10064,6 +10093,11 @@ shallow-clone@^3.0.0:
dependencies:
kind-of "^6.0.2"

shallowequal@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
Expand Down