Skip to content

Commit

Permalink
give 404 and error pages the loggedin/ok treatment
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Jul 30, 2020
1 parent d2cdff5 commit deb5c6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/ui/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const assets = require('../../common/assets');
const modal = require('./modal');

module.exports = function(state, emit) {
const btnText = state.user.loggedIn ? 'okButton' : 'sendYourFilesLink';
return html`
<main class="main">
${state.modal && modal(state, emit)}
Expand All @@ -13,12 +14,17 @@ module.exports = function(state, emit) {
${state.translate('errorPageHeader')}
</h1>
<img class="my-12 h-48" src="${assets.get('error.svg')}" />
<p class="max-w-md text-center text-grey-80 leading-normal">
<p
class="max-w-md text-center text-grey-80 leading-normal dark:text-grey-40 ${state
.user.loggedIn
? 'hidden'
: ''}"
>
${state.translate('trySendDescription')}
</p>
<p class="my-5">
<a href="/" class="btn rounded-lg flex items-center" role="button"
>${state.translate('sendYourFilesLink')}</a
>${state.translate(btnText)}</a
>
</p>
</section>
Expand Down
10 changes: 8 additions & 2 deletions app/ui/notFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const assets = require('../../common/assets');
const modal = require('./modal');

module.exports = function(state, emit) {
const btnText = state.user.loggedIn ? 'okButton' : 'sendYourFilesLink';
return html`
<main class="main">
${state.modal && modal(state, emit)}
Expand All @@ -13,12 +14,17 @@ module.exports = function(state, emit) {
${state.translate('expiredTitle')}
</h1>
<img src="${assets.get('notFound.svg')}" class="my-12" />
<p class="max-w-md text-center text-grey-80 leading-normal">
<p
class="max-w-md text-center text-grey-80 leading-normal dark:text-grey-40 ${state
.user.loggedIn
? 'hidden'
: ''}"
>
${state.translate('trySendDescription')}
</p>
<p class="my-5">
<a href="/" class="btn rounded-lg flex items-center" role="button"
>${state.translate('sendYourFilesLink')}</a
>${state.translate(btnText)}</a
>
</p>
<p class="">
Expand Down

0 comments on commit deb5c6e

Please sign in to comment.