consent manager bugfix, 404 page improvement

This commit is contained in:
Jeff Escalante 2020-06-12 14:38:56 -04:00
parent 5e00845381
commit efade11ee2
No known key found for this signature in database
GPG Key ID: 32D23C61AB5450DB
5 changed files with 82 additions and 43 deletions

View File

@ -1344,13 +1344,13 @@
"integrity": "sha512-/Mgw6ufzjsysw5U0v7c0tCXMQeE4BSbGeasDaTuh1r6jQ+2Cokl1XhPqKqXn4+xkcx3CIVdyoUYOSLmgzutn3Q=="
},
"@hashicorp/nextjs-scripts": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@hashicorp/nextjs-scripts/-/nextjs-scripts-10.0.1.tgz",
"integrity": "sha512-IwKr0HQvt6NZoJ9SlTBXqgDHYi4ticfcLM3mH3WH8b0Mr2B+Y5I/VzOOHiLxVcWmJmOECuV9EY+TaxlE5h2YQQ==",
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/@hashicorp/nextjs-scripts/-/nextjs-scripts-10.0.2.tgz",
"integrity": "sha512-s18LHSyrWcgNbsFEnyMLUa7jaLBz2/UXu984UrxVoapHTq5eL4HEk1dJZ3yHcRCJjG7TEYvaXzgkL4IHc1UR5w==",
"requires": {
"@bugsnag/js": "7.1.1",
"@bugsnag/plugin-react": "7.1.1",
"@hashicorp/react-consent-manager": "2.1.1",
"@hashicorp/react-consent-manager": "2.1.2",
"@hashicorp/react-enterprise-alert": "^2.1.0",
"@hashicorp/react-tabs": "^0.4.0",
"@hashicorp/remark-plugins": "3.0.0",
@ -1436,9 +1436,9 @@
}
},
"@hashicorp/react-consent-manager": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@hashicorp/react-consent-manager/-/react-consent-manager-2.1.1.tgz",
"integrity": "sha512-tIVR3LhDnwcHAxa+lrfrjJmthynCzpVrn9MYHcqKBVrCozV3SCC9zeRjPSlvxU9/GfAYAefull2hH/kg/duyOw==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@hashicorp/react-consent-manager/-/react-consent-manager-2.1.2.tgz",
"integrity": "sha512-AjCFIEZPa6K9UFr3Nvjy8cLHuGDa2qpQat/QVFHKp0t/acflC8z7xIDh8Yo9RBCp+YF+gF+g50ll/hhzX0pEeQ==",
"requires": {
"@hashicorp/react-button": "^2.2.0",
"@hashicorp/react-toggle": "^1.0.1",
@ -8814,9 +8814,9 @@
"integrity": "sha512-8hfl5RD6P7rEeIbzStBz3h4f+BQHfq/ABtoU6gXKQv5OcZhnmrIpG7e1pYaZ8hS9e0mp+bxUj08fnDUbKctYyA=="
},
"jsx-ast-utils": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.3.0.tgz",
"integrity": "sha512-3HNoc7nZ1hpZIKB3hJ7BlFRkzCx2BynRtfSwbkqZdpRdvAPsGMnzclPwrvDBS7/lalHTj21NwIeaEpysHBOudg==",
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz",
"integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==",
"requires": {
"array-includes": "^3.1.1",
"object.assign": "^4.1.0"

View File

@ -4,7 +4,7 @@
"version": "1.0.0",
"author": "HashiCorp",
"dependencies": {
"@hashicorp/nextjs-scripts": "^10.0.1",
"@hashicorp/nextjs-scripts": "^10.0.2",
"@hashicorp/react-button": "^2.2.0",
"@hashicorp/react-code-block": "^1.2.7",
"@hashicorp/react-content": "3.0.0-0",

View File

@ -1,32 +1,2 @@
import Link from 'next/link'
import { useEffect } from 'react'
export default function NotFound() {
useEffect(() => {
if (
typeof window !== 'undefined' &&
typeof window?.analytics?.track === 'function' &&
typeof window?.document?.referrer === 'string' &&
typeof window?.location?.href === 'string'
)
window.analytics.track(window.location.href, {
category: '404 Response',
label: window.document.referrer || 'No Referrer',
})
}, [])
return (
<div id="p-404" className="g-grid-container">
<h1>Page Not Found</h1>
<p>
We&lsquo;re sorry but we can&lsquo;t find the page you&lsquo;re looking
for.
</p>
<p>
<Link href="/">
<a>Back to Home</a>
</Link>
</p>
</div>
)
}
import NotFound from './not-found'
export default NotFound

View File

@ -0,0 +1,33 @@
import s from './style.module.css'
import Link from 'next/link'
import { useEffect } from 'react'
export default function NotFound() {
useEffect(() => {
if (
typeof window !== 'undefined' &&
typeof window?.analytics?.track === 'function' &&
typeof window?.document?.referrer === 'string' &&
typeof window?.location?.href === 'string'
)
window.analytics.track(window.location.href, {
category: '404 Response',
label: window.document.referrer || 'No Referrer',
})
}, [])
return (
<div className={s.root}>
<h1>Page Not Found</h1>
<p>
We&lsquo;re sorry but we can&lsquo;t find the page you&lsquo;re looking
for.
</p>
<p>
<Link href="/">
<a>Back to Home</a>
</Link>
</p>
</div>
)
}

View File

@ -0,0 +1,36 @@
.root {
composes: .g-grid-container from global;
display: flex;
flex-direction: column;
justify-content: center;
margin: 64px auto; /* this is being overridden at the request of the learn team */
max-width: 784px;
min-height: 50vh;
padding-inline: 32px;
text-align: center;
@media (--large) {
padding-inline: 24px;
}
& h1 {
font-size: 1.5rem;
letter-spacing: -0.004em;
line-height: 1.375em;
@media (--medium-up) {
font-size: 1.75rem;
line-height: 1.321em;
}
@media (--large) {
font-size: 2rem;
letter-spacing: -0.006em;
line-height: 1.313em;
}
}
& a {
color: var(--highlight-color);
}
}