feat: Add CDN support (#1817)

* chore: CSP

* chore: Optionally use CDN for serving images
This commit is contained in:
Tom Moor
2021-01-16 11:12:10 -08:00
committed by GitHub
parent 1fd2ec31fd
commit 522df125aa
16 changed files with 77 additions and 28 deletions

View File

@@ -1,16 +1,17 @@
// @flow
import { observer, inject } from "mobx-react";
import { observer } from "mobx-react";
import * as React from "react";
import { Helmet } from "react-helmet";
import AuthStore from "stores/AuthStore";
import useStores from "hooks/useStores";
import { cdnPath } from "utils/urls";
type Props = {
type Props = {|
title: string,
favicon?: string,
auth: AuthStore,
};
|};
const PageTitle = observer(({ auth, title, favicon }: Props) => {
const PageTitle = ({ title, favicon }: Props) => {
const { auth } = useStores();
const { team } = auth;
return (
@@ -21,12 +22,12 @@ const PageTitle = observer(({ auth, title, favicon }: Props) => {
<link
rel="shortcut icon"
type="image/png"
href={favicon || "/favicon-32.png"}
href={favicon || cdnPath("/favicon-32.png")}
sizes="32x32"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
);
});
};
export default inject("auth")(PageTitle);
export default observer(PageTitle);