@financial-times/dotcom-ui-shell 4.1.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -199,6 +199,10 @@ An optional URL to a [web app manifest file](https://developers.google.com/web/f
199
199
 
200
200
  An optional property to insert additional metadata elements into the document `<head>`. This should only be used as a last-resort when you need to add information to the page which is not covered by any other option.
201
201
 
202
+ #### `showSmartBanner` (boolean)
203
+
204
+ An optional property to explicity say whether you want to show [Smart Banner](https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners) at the top of the page or not. The default is `true` so the pages will always show smart banner.
205
+
202
206
  ### Social and Open Graph
203
207
 
204
208
  #### `facebookPage` (string)
@@ -21,7 +21,8 @@ const DocumentHead = (props) => (react_1.default.createElement(react_1.default.F
21
21
  react_1.default.createElement("meta", { property: "fb:pages", content: props.facebookPage }),
22
22
  react_1.default.createElement("meta", { property: "twitter:site", content: props.twitterSite }),
23
23
  react_1.default.createElement(OpenGraph_1.default, { openGraph: props.openGraph }),
24
- react_1.default.createElement("meta", { name: "apple-itunes-app", content: props.canonicalURL ? `app-id=1200842933, app-argument=${props.canonicalURL}` : 'app-id=1200842933' }),
24
+ props.showSmartBanner &&
25
+ (react_1.default.createElement("meta", { name: "apple-itunes-app", content: props.canonicalURL ? `app-id=1200842933, app-argument=${props.canonicalURL}` : 'app-id=1200842933' })),
25
26
  react_1.default.createElement("link", { rel: "icon", type: "image/svg+xml", href: imageServiceIconURL_1.default('ftlogo-v1:brand-ft-logo-square-coloured', 0, 'svg') }),
26
27
  react_1.default.createElement("link", { rel: "alternate icon", type: "image/png", href: imageServiceIconURL_1.default('ftlogo-v1:brand-ft-logo-square-coloured', 32), sizes: "32x32" }),
27
28
  react_1.default.createElement("link", { rel: "alternate icon", type: "image/png", href: imageServiceIconURL_1.default('ftlogo-v1:brand-ft-logo-square-coloured', 194), sizes: "194x194" }),
@@ -38,6 +39,7 @@ DocumentHead.defaultProps = {
38
39
  siteTitle: 'Financial Times',
39
40
  twitterSite: '@FinancialTimes',
40
41
  manifestFile: 'https://www.ft.com/__assets/creatives/manifest/manifest-v6.json',
41
- additionalMetadata: null
42
+ additionalMetadata: null,
43
+ showSmartBanner: true
42
44
  };
43
45
  exports.default = DocumentHead;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/dotcom-ui-shell",
3
- "version": "4.1.0",
3
+ "version": "5.1.0",
4
4
  "description": "",
5
5
  "main": "component.js",
6
6
  "browser": "browser.js",
@@ -21,18 +21,18 @@
21
21
  "author": "",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@financial-times/dotcom-ui-app-context": "^4.1.0",
25
- "@financial-times/dotcom-ui-base-styles": "^4.1.0",
26
- "@financial-times/dotcom-ui-bootstrap": "^4.1.0",
27
- "@financial-times/dotcom-ui-flags": "^4.1.0",
28
- "@financial-times/dotcom-ui-polyfill-service": "^4.1.0",
24
+ "@financial-times/dotcom-ui-app-context": "^5.1.0",
25
+ "@financial-times/dotcom-ui-base-styles": "^5.1.0",
26
+ "@financial-times/dotcom-ui-bootstrap": "^5.1.0",
27
+ "@financial-times/dotcom-ui-flags": "^5.1.0",
28
+ "@financial-times/dotcom-ui-polyfill-service": "^5.1.0",
29
29
  "mime-types": "^2.1.26"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "16.x || 17.x"
33
33
  },
34
34
  "engines": {
35
- "node": ">= 12.0.0",
35
+ "node": ">= 14.0.0",
36
36
  "npm": "7.x || 8.x"
37
37
  },
38
38
  "repository": {
@@ -15,7 +15,8 @@ export type TDocumentHeadProps = TOpenGraphProps &
15
15
  twitterSite?: string
16
16
  canonicalURL?: string
17
17
  manifestFile?: string
18
- additionalMetadata?: React.ReactNode
18
+ additionalMetadata?: React.ReactNode,
19
+ showSmartBanner?: boolean
19
20
  }
20
21
 
21
22
  const DocumentHead = (props: TDocumentHeadProps) => (
@@ -44,10 +45,14 @@ const DocumentHead = (props: TDocumentHeadProps) => (
44
45
  <OpenGraph openGraph={props.openGraph} />
45
46
 
46
47
  {/* native apps */}
47
- <meta
48
- name="apple-itunes-app"
49
- content={props.canonicalURL ? `app-id=1200842933, app-argument=${props.canonicalURL}` : 'app-id=1200842933'}
50
- />
48
+ {props.showSmartBanner &&
49
+ (
50
+ <meta
51
+ name="apple-itunes-app"
52
+ content={props.canonicalURL ? `app-id=1200842933, app-argument=${props.canonicalURL}` : 'app-id=1200842933'}
53
+ />
54
+ )
55
+ }
51
56
 
52
57
  {/* packaging */}
53
58
  <link
@@ -91,7 +96,8 @@ DocumentHead.defaultProps = {
91
96
  siteTitle: 'Financial Times',
92
97
  twitterSite: '@FinancialTimes',
93
98
  manifestFile: 'https://www.ft.com/__assets/creatives/manifest/manifest-v6.json',
94
- additionalMetadata: null
99
+ additionalMetadata: null,
100
+ showSmartBanner: true
95
101
  }
96
102
 
97
103
  export default DocumentHead