diff --git a/src/pages/PostsPage.jsx b/src/pages/PostsPage.jsx index 6a048dc..ac167be 100644 --- a/src/pages/PostsPage.jsx +++ b/src/pages/PostsPage.jsx @@ -1,4 +1,6 @@ import React from 'react'; +import { useDispatch } from 'react-redux'; +import { useNavigate } from 'react-router-dom'; import Swal from 'sweetalert2'; import BackButton from '../components/common/navBar/BackButton'; @@ -26,62 +28,80 @@ function PostsPage() { confirmButtonText: CONFIRM, cancelButtonText: CANCEL, reverseButtons: true, + }).then((result) => { + if (result.isConfirmed) navigate('/signin'); }); }; + const navigate = useNavigate(); + const dispatch = useDispatch(); + + const imageUrl = JSON.parse(localStorage.getItem('imageUrl')); + const title = JSON.parse(localStorage.getItem('title')); + const category = JSON.parse(localStorage.getItem('category')); + const totalAmount = JSON.parse(localStorage.getItem('totalAmount')); + const maxPeople = JSON.parse(localStorage.getItem('maxPeople')); + const textarea = JSON.parse(localStorage.getItem('textarea')); + + const divisionAmount = (totalAmount / (maxPeople + 1)).toLocaleString(); + return ( -