Move useOrganization outside ShareSecretForm as it's used on a public page

This commit is contained in:
carlosmonastyrski
2025-03-14 16:12:40 -03:00
parent 4f4764dfcd
commit ea27870ce3
2 changed files with 12 additions and 4 deletions
@@ -1,4 +1,5 @@
import { Modal, ModalContent } from "@app/components/v2";
import { useOrganization } from "@app/context";
import { UsePopUpState } from "@app/hooks/usePopUp";
import { ShareSecretForm } from "@app/pages/public/ShareSecretPage/components";
@@ -11,6 +12,7 @@ type Props = {
};
export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {
const { currentOrg } = useOrganization();
return (
<Modal
isOpen={popUp?.createSharedSecret?.isOpen}
@@ -25,6 +27,9 @@ export const AddShareSecretModal = ({ popUp, handlePopUpToggle }: Props) => {
<ShareSecretForm
isPublic={false}
value={(popUp.createSharedSecret.data as { value?: string })?.value}
allowSecretSharingOutsideOrganization={
currentOrg?.allowSecretSharingOutsideOrganization ?? true
}
/>
</ModalContent>
</Modal>