Skip to content

Commit

Permalink
feat: comment oauth set url
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed May 20, 2024
1 parent 4dd56bb commit 54eaf32
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/layout/header/internal/UserAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client'

import React from 'react'
import { AnimatePresence } from 'framer-motion'
import dynamic from 'next/dynamic'
import Image from 'next/image'
Expand Down Expand Up @@ -62,6 +61,7 @@ export function UserAuth() {
const isLogged = useIsLogged()

const isDark = useIsDark()

if (isLogged) {
return <OwnerAvatar />
}
Expand Down
13 changes: 13 additions & 0 deletions src/components/modules/comment/CommentBox/AuthedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ export const CommentBoxAuthedInput = () => {
setter('avatar', user.imageUrl)
setter('mail', user.primaryEmailAddress?.emailAddress || '')

for (const account of user.externalAccounts) {
if (account.provider === 'github') {
account.username &&
setter('url', `https://github.com/${account.username}`)
break
}

if (account.provider === 'twitter') {
account.username && setter('url', `https://x.com/${account.username}`)
break
}
}

const strategy = user.primaryEmailAddress?.verification.strategy

strategy && setter('source', strategy)
Expand Down
4 changes: 3 additions & 1 deletion src/styles/clerk.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
--accent: theme('colors.zinc.900');
--accentDark: theme('colors.zinc.800');
}

.cl-userButtonPopoverCard.cl-userButton-popover {
@apply pt-0;
}
.cl-cardBox {
@apply overflow-visible;
}
Expand Down

0 comments on commit 54eaf32

Please sign in to comment.