From 1d4524774bce535746bfb003b2f1cf41428ebc01 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Thu, 21 Jul 2022 01:33:06 -0700 Subject: [PATCH] Make sidebar login button trigger SSR reload --- web/components/create-question-button.tsx | 9 ++++++++- web/pages/index.tsx | 14 -------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/web/components/create-question-button.tsx b/web/components/create-question-button.tsx index 277816fa..1b8ac11e 100644 --- a/web/components/create-question-button.tsx +++ b/web/components/create-question-button.tsx @@ -1,4 +1,5 @@ import Link from 'next/link' +import { useRouter } from 'next/router' import clsx from 'clsx' import { firebaseLogin, User } from 'web/lib/firebase/users' import React from 'react' @@ -16,6 +17,7 @@ export const CreateQuestionButton = (props: { 'from-indigo-500 to-blue-500 hover:from-indigo-700 hover:to-blue-700' const { user, overrideText, className, query } = props + const router = useRouter() return (
{user ? ( @@ -26,7 +28,12 @@ export const CreateQuestionButton = (props: { ) : (