Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Add the desktop app banner #1067

Merged
merged 3 commits into from
Aug 21, 2017
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
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"n-ui-foundations": "^2.2.1",
"o-expander": "^4.2.2",
"next-session-client": "^2.3.1",
"n-counter-ad-blocking": "^3.1.1"
"n-counter-ad-blocking": "^3.1.1",
"n-desktop-app-banner": "^1.0.1"
}
}
4 changes: 4 additions & 0 deletions browser/js/component-initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import footer from '../../components/n-ui/footer';
import offlineToast from '../../components/n-ui/offline-toast';
import { lazyLoad as lazyLoadImages } from 'n-image';
import * as serviceWorker from 'n-service-worker';
import DesktopAppBanner from 'n-desktop-app-banner';
import * as syndication from 'n-syndication';

export const presets = {
Expand Down Expand Up @@ -110,6 +111,9 @@ export class ComponentInitializer {
this.initializedFeatures.lazyLoadImages = true;
}

if (flags.get('subscriberCohort') && !flags.get('disableDesktopAppBanner')) {
new DesktopAppBanner();
}

allStylesLoaded
.then(() => {
Expand Down
4 changes: 4 additions & 0 deletions browser/layout/wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
{{{body}}}
</div>

{{#unless __disableDesktopAppBanner}}
{{>n-desktop-app-banner/templates/banner}}
{{/unless}}

{{#if @root.flags.offlineToastMessage}}
{{>n-ui/offline-toast/template}}
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $n-ui-foundations-applied: true;

@import 'components/n-ui/offline-toast/main';
@import 'n-syndication/main';
@import 'n-desktop-app-banner/main';

$o-cookie-message-is-silent: false;
@import 'o-cookie-message/main';
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"uglifyjs": "^2.4.11"
},
"dependencies": {
"@financial-times/n-desktop-app-banner": "^1.0.1",
"@financial-times/n-express": "^19.2.3",
"@financial-times/n-handlebars": "^1.17.9",
"@financial-times/next-json-ld": "^0.2.1",
Expand Down Expand Up @@ -134,7 +135,7 @@
},
{
"path": "./public/n-ui/n-ui-core.css",
"threshold": "8 Kb"
"threshold": "8.4 Kb"
}
]
}
1 change: 1 addition & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = options => {
// set whether or not to disable the app install banner.
app.use(function (req, res, next) {
app.locals.__disableAndroidBanner = (!res.locals.flags.subscriberCohort || res.locals.flags.disableAndroidSmartBanner);
app.locals.__disableDesktopAppBanner = (!res.locals.flags.subscriberCohort || res.locals.flags.disableDesktopAppBanner);
app.locals.__disableIosSmartBanner = (!res.locals.flags.subscriberCohort || res.locals.flags.disableIosSmartBanner);

next();
Expand Down