This commit is contained in:
soupette 2019-08-23 11:11:40 +02:00
parent e9e1bf5100
commit a0215fbf58
3 changed files with 14 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { get, upperFirst } from 'lodash'; import { get, upperFirst } from 'lodash';
import { auth } from 'strapi-helper-plugin'; import { auth } from 'strapi-helper-plugin';
import favicon from '../../favicon.ico';
import useFetch from './hooks'; import useFetch from './hooks';
import { import {
@ -100,7 +101,12 @@ const HomePage = ({ global: { plugins }, history: { push } }) => {
return ( return (
<> <>
<FormattedMessage id="HomePage.helmet.title"> <FormattedMessage id="HomePage.helmet.title">
{title => <Helmet title={title} />} {title => (
<Helmet
title={title}
link={[{ rel: 'icon', type: 'image/png', href: favicon }]}
/>
)}
</FormattedMessage> </FormattedMessage>
<Container className="container-fluid"> <Container className="container-fluid">
<div className="row"> <div className="row">

View File

@ -10,6 +10,7 @@ import { get } from 'lodash';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
import { BlockerComponent } from 'strapi-helper-plugin'; import { BlockerComponent } from 'strapi-helper-plugin';
import favicon from '../../favicon.ico';
import { LOGIN_LOGO } from '../../config'; import { LOGIN_LOGO } from '../../config';
import ErrorBoundary from '../ErrorBoundary'; import ErrorBoundary from '../ErrorBoundary';
@ -46,7 +47,10 @@ export function PluginDispatcher(props) {
return ( return (
<div> <div>
<Helmet title={`Strapi - ${name}`} /> <Helmet
title={`Strapi - ${name}`}
link={[{ rel: 'icon', type: 'image/png', href: favicon }]}
/>
<ErrorBoundary> <ErrorBoundary>
<PluginEntryComponent <PluginEntryComponent
{...props} {...props}

View File

@ -193,7 +193,7 @@ module.exports = ({
use: 'file-loader', use: 'file-loader',
}, },
{ {
test: /\.(jpg|png|gif)$/, test: /\.(jpg|png|gif|ico)$/,
loaders: [ loaders: [
require.resolve('file-loader'), require.resolve('file-loader'),
{ {
@ -241,7 +241,7 @@ module.exports = ({
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: true, inject: true,
template: path.resolve(__dirname, 'index.html'), template: path.resolve(__dirname, 'index.html'),
favicon: path.resolve(__dirname, 'admin/src/favicon.ico'), // favicon: path.resolve(__dirname, 'admin/src/favicon.ico'),
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify( 'process.env.NODE_ENV': JSON.stringify(