Skip to content

Commit

Permalink
Re-add accidentally removed button
Browse files Browse the repository at this point in the history
  • Loading branch information
TomiOhl committed Oct 15, 2024
1 parent d6beac2 commit 7edf8ba
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/[guild]/EditGuild/components/LeaveGuildButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AlertDialogFooter,
AlertDialogHeader,
AlertDialogOverlay,
ButtonProps,
useDisclosure,
} from "@chakra-ui/react"
import useLeaveGuild from "components/[guild]/LeaveButton/hooks/useLeaveGuild"
Expand All @@ -14,8 +15,8 @@ import useMembership from "components/explorer/hooks/useMembership"
import { useRouter } from "next/navigation"
import { useRef } from "react"

const LeaveGuildButton = () => {
const { isOpen, onClose } = useDisclosure()
const LeaveGuildButton = (props: ButtonProps) => {
const { isOpen, onOpen, onClose } = useDisclosure()
const cancelRef = useRef()
const router = useRouter()

Expand All @@ -27,6 +28,15 @@ const LeaveGuildButton = () => {

return (
<>
<Button
aria-label="Leave guild"
data-testid="leave-button"
onClick={onOpen}
{...props}
>
Leave guild
</Button>

<Alert leastDestructiveRef={cancelRef} onClose={onClose} isOpen={isOpen}>
<AlertDialogOverlay />

Expand Down

0 comments on commit 7edf8ba

Please sign in to comment.