diff --git a/src/components/modules/comment/CommentBox/SignedOutContent.tsx b/src/components/modules/comment/CommentBox/SignedOutContent.tsx index 712f09b4ac..c13f2646cd 100644 --- a/src/components/modules/comment/CommentBox/SignedOutContent.tsx +++ b/src/components/modules/comment/CommentBox/SignedOutContent.tsx @@ -1,13 +1,26 @@ 'use client' +import clsx from 'clsx' +import { useEffect } from 'react' + import { useSessionReader } from '~/atoms/hooks/reader' import { StyledButton } from '~/components/ui/button' -import { AuthProvidersRender } from '~/queries/hooks/authjs' +import { AuthProvidersRender, useAuthProviders } from '~/queries/hooks/authjs' import { CommentBoxMode, setCommentMode } from './hooks' export function CommentBoxSignedOutContent() { const isReaderLogin = !!useSessionReader() + const providers = useAuthProviders() + const hasProviders = providers && Object.keys(providers).length > 0 + + useEffect(() => { + if (!providers) return + if (Object.keys(providers).length === 0) { + setCommentMode(CommentBoxMode.legacy) + } + }, [providers]) + if (isReaderLogin) return null return ( @@ -16,7 +29,7 @@ export function CommentBoxSignedOutContent() { { diff --git a/src/queries/hooks/authjs.tsx b/src/queries/hooks/authjs.tsx index af5ac845a2..135c4a652e 100644 --- a/src/queries/hooks/authjs.tsx +++ b/src/queries/hooks/authjs.tsx @@ -61,7 +61,7 @@ export const AuthProvidersRender: FC = () => { }) }} > -
+
{!authProcessingLockSet.has(provider) ? ( {provider === 'github' ? (