diff --git a/web/components/button.tsx b/web/components/button.tsx index 843f74ca..f2d13022 100644 --- a/web/components/button.tsx +++ b/web/components/button.tsx @@ -52,7 +52,7 @@ export function Button(props: { color === 'yellow' && 'bg-yellow-400 text-white hover:bg-yellow-500', color === 'blue' && 'bg-blue-400 text-white hover:bg-blue-500', color === 'indigo' && 'bg-indigo-500 text-white hover:bg-indigo-600', - color === 'gray' && 'bg-gray-100 text-gray-600 hover:bg-gray-200', + color === 'gray' && 'bg-gray-50 text-gray-600 hover:bg-gray-200', color === 'gradient' && 'bg-gradient-to-r from-indigo-500 to-blue-500 text-white hover:from-indigo-700 hover:to-blue-700', color === 'gray-white' && diff --git a/web/components/create-question-button.tsx b/web/components/create-question-button.tsx index 0ea28635..30be2276 100644 --- a/web/components/create-question-button.tsx +++ b/web/components/create-question-button.tsx @@ -1,8 +1,8 @@ -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' +import Link from 'next/link' +import clsx from 'clsx' + +import { User } from 'web/lib/firebase/users' export const createButtonStyle = 'border-w-0 mx-auto mt-4 -ml-1 w-full rounded-md bg-gradient-to-r py-2.5 text-base font-semibold text-white shadow-sm lg:-ml-0 h-11' @@ -17,31 +17,16 @@ 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() - if (user?.isBannedFromPosting) return <> + if (!user || user?.isBannedFromPosting) return <> return (
- {user ? ( - - - - ) : ( - - )} +
) } diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 995378ee..f40cd80e 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -28,6 +28,7 @@ import { Spacer } from '../layout/spacer' import { CHALLENGES_ENABLED } from 'common/challenge' import { buildArray } from 'common/util/array' import TrophyIcon from 'web/lib/icons/trophy-icon' +import { SignInButton } from '../sign-in-button' const logout = async () => { // log out, and then reload the page, in case SSR wants to boot them out @@ -240,7 +241,8 @@ export default function Sidebar(props: { className?: string }) { > - + {user ? : } + {user && (
diff --git a/web/components/sign-in-button.tsx b/web/components/sign-in-button.tsx new file mode 100644 index 00000000..d4682cb5 --- /dev/null +++ b/web/components/sign-in-button.tsx @@ -0,0 +1,25 @@ +import React from 'react' +import { useRouter } from 'next/router' + +import { firebaseLogin, User } from 'web/lib/firebase/users' +import { Button } from './button' + +export const SignInButton = (props: { +}) => { + const router = useRouter() + + return ( + + ) +}