Skip to content

Commit 808e08f

Browse files
marceloschreiberMarcusNotheis
authored andcommitted
Merge pull request #30 from LuisValgoi/issue-26
[ISSUE-26] Adds React Helment
1 parent 66c1b1e commit 808e08f

File tree

8 files changed

+43
-4
lines changed

8 files changed

+43
-4
lines changed

packages/ui5-webcomponents-react-seed/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ Builds the app for production to the `build` folder.
7878

7979
Used to manipulate async request, data fetching, cache and more (no redux / saga anymore).
8080

81+
### `react-helmet`
82+
83+
Used to manpilate DOM attributes through JSX such as `<head>`.
84+
8185
[Tutorial Link](https://www.youtube.com/watch?v=yccbCol546c), [Random Post](https://blog.bitsrc.io/how-to-start-using-react-query-4869e3d5680d) and [Creator Official Video](https://www.youtube.com/watch?v=seU46c6Jz7E).
8286

8387
### `commitlint`

packages/ui5-webcomponents-react-seed/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"jest-environment-jsdom-sixteen": "^1.0.3",
1515
"react": "^16.13.1",
1616
"react-dom": "^16.13.1",
17+
"react-helmet": "^6.1.0",
1718
"react-router-dom": "^5.2.0",
1819
"react-scripts": "3.4.3"
1920
},

packages/ui5-webcomponents-react-seed/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { BrowserRouter } from "react-router-dom";
3+
import { Helmet } from 'react-helmet';
34

45
import ErrorBoundary from './pages/Fallback/ErrorBoundary';
56
import Shell from './components/Shell/Shell';
@@ -10,6 +11,7 @@ import './App.css';
1011
function App() {
1112
return (
1213
<BrowserRouter>
14+
<Helmet title="Home - TodoList App" />
1315
<Shell title='TodoList App' />
1416
<div style={{ paddingTop: '44px' }} />
1517
<ErrorBoundary>

packages/ui5-webcomponents-react-seed/src/pages/Fallback/Buggy.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ class Buggy extends React.Component {
77
throw new Error("An error has occured in Buggy component!");
88
}
99
render() {
10-
return <h2>{this.state.greeting}</h2>;
10+
return (
11+
<>
12+
<h2>{this.state.greeting}</h2>
13+
</>
14+
);
1115
}
1216
}
1317

packages/ui5-webcomponents-react-seed/src/pages/Fallback/Error.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
2+
import { Helmet } from 'react-helmet'
23

34
import error from '../../assets/error.png';
45
import Fallback from './Fallback';
56

67
const Error = () => {
78
return (
89
<>
10+
<Helmet title="Buggy Component - TodoList App" />
911
<Fallback image={error} altImage='Error' text='Ops! There was an error in loading this page' reload />
1012
</>
1113
);

packages/ui5-webcomponents-react-seed/src/pages/Fallback/NotFound.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import React from 'react';
2+
import { Helmet } from 'react-helmet';
23

34
import notfound from '../../assets/notfound.png';
45
import Fallback from './Fallback';
56

67
const NotFound = () => {
78
return (
8-
<Fallback image={notfound} altImage='Not Found' text='Hmmm, we could find this URL' />
9+
<>
10+
<Helmet title="NotFound - TodoList App" />
11+
<Fallback image={notfound} altImage='Not Found' text='Hmmm, we could find this URL' />
12+
</>
913
);
1014
};
1115

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import { useHistory } from 'react-router-dom';
3+
import { Helmet } from 'react-helmet';
34

45
import CenteredLink from '../../../components/CenteredLink/CenteredLink';
56
import BrowserURL from '../../../util/BrowserURL';
@@ -9,14 +10,15 @@ export default function TodoList() {
910
const history = useHistory();
1011

1112
return (
12-
<div>
13+
<>
14+
<Helmet title="List - TodoList App" />
1315
<CenteredLink onClick={() => history.push('/dontexist')} text='Test NotFound Page' />
1416
<br />
1517
<CenteredLink onClick={() => history.push(BrowserURL.BUGGY)} text='Test Error Page' />
1618
<br />
1719
<ComponentValidator allowedPermissions={['canAccessDropApplication']} allowenceKey='permissions'>
1820
<CenteredLink text='Drop Application (this is a restricted text and you should not see unless you have access)' />
1921
</ComponentValidator>
20-
</div>
22+
</>
2123
)
2224
}

packages/ui5-webcomponents-react-seed/yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9903,6 +9903,21 @@ react-error-overlay@^6.0.7:
99039903
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108"
99049904
integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA==
99059905

9906+
react-fast-compare@^3.1.1:
9907+
version "3.2.0"
9908+
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
9909+
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
9910+
9911+
react-helmet@^6.1.0:
9912+
version "6.1.0"
9913+
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
9914+
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
9915+
dependencies:
9916+
object-assign "^4.1.1"
9917+
prop-types "^15.7.2"
9918+
react-fast-compare "^3.1.1"
9919+
react-side-effect "^2.1.0"
9920+
99069921
react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4:
99079922
version "16.13.1"
99089923
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@@ -10019,6 +10034,11 @@ [email protected]:
1001910034
optionalDependencies:
1002010035
fsevents "2.1.2"
1002110036

10037+
react-side-effect@^2.1.0:
10038+
version "2.1.0"
10039+
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.0.tgz#1ce4a8b4445168c487ed24dab886421f74d380d3"
10040+
integrity sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==
10041+
1002210042
1002310043
version "7.5.0"
1002410044
resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.5.0.tgz#87326d92cdffbbf970f49b395bcafc3f84989ddf"

0 commit comments

Comments
 (0)