Skip to content

Commit 9eea264

Browse files
authored
fix(favicon): re-embed dynamic favicon into index.html (redhat-developer#2408)
fixes https://issues.redhat.com/browse/RHIDP-6015 - do not show janus favicons if a custom favicon is set, so that there are no issues with which favicon should take priority - do not use the "Janus Community Showcase" metadata description if `app.title` is set - move the favicon `ConfigUpdater`to outside the `AppRouter` component so that it can work in the `OauthRequestDialog` before: ![before](https://i.imgur.com/XC50VxV.png) after: ![after](https://i.imgur.com/konWQrQ.png)
1 parent ca0c16b commit 9eea264

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

packages/app/public/index.html

+19-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<meta name="theme-color" content="#000000" />
7-
<meta name="description" content="Janus Community Showcase" />
7+
<meta
8+
name="description"
9+
content="<%= config.getOptionalString('app.title') ?? 'Red Hat Developer Hub' %>"
10+
/>
11+
<% if (config.getOptionalString('app.branding.iconLogo')) { %>
12+
<link
13+
rel="icon"
14+
href="<%= config.getOptionalString('app.branding.iconLogo') %>"
15+
id="dynamic-favicon"
16+
/>
17+
<% } else { %>
818
<link rel="apple-touch-icon" href="<%= publicPath %>/logo192.png" />
919
<link
1020
rel="manifest"
1121
href="<%= publicPath %>/manifest.json"
1222
crossorigin="use-credentials"
1323
/>
14-
<link rel="icon" href="<%= publicPath %>/favicon.ico" />
15-
<link rel="shortcut icon" href="<%= publicPath %>/favicon.ico" />
1624
<link
1725
rel="apple-touch-icon"
1826
sizes="180x180"
@@ -35,7 +43,14 @@
3543
href="<%= publicPath %>/safari-pinned-tab.svg"
3644
color="#5bbad5"
3745
/>
38-
<link rel="icon" id="dynamic-favicon" href="/favicon.ico" />
46+
<link
47+
rel="icon"
48+
id="dynamic-favicon"
49+
href="<%= publicPath %>/favicon.ico"
50+
/>
51+
<link rel="shortcut icon" href="<%= publicPath %>/favicon.ico" />
52+
<% } %>
53+
3954
<title><%= config.getOptionalString('app.title') ?? 'Backstage' %></title>
4055
</head>
4156
<body>

packages/app/src/components/AppBase/AppBase.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ const AppBase = () => {
7676
<AppProvider>
7777
<AlertDisplay />
7878
<OAuthRequestDialog />
79+
<ConfigUpdater />
7980
<AppRouter>
80-
<ConfigUpdater />
8181
<ApplicationListener />
8282
<Root>
8383
<ApplicationProvider>

0 commit comments

Comments
 (0)