24
1
Fork 0

don't make title a link on android. fixes #1059

This commit is contained in:
Danny Coates 2019-01-08 13:50:47 -08:00
parent 39c1bec91a
commit ffe8045d82
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,7 @@
const html = require('choo/html');
const Component = require('choo/component');
const Account = require('./account');
const { browserName } = require('../utils');
class Header extends Component {
constructor(name, state, emit) {
@ -16,16 +17,27 @@ class Header extends Component {
}
createElement() {
const title =
browserName() === 'android-app'
? html`
<a class="header-logo">
<h1 class="text-white md:text-black font-normal">
Firefox <b>Send</b>
</h1>
</a>
`
: html`
<a class="header-logo" href="/">
<h1 class="text-white md:text-black font-normal">
Firefox <b>Send</b>
</h1>
</a>
`;
return html`
<header
class="relative flex-none flex flex-row items-center justify-between bg-blue md:bg-white w-full px-6 h-16 md:shadow z-20"
>
<a class="header-logo" href="/">
<h1 class="text-white md:text-black font-normal">
Firefox <b>Send</b>
</h1>
</a>
${this.account.render()}
${title} ${this.account.render()}
</header>
`;
}

View File

@ -146,6 +146,9 @@ function browserName() {
if (/safari/i.test(navigator.userAgent)) {
return 'safari';
}
if (/send android/i.test(navigator.userAgent)) {
return 'android-app';
}
return 'other';
} catch (e) {
return 'unknown';