fix: patron modal connect
This commit is contained in:
@@ -6,7 +6,7 @@ import { useEffect, useRef, useState } from "react"
|
||||
import { BoxRadio } from "~/components/ui/BoxRadio"
|
||||
import { Tabs } from "../ui/Tabs"
|
||||
import { useTipCharacter, useGetTips } from "~/queries/site"
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
|
||||
import { toast } from "react-hot-toast"
|
||||
import confetti from "canvas-confetti"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
@@ -28,6 +28,7 @@ export const PatronModal: React.FC<{
|
||||
toCharacterId: site?.metadata?.proof,
|
||||
toNoteId: parsePageId(page?.id || "").noteId,
|
||||
})
|
||||
const connectModal = useConnectModal()
|
||||
|
||||
const radios = [
|
||||
{
|
||||
@@ -69,6 +70,9 @@ export const PatronModal: React.FC<{
|
||||
amount: parseInt(value),
|
||||
noteId: parsePageId(page?.id || "").noteId,
|
||||
})
|
||||
} else {
|
||||
setOpen(false)
|
||||
connectModal.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,15 @@ export const Modal: React.FC<{
|
||||
)}
|
||||
>
|
||||
{title && (
|
||||
<Dialog.Title className="text-lg border-b h-14 flex items-center px-5 space-x-2 py-4">
|
||||
<Dialog.Title className="text-lg border-b h-14 flex items-center px-5 space-x-2 py-4 relative">
|
||||
{titleIcon && <span>{titleIcon}</span>}
|
||||
<span className="truncate flex items-center w-full">{title}</span>
|
||||
<span
|
||||
className="absolute right-1 w-7 h-7 text-xl cursor-pointer bg-white flex items-center justify-center"
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
<i className="i-mingcute:close-line inline-block" />
|
||||
</span>
|
||||
</Dialog.Title>
|
||||
)}
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user