Skip to content

Commit 752dd2d

Browse files
committed
chore(docs): test cookie theme only
1 parent 4eb27ee commit 752dd2d

File tree

1 file changed

+4
-2
lines changed
  • packages/paste-website/src/pages

1 file changed

+4
-2
lines changed

packages/paste-website/src/pages/_app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface AppPageProps {
2424
serverThemeCookie?: ValidThemeName;
2525
}
2626

27-
const App = ({ Component, pageProps, serverThemeCookie }: AppProps & AppPageProps): React.ReactElement => {
27+
const App = ({ Component, pageProps, serverThemeCookie }: AppProps & AppPageProps) => {
2828
const cookieTheme: ValidThemeName =
2929
serverThemeCookie || (parseCookies()[themeCookieKey] as ValidThemeName) || "twilio";
3030
// eslint-disable-next-line no-console
@@ -121,7 +121,7 @@ const App = ({ Component, pageProps, serverThemeCookie }: AppProps & AppPageProp
121121
</>
122122
)}
123123
<Theme.Provider
124-
theme="twilio-dark"
124+
theme={cookieTheme}
125125
customBreakpoints={SITE_BREAKPOINTS}
126126
disableAnimations={inCypress()}
127127
cacheProviderProps={{ key: "next" }}
@@ -142,6 +142,8 @@ App.getInitialProps = async (context: AppContext): Promise<AppPageProps & AppIni
142142
const cookies = context.ctx.req?.headers?.cookie;
143143
const responseCookie = context.ctx?.res?.getHeader(themeCookieKey);
144144

145+
console.log({ cookies, responseCookie });
146+
145147
if (cookies) {
146148
const cookiestring = new RegExp(`${themeCookieKey}=[^;]+`).exec(cookies);
147149
const decodedString = decodeURIComponent(cookiestring ? cookiestring.toString().replace(/^[^=]+./, "") : "");

0 commit comments

Comments
 (0)