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

Fallback page for disabled js in browser #534

Merged
Merged
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
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added packages/venia-concept/media/veniaClosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/venia-concept/templates/generic-shell.mst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{> templates/doctype-and-head-start}}
{{> templates/js-unavailable}}
<title>Venia</title>
</head>
<body>
Expand Down
49 changes: 49 additions & 0 deletions packages/venia-concept/templates/js-unavailable.mst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<link href="https://fonts.googleapis.com/css?family=Muli:300" rel="stylesheet">
<noscript>
<div class="container">
<img class="veniaClosed" src="./veniaClosed.png">
<div class="textBlock">
<h2 class="header">Oops! JavaScript is disabled</h2>
<div class="main">
<div class="textTile1">
To continue using the Venia store
</div>
<a class="enableLink" href="https://www.enable-javascript.com/">enable JavaScript in your browser</a>
</div>
</div>
</div>
<style>
#root {
display: none;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 2.5rem;
font-family: Muli, -apple-system, BlinkMacSystemFont, sans-serif;
}
.veniaClosed {
width: 7.5625rem;
}
.textBlock {
width: 18.25rem;
}
.textTile1 {
white-space: nowrap;
}
.header {
font-size: 1.25rem;
margin: 2.125rem 0 2.5rem;
}
.main {
font-size: 1rem;
font-weight: 300;
line-height: 1.75rem;
}
.header, .main, .enableLink {
text-align: center;
color: #444444;
}
</style>
</noscript>
1 change: 1 addition & 0 deletions packages/venia-concept/templates/notfound-shell.mst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{> templates/doctype-and-head-start}}
{{> templates/js-unavailable}}
<title>Venia - Not Found</title>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions packages/venia-concept/templates/product-shell.mst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{> templates/doctype-and-head-start}}
{{> templates/js-unavailable}}
<title>{{model.name}} - {{site.name}}</title>
{{#model}}
<meta name="title" content="{{name}}">
Expand Down
24 changes: 8 additions & 16 deletions packages/venia-concept/venia-upward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ response:
pattern: '^/(graphql|rest|media/)'
use: proxy
- matches: request.url.pathname
pattern: '^/favicon.ico'
use: favicon
pattern: '^/(favicon.ico|veniaClosed.png)'
use: media
- matches: urlKey
pattern: '.'
use: appShell
- matches: request.url.pathname
pattern: '^/$'
use: appShell
default: static
default: bundles

proxy:
target: env.MAGENTO_BACKEND_URL
Expand Down Expand Up @@ -107,18 +107,10 @@ genericObject:
inline:
"Hello world!"

favicon:
inline:
status: 200
headers:
inline:
content-type:
inline: image/vnd.microsoft.icon
body:
file:
inline: ./media/favicon.ico
encoding: binary

static:
bundles:
directory:
inline: './dist'

media:
directory:
inline: './media'