diff --git a/src/components/Header/AfterLogin/ActionNavigate.tsx b/src/components/Header/AfterLogin/ActionNavigate.tsx
index b71c94e..0a3f4cd 100644
--- a/src/components/Header/AfterLogin/ActionNavigate.tsx
+++ b/src/components/Header/AfterLogin/ActionNavigate.tsx
@@ -5,8 +5,9 @@ import ActionItem from "./ActionItem";
type InputProps = {
text: string;
to: string;
+ onClick: () => void;
};
-const ActionNavigate = ({ text, to }: InputProps) => {
+const ActionNavigate = ({ text, to, onClick }: InputProps) => {
const navigate = useNavigate();
const { handleCloseNavMenu } = useHeaderCtx();
@@ -15,6 +16,7 @@ const ActionNavigate = ({ text, to }: InputProps) => {
onClick={() => {
navigate(to);
handleCloseNavMenu();
+ onClick();
}}
>
{text}
diff --git a/src/components/Header/AfterLogin/Subscribe.tsx b/src/components/Header/AfterLogin/Subscribe.tsx
index 518602d..d8dea4f 100644
--- a/src/components/Header/AfterLogin/Subscribe.tsx
+++ b/src/components/Header/AfterLogin/Subscribe.tsx
@@ -1,4 +1,5 @@
import { UserInfo } from "apis/api";
+import { useUnsubscribeToStripe } from "components/Stripe/useUnsubscribeToStripe";
import { pricing } from "const/urls";
import ActionItem from "./ActionItem";
import ActionNavigate from "./ActionNavigate";
@@ -8,10 +9,16 @@ type InputProps = {
};
const Subscribe = ({ handleClose, userInfo }: InputProps) => {
+ const { openModal, renderUnsubscribe } = useUnsubscribeToStripe({
+ onCloseModal: handleClose
+ });
return userInfo.isPremium ? (
- Unsubscribe
+ <>
+ Unsubscribe
+ {renderUnsubscribe}
+ >
) : (
-
+
);
};
diff --git a/src/components/Header/AfterLogin/useActions.tsx b/src/components/Header/AfterLogin/useActions.tsx
index 89ff7cc..e34790a 100644
--- a/src/components/Header/AfterLogin/useActions.tsx
+++ b/src/components/Header/AfterLogin/useActions.tsx
@@ -41,12 +41,14 @@ const useActions = () => {
key="NewPlugin"
text="New Plugins"
to={`/${pluginBuilder("new")}`}
+ onClick={handleClose}
/>,
,
,
,
{
+ const navigate = useNavigate();
+ return (
+
+ );
+};
+
+export default GoToContact;
diff --git a/src/components/Stripe/GoToPlugins.tsx b/src/components/Stripe/GoToPlugins.tsx
index a4e8b8e..56789b7 100644
--- a/src/components/Stripe/GoToPlugins.tsx
+++ b/src/components/Stripe/GoToPlugins.tsx
@@ -1,15 +1,10 @@
-import { Button } from "@mui/material";
+import Button from "components/Button";
import { useUserInfoCtx } from "components/UserInfo/UserInfo";
const GoToPlugins = () => {
const { handleLogin } = useUserInfoCtx();
return (
-