From 3f932c2a69814de4bb79a8295749f9967d377686 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Wed, 19 Jan 2022 05:44:56 +0000 Subject: [PATCH 1/4] Port over SafeHydrate component --- site/pages/_app.tsx | 19 +++++++++++++++---- site/pages/_document.tsx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 site/pages/_document.tsx diff --git a/site/pages/_app.tsx b/site/pages/_app.tsx index 9cb8010a5dbea..65662289655c6 100644 --- a/site/pages/_app.tsx +++ b/site/pages/_app.tsx @@ -40,16 +40,27 @@ const Contents: React.FC = ({ Component, pageProps }) => { ) } +/** + * SafeHydrate is a component that only allows its children to be rendered + * client-side. This check is performed by querying the existence of the window + * global. + */ +const SafeHydrate: React.FC = ({ children }) => ( +
{typeof window === "undefined" ? null : children}
+) + /** * is the root rendering logic of the application - setting up our router * and any contexts / global state management. */ const MyApp: React.FC = (appProps) => { return ( - - - - + + + + + + ) } diff --git a/site/pages/_document.tsx b/site/pages/_document.tsx new file mode 100644 index 0000000000000..7c866c59f31da --- /dev/null +++ b/site/pages/_document.tsx @@ -0,0 +1,34 @@ +import Document, { DocumentContext, Head, Html, Main, NextScript } from "next/document" +import React from "react" + +class MyDocument extends Document { + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + static async getInitialProps(ctx: DocumentContext) { + const initialProps = await Document.getInitialProps(ctx) + return { ...initialProps } + } + + render(): JSX.Element { + return ( + + + {/* Meta tags */} + + + + + + + + + + +
+ + + + ) + } +} + +export default MyDocument \ No newline at end of file From 97b23832e80a689657d0c3b1f976e89fc409b111 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Wed, 19 Jan 2022 05:47:26 +0000 Subject: [PATCH 2/4] Add missed favicons --- site/pages/_document.tsx | 6 +++--- site/static/favicon.ico | Bin 0 -> 4286 bytes site/static/favicon.png | Bin 0 -> 571 bytes site/static/favicon.svg | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 site/static/favicon.ico create mode 100644 site/static/favicon.png create mode 100644 site/static/favicon.svg diff --git a/site/pages/_document.tsx b/site/pages/_document.tsx index 7c866c59f31da..58fb1adbdfeb7 100644 --- a/site/pages/_document.tsx +++ b/site/pages/_document.tsx @@ -18,9 +18,9 @@ class MyDocument extends Document { - - - + + +
diff --git a/site/static/favicon.ico b/site/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2e20e00e1a1dcb5779342ed92cb5bf133a3b041b GIT binary patch literal 4286 zcmeHHJ8l~>5T)Y6MG6TBkTz4MRFOU#=mNfhm=i=dFacjcH;~J8$_==|9zaJ}-9RZ_ z1YzEjIKhBfiIQCf(KFu8aOTZtxwf4f;YY;r>Ap^!d+VHg4a2H!gU%*STM8P?;ttR9lQq-<; z{1OufdIZEumO6okScAITW*<2`1m+IpJ)MH>8%_z4djxgXDr*-e#+-t?@EkR8#4=AE z>A_PFBvq^L>P?I}h3a-1IASB>s`W=SHmuq{2U(*rT7|wpV^a+d*oc_c`+>X-H8`lY z_Wt&}^r#bX2OYK&GPaIBs=?i|52sCQ!b^oT109O~JFmi0=;CLrNK zjnirz?*5&rwR!b-IZu7e8V^e}pz2D?x+$m-I99{_Qj@Tf&x~6g{WYkN>~NnASZaA* zfdZEJf`IKGOF=#hEO)oPsck^XwujX`dr~jpF>qg7!`gUEoa6Vf)YUkz^kMq0=(E6? zJJ(R&ncbyFv7Nodd6mg|79Iy%YjZV!0>M4F24m(NR={)NA$;!q+6?v%1LTeh59cNG z1M2xLJXqeXAT~tao5I6+$^2;QziHEK8(42x?uXQ0|9=>}1dkBw{ylsF6;n7(LCvYP z`}6PhQY=uQ^VPCv4g6-RS9?xf*;f$gi(Wj}5FpUGYKOj0tq=18Mv(W%UOiYtfI#PN z;LmFX*Zlu;18E4`n{jGKH>q_G;Ot%Zl=*WuhJV}rn7Ntz6kfTu{V>`-xpDi;eQcBa Z+@+AZltPy}@}W!L!8V~6xJ|d^xZhhaYyAKK literal 0 HcmV?d00001 diff --git a/site/static/favicon.png b/site/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb0c8c8062b5603f44c42a695670b2b48477de6 GIT binary patch literal 571 zcmV-B0>u4^P)@1z3&;l zT<&rqhrq-{7)q^rlL-iF>(jGMzOKcCvQr%nXlj{Lcfs}GUx*Ca&N>uyWkG)iY(zyMjmIu z7cD)D)oAawZ6>Mli{U>OTNNHd+84gyI}>cf7Ri`BWeewKeu;iXO0>5o6}D3|%HVIY zoWhfUM4`K(+>^i&YQ;0={EBfem?0{yH}?HyXfh>WOH3{E8`ojW#u3gWV1r&OIHB11 z?7M) \ No newline at end of file From 086d5332d622f0ceaeb21c46b2630ed4491cf804 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Wed, 19 Jan 2022 05:58:56 +0000 Subject: [PATCH 3/4] Formatting --- site/pages/_document.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/pages/_document.tsx b/site/pages/_document.tsx index 58fb1adbdfeb7..a32706ebf6fe2 100644 --- a/site/pages/_document.tsx +++ b/site/pages/_document.tsx @@ -31,4 +31,4 @@ class MyDocument extends Document { } } -export default MyDocument \ No newline at end of file +export default MyDocument From 7f3f409e176f9b58ce2fdde7617a1bf6387fab42 Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Wed, 19 Jan 2022 20:20:10 +0000 Subject: [PATCH 4/4] Rename SafeHydrate -> ClientRender; remove inaccurate comment --- site/pages/_app.tsx | 8 ++++---- site/pages/_document.tsx | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/site/pages/_app.tsx b/site/pages/_app.tsx index 65662289655c6..f57ad10d6c774 100644 --- a/site/pages/_app.tsx +++ b/site/pages/_app.tsx @@ -41,11 +41,11 @@ const Contents: React.FC = ({ Component, pageProps }) => { } /** - * SafeHydrate is a component that only allows its children to be rendered + * ClientRender is a component that only allows its children to be rendered * client-side. This check is performed by querying the existence of the window * global. */ -const SafeHydrate: React.FC = ({ children }) => ( +const ClientRender: React.FC = ({ children }) => (
{typeof window === "undefined" ? null : children}
) @@ -55,12 +55,12 @@ const SafeHydrate: React.FC = ({ children }) => ( */ const MyApp: React.FC = (appProps) => { return ( - + - + ) } diff --git a/site/pages/_document.tsx b/site/pages/_document.tsx index a32706ebf6fe2..12a08ff3f8c62 100644 --- a/site/pages/_document.tsx +++ b/site/pages/_document.tsx @@ -12,7 +12,6 @@ class MyDocument extends Document { return ( - {/* Meta tags */}