Skip to content

Commit

Permalink
Merge pull request #348 from privacy-scaling-explorations/feat/279suc…
Browse files Browse the repository at this point in the history
…cessMessage

feat: success Message when adding member
  • Loading branch information
vplasencia authored Jan 4, 2024
2 parents cff54c6 + 78d3498 commit 464cb2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/dashboard/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement)

root.render(
<AuthContextProvider>
<ChakraProvider theme={theme}>
<ChakraProvider
theme={theme}
toastOptions={{ defaultOptions: { position: "bottom" } }}
>
<Routes />
</ChakraProvider>
</AuthContextProvider>
Expand Down
15 changes: 14 additions & 1 deletion apps/dashboard/src/pages/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
Tooltip,
useClipboard,
useDisclosure,
useToast,
VStack
} from "@chakra-ui/react"
import { useCallback, useEffect, useState, useContext } from "react"
Expand All @@ -45,6 +46,7 @@ import { AuthContext } from "../context/auth-context"
export default function GroupPage(): JSX.Element {
const navigate = useNavigate()
const addMembersModal = useDisclosure()
const toast = useToast()
const { groupId, groupType } = useParams()
const [_group, setGroup] = useState<Group | null>()
const { hasCopied, setValue: setApiKey, onCopy } = useClipboard("")
Expand Down Expand Up @@ -102,8 +104,19 @@ export default function GroupPage(): JSX.Element {
setGroup({ ..._group! })

addMembersModal.onClose()

toast({
title:
memberIds.length > 1 ? "Members added." : "Member added.",
description:
memberIds.length > 1
? " The members have been successfully added to the group."
: "The member has been successfully added to the group.",
status: "success",
duration: 3000
})
},
[_group, addMembersModal]
[_group, addMembersModal, toast]
)

const removeMember = useCallback(
Expand Down

0 comments on commit 464cb2c

Please sign in to comment.